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

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

Issue 977223003: When target requires a function, propose a function reference, not an invocation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge and update editor to process IDENTIFIER suggestions Created 5 years, 10 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 fdbb38c8bda717f8ebafa96edddb9e2aa91eb00a..8f70ab8e97f461911c1171863ab08519a38acb36 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -104,18 +104,25 @@ class LocalComputer extends DartCompletionComputer {
new _ConstructorVisitor(request).visit(request.node);
}
- // If the unit is not a part and does not reference any parts
- // then work is complete
- return !request.unit.directives.any((Directive directive) =>
- directive is PartOfDirective || directive is PartDirective);
+ // If target is an argument in an argument list
+ // then suggestions may need to be adjusted
+ return request.target.argIndex == null;
}
@override
Future<bool> computeFull(DartCompletionRequest request) {
- // TODO: implement computeFull
- // include results from part files that are included in the library
+ _updateSuggestions(request);
return new Future.value(false);
}
+
+ /**
+ * If target is a function argument, suggest identifiers not invocations
+ */
+ void _updateSuggestions(DartCompletionRequest request) {
+ if (request.target.isFunctionalArgument()) {
+ request.convertInvocationsToIdentifiers();
+ }
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698