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

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

Issue 1911803004: Code Completion refactoring, follow up on comment in https://codereview.chromium.org/1908703002/ to… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebase with master Created 4 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/dart/local_reference_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
index 190e5fd1d8aff61c61b1cc589dcbcb50cd281207..750e623da73a78dc003c48f603def2769b05de13 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
@@ -394,7 +394,9 @@ class _LocalVisitor extends LocalDeclarationVisitor {
ClassDeclaration classDecl,
FormalParameterList param,
int relevance: DART_RELEVANCE_DEFAULT}) {
- if (optype.typeNameSuggestionsFilter(_staticTypeOfIdentifier(id))) {
+ relevance = optype.typeNameSuggestionsFilter(
+ _staticTypeOfIdentifier(id), relevance);
+ if (relevance != null) {
_addLocalSuggestion(id, typeName, elemKind,
isAbstract: isAbstract,
isDeprecated: isDeprecated,
@@ -411,15 +413,15 @@ class _LocalVisitor extends LocalDeclarationVisitor {
ClassDeclaration classDecl,
FormalParameterList param,
int relevance: DART_RELEVANCE_DEFAULT}) {
- int filterResult =
- optype.returnValueSuggestionsFilter(_staticTypeOfIdentifier(id));
- if (filterResult != null) {
+ relevance = optype.returnValueSuggestionsFilter(
+ _staticTypeOfIdentifier(id), relevance);
+ if (relevance != null) {
_addLocalSuggestion(id, typeName, elemKind,
isAbstract: isAbstract,
isDeprecated: isDeprecated,
classDecl: classDecl,
param: param,
- relevance: relevance + filterResult);
+ relevance: relevance);
}
}

Powered by Google App Engine
This is Rietveld 408576698