| Index: pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart | 
| diff --git a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart | 
| index 7f58ad77b31aafeae1efd4d3902de874e27f31f6..a4971ce51f03efcb9a1f2202dc668d0bf57c38f0 100644 | 
| --- a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart | 
| +++ b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart | 
| @@ -58,8 +58,7 @@ class _DartNavigationCollector { | 
| if (element.location == null) { | 
| return; | 
| } | 
| -    protocol.ElementKind kind = | 
| -        protocol.convertElementKind(element.kind); | 
| +    protocol.ElementKind kind = protocol.convertElementKind(element.kind); | 
| protocol.Location location = protocol.newLocation_fromElement(element); | 
| if (location == null) { | 
| return; | 
| @@ -326,9 +325,11 @@ class _DartRangeAstVisitor extends UnifyingAstVisitor { | 
| return; | 
| } | 
| // The node starts or ends in the range. | 
| -    if (isInRange(node.offset) || isInRange(node.end)) { | 
| -      node.accept(visitor); | 
| -      return; | 
| +    if (node is! CompilationUnit) { | 
| +      if (isInRange(node.offset) || isInRange(node.end) || node is Directive) { | 
| +        node.accept(visitor); | 
| +        return; | 
| +      } | 
| } | 
| // Go deeper. | 
| super.visitNode(node); | 
|  |