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

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

Issue 1963323003: More tweaks for 'for' completion. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/dart/local_library_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
index 5c10beb8d9779750f8a1087686068a4eba202a7c..b019d30edb7558028d2fb54e0c0a18a9c84d6a26 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
@@ -112,17 +112,19 @@ class LibraryElementSuggestionBuilder extends GeneralizingElementVisitor
@override
void visitPropertyAccessorElement(PropertyAccessorElement element) {
- int relevance;
- if (element.library == containingLibrary) {
- if (element.enclosingElement is ClassElement) {
- relevance = DART_RELEVANCE_LOCAL_FIELD;
+ if (optype.includeReturnValueSuggestions) {
+ int relevance;
+ if (element.library == containingLibrary) {
+ if (element.enclosingElement is ClassElement) {
+ relevance = DART_RELEVANCE_LOCAL_FIELD;
+ } else {
+ relevance = DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE;
+ }
} else {
- relevance = DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE;
+ relevance = DART_RELEVANCE_DEFAULT;
}
- } else {
- relevance = DART_RELEVANCE_DEFAULT;
+ addSuggestion(element, prefix: prefix, relevance: relevance);
}
- addSuggestion(element, prefix: prefix, relevance: relevance);
}
@override

Powered by Google App Engine
This is Rietveld 408576698