Index: pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart |
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart |
index 4cb0ab7415816be89a54ec62ac181638097f1948..87001d3876091493aa05f8490a6a2e0f4c9464f2 100644 |
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart |
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart |
@@ -240,14 +240,16 @@ class DartCompletionCache extends CompletionCache { |
} |
} |
} else if (directive is PartDirective) { |
- CompilationUnitElement partElem = directive.element; |
- if (partElem != null && partElem.source != source) { |
- partElem.accept(new _NonLocalElementCacheVisitor(this)); |
- } |
+ // Suggested by LocalLibraryContributor |
+ // CompilationUnitElement partElem = directive.element; |
+ // if (partElem != null && partElem.source != source) { |
+ // partElem.accept(new _NonLocalElementCacheVisitor(this)); |
+ // } |
} |
}); |
if (libSource != source) { |
- libUnit.element.accept(new _NonLocalElementCacheVisitor(this)); |
+ // Suggested by LocalLibraryContributor |
+ // libUnit.element.accept(new _NonLocalElementCacheVisitor(this)); |
} |
} |
} |
@@ -353,44 +355,3 @@ class DartCompletionCache extends CompletionCache { |
return new Future.value(null); |
} |
} |
- |
-/** |
- * A visitor for building suggestions based upon the elements defined by |
- * a source file contained in the same library but not the same as |
- * the source in which the completions are being requested. |
- */ |
-class _NonLocalElementCacheVisitor extends GeneralizingElementVisitor { |
- final DartCompletionCache cache; |
- |
- _NonLocalElementCacheVisitor(this.cache); |
- |
- @override |
- void visitClassElement(ClassElement element) { |
- cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); |
- } |
- |
- @override |
- void visitCompilationUnitElement(CompilationUnitElement element) { |
- element.visitChildren(this); |
- } |
- |
- @override |
- void visitElement(Element element) { |
- // ignored |
- } |
- |
- @override |
- void visitFunctionElement(FunctionElement element) { |
- cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); |
- } |
- |
- @override |
- void visitFunctionTypeAliasElement(FunctionTypeAliasElement element) { |
- cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); |
- } |
- |
- @override |
- void visitTopLevelVariableElement(TopLevelVariableElement element) { |
- cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); |
- } |
-} |