mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 17:18:04 +00:00
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:
parent
fdcbe5dc93
commit
8255ac0b76
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue