Do not show mixins in the extends clause

Change-Id: I1e1d757958cb12fc25e2805524cf3fb325634973
Reviewed-on: https://dart-review.googlesource.com/73690
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Brian Wilkerson 2018-09-07 00:03:48 +00:00 committed by commit-bot@chromium.org
parent fdcbe5dc93
commit 8255ac0b76

View file

@ -540,6 +540,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
void visitExtendsClause(ExtendsClause node) {
if (identical(entity, node.superclass)) {
optype.includeTypeNameSuggestions = true;
optype.typeNameSuggestionsFilter = _nonMixinClasses;
}
}
@ -1036,4 +1037,18 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
}
return false;
}
/**
* A filter used to disable everything except classes (such as functions and
* mixins).
*/
int _nonMixinClasses(DartType type, int relevance) {
if (type is InterfaceType) {
if (type.element.isMixin) {
return null;
}
return relevance;
}
return null;
}
}