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

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

Issue 1072623002: refactor optype to better filter invocation/prefixed suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
index 17594f83d69abc4b25446f1328db2d543ee43f20..5608f8f9bc959c40460f1d992983ae7c17b8563b 100644
--- a/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
@@ -30,17 +30,19 @@ class ImportedReferenceContributor extends DartCompletionContributor {
@override
bool computeFast(DartCompletionRequest request) {
OpType optype = request.optype;
- if (optype.includeReturnValueSuggestions ||
- optype.includeTypeNameSuggestions ||
- optype.includeVoidReturnSuggestions ||
- optype.includeConstructorSuggestions) {
- builder = new _ImportedSuggestionBuilder(request, optype);
- builder.shouldWaitForLowPrioritySuggestions =
- shouldWaitForLowPrioritySuggestions;
- // If target is an argument in an argument list
- // then suggestions may need to be adjusted
- suggestionsComputed = builder.computeFast(request.target.containingNode);
- return suggestionsComputed && request.target.argIndex == null;
+ if (!optype.isPrefixed) {
+ if (optype.includeReturnValueSuggestions ||
+ optype.includeTypeNameSuggestions ||
+ optype.includeVoidReturnSuggestions ||
+ optype.includeConstructorSuggestions) {
+ builder = new _ImportedSuggestionBuilder(request, optype);
+ builder.shouldWaitForLowPrioritySuggestions =
+ shouldWaitForLowPrioritySuggestions;
+ // If target is an argument in an argument list
+ // then suggestions may need to be adjusted
+ suggestionsComputed = builder.computeFast(request.target.containingNode);
+ return suggestionsComputed && request.target.argIndex == null;
+ }
}
return true;
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698