Skip to content

Commit

Permalink
[DAS] Fixes hover for mixin on abstract implemented type
Browse files Browse the repository at this point in the history
[email protected]

Bug: #57097
Change-Id: Ia67ebb1dbca9e8b3a63e2a26dbb7234385b4bdf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395562
Reviewed-by: Samuel Rawlins <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Auto-Submit: Felipe Morschel <[email protected]>
  • Loading branch information
FMorschel authored and Commit Queue committed Nov 16, 2024
1 parent 016310d commit 052c985
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/analysis_server/lib/src/computer/computer_overrides.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ class _OverriddenElementsFinder {
}
// super
_addInterfaceOverrides(class_.supertype?.element3, checkType);
if (class_ is MixinElement2) {
for (var constraint in class_.superclassConstraints) {
_addInterfaceOverrides(constraint.element3, true);
}
}
}

void _addSuperOverrides(
Expand Down
17 changes: 17 additions & 0 deletions pkg/analysis_server/test/lsp/hover_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,23 @@ print();
String [!a^bc!] = '';
''', contains('This is a string.'));

Future<void> test_method_mixin_onImplementation() async {
var content = '''
abstract class A {
/// Documentation for [f].
void f();
}
abstract class B implements A {}
mixin M on B {
@override
void [!f^!]() {}
}
''';
await assertStringContents(content, contains('Documentation for [f].'));
}

Future<void> test_method_startOfParameterList() => assertStringContents('''
class A {
/// This is a method.
Expand Down

0 comments on commit 052c985

Please sign in to comment.