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

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

Issue 2330413004: reduce the relevance of completions starting with "$" (Closed)
Patch Set: merge Created 4 years, 3 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/test/services/completion/dart/type_member_contributor_test.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/dart/type_member_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
index 0cf93185d9de6a66d3f6ed5f751a3befd8125e7a..d535ef4b27ac57c4245c9e211a5c32a8ef261e43 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
@@ -331,6 +331,15 @@ class _SuggestionBuilder {
}
}
String identifier = element.displayName;
+
+ if (relevance == DART_RELEVANCE_DEFAULT && identifier != null) {
+ // Decrease relevance of suggestions starting with $
+ // https://github.com/dart-lang/sdk/issues/27303
+ if (identifier.startsWith(r'$')) {
+ relevance = DART_RELEVANCE_LOW;
+ }
+ }
+
int alreadyGenerated = _completionTypesGenerated.putIfAbsent(
identifier, () => _COMPLETION_TYPE_NONE);
if (element is MethodElement) {
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698