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

Unified Diff: pkg/analysis_server/lib/src/services/completion/local_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
Index: pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
index f547a746f8dd6dd0919eb31d49e664b9349d7ac0..12cdd5e2848ea43bc554891e94ef4bd6ca96e140 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
@@ -87,22 +87,24 @@ class LocalReferenceContributor extends DartCompletionContributor {
// Collect suggestions from the specific child [AstNode] that contains
// the completion offset and all of its parents recursively.
- if (optype.includeReturnValueSuggestions ||
- optype.includeTypeNameSuggestions ||
- optype.includeVoidReturnSuggestions) {
- _LocalVisitor localVisitor =
- new _LocalVisitor(request, request.offset, optype);
- localVisitor.visit(request.target.containingNode);
- }
- if (optype.includeStatementLabelSuggestions ||
- optype.includeCaseLabelSuggestions) {
- _LabelVisitor labelVisitor = new _LabelVisitor(request,
- optype.includeStatementLabelSuggestions,
- optype.includeCaseLabelSuggestions);
- labelVisitor.visit(request.target.containingNode);
- }
- if (optype.includeConstructorSuggestions) {
- new _ConstructorVisitor(request).visit(request.target.containingNode);
+ if (!optype.isPrefixed) {
+ if (optype.includeReturnValueSuggestions ||
+ optype.includeTypeNameSuggestions ||
+ optype.includeVoidReturnSuggestions) {
+ _LocalVisitor localVisitor =
+ new _LocalVisitor(request, request.offset, optype);
+ localVisitor.visit(request.target.containingNode);
+ }
+ if (optype.includeStatementLabelSuggestions ||
+ optype.includeCaseLabelSuggestions) {
+ _LabelVisitor labelVisitor = new _LabelVisitor(request,
+ optype.includeStatementLabelSuggestions,
+ optype.includeCaseLabelSuggestions);
+ labelVisitor.visit(request.target.containingNode);
+ }
+ if (optype.includeConstructorSuggestions) {
+ new _ConstructorVisitor(request).visit(request.target.containingNode);
+ }
}
// If target is an argument in an argument list

Powered by Google App Engine
This is Rietveld 408576698