| Index: pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart
|
| diff --git a/pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart b/pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart
|
| index 9a2d3b41016c44eabb0092e3e37fc10e258b7893..f8cb90a86815426e68f96b0b1d909bcf08bfa5de 100644
|
| --- a/pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart
|
| +++ b/pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart
|
| @@ -29,8 +29,14 @@ abstract class DartNavigationMixin implements NavigationMixin {
|
| AnalysisGetNavigationParams parameters) async {
|
| String path = parameters.file;
|
| ResolveResult result = await getResolveResult(path);
|
| + int offset = parameters.offset;
|
| + int length = parameters.length;
|
| + if (offset < 0 && length < 0) {
|
| + offset = 0;
|
| + length = result.content.length;
|
| + }
|
| return new DartNavigationRequestImpl(
|
| - resourceProvider, parameters.offset, parameters.length, result);
|
| + resourceProvider, offset, length, result);
|
| }
|
| }
|
|
|
| @@ -69,4 +75,23 @@ abstract class NavigationMixin implements ServerPlugin {
|
| result.sendNotifications(channel);
|
| return result.result;
|
| }
|
| +
|
| + /**
|
| + * Send a navigation notification for the file with the given [path] to the
|
| + * server.
|
| + */
|
| + @override
|
| + Future<Null> sendNavigationNotification(String path) async {
|
| + try {
|
| + NavigationRequest request = await getNavigationRequest(
|
| + new AnalysisGetNavigationParams(path, -1, -1));
|
| + NavigationGenerator generator =
|
| + new NavigationGenerator(getNavigationContributors(path));
|
| + GeneratorResult generatorResult =
|
| + await generator.generateNavigationNotification(request);
|
| + generatorResult.sendNotifications(channel);
|
| + } on RequestFailure {
|
| + // If we couldn't analyze the file, then don't send a notification.
|
| + }
|
| + }
|
| }
|
|
|