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

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

Issue 1876603002: use type information to filter RHS of "is" expression for imported types (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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_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 7f04c6b306d923dc10bfea4d65010eea39c47eb0..68beb6a0a4e51fc26f4b8cee0cd4dcbdc8be9545 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
@@ -44,7 +44,11 @@ class LibraryElementSuggestionBuilder extends GeneralizingElementVisitor
@override
void visitClassElement(ClassElement element) {
if (optype.includeTypeNameSuggestions) {
- addSuggestion(element, prefix: prefix, relevance: DART_RELEVANCE_DEFAULT);
+ // if includeTypeNameSuggestions, then use the filter
+ if (optype.typeNameSuggestionsFilter(element.type)) {
+ addSuggestion(element,
+ prefix: prefix, relevance: DART_RELEVANCE_DEFAULT);
+ }
}
if (optype.includeConstructorSuggestions) {
_addConstructorSuggestions(element, DART_RELEVANCE_DEFAULT);

Powered by Google App Engine
This is Rietveld 408576698