Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(958)

Unified Diff: pkg/analysis_server/lib/src/services/completion/local_computer.dart

Issue 620293002: refactor library prefix suggestion generation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/services/completion/local_computer.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/local_computer.dart b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
index 84edaef9862aab3891d3a38aaaa02ba2f4193bc7..7676381f0d6d265e4758a2f943cb695c3f597dc2 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -104,11 +104,6 @@ class _LocalVisitor extends GeneralizingAstVisitor<dynamic> {
@override
visitCompilationUnit(CompilationUnit node) {
- node.directives.forEach((Directive directive) {
- if (directive is ImportDirective) {
- _addLibraryPrefixSuggestion(directive);
- }
- });
node.declarations.forEach((Declaration declaration) {
if (declaration is ClassDeclaration) {
_addClassSuggestion(declaration);
@@ -257,22 +252,6 @@ class _LocalVisitor extends GeneralizingAstVisitor<dynamic> {
}
}
- void _addLibraryPrefixSuggestion(ImportDirective directive) {
- CompletionSuggestion suggestion = _addSuggestion(
- directive.prefix,
- CompletionSuggestionKind.LIBRARY_PREFIX,
- null,
- null);
- if (suggestion != null) {
- suggestion.element = _createElement(
- protocol.ElementKind.LIBRARY,
- directive.prefix,
- NO_RETURN_TYPE,
- false,
- false);
- }
- }
-
void _addLocalVarSuggestion(SimpleIdentifier id, TypeName returnType) {
CompletionSuggestion suggestion =
_addSuggestion(id, CompletionSuggestionKind.LOCAL_VARIABLE, returnType, null);

Powered by Google App Engine
This is Rietveld 408576698