File tree Expand file tree Collapse file tree 4 files changed +97
-81
lines changed Expand file tree Collapse file tree 4 files changed +97
-81
lines changed Original file line number Diff line number Diff line change @@ -87,19 +87,23 @@ class HoverHandler
8787 ..writeln ();
8888 }
8989
90- var containingClassDescription = hover.containingClassDescription;
91- if (containingClassDescription != null &&
92- containingClassDescription.isNotEmpty) {
93- content
94- ..writeln ('Declared in: `$containingClassDescription `' )
95- ..writeln ();
90+ var declaredInDescription = StringBuffer ();
91+ if (hover.containingClassDescription? .isNotEmpty ?? false ) {
92+ declaredInDescription
93+ ..write (' in `' )
94+ ..write (hover.containingClassDescription)
95+ ..write ('`' );
96+ }
97+ if (hover.containingLibraryName? .isNotEmpty ?? false ) {
98+ declaredInDescription
99+ ..write (' in _' )
100+ ..write (hover.containingLibraryName)
101+ ..write ('_' );
96102 }
97103
98- // Source library.
99- var containingLibraryName = hover.containingLibraryName;
100- if (containingLibraryName != null && containingLibraryName.isNotEmpty) {
104+ if (declaredInDescription.isNotEmpty) {
101105 content
102- ..writeln ('*$ containingLibraryName * ' )
106+ ..writeln ('Declared$ declaredInDescription . ' )
103107 ..writeln ();
104108 }
105109
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ class [!A^aa!] {}
9494```dart
9595class Aaa
9696```
97- *package :test/main.dart*
97+ Declared in _package :test/main.dart_.
9898
9999---
100100This is my class.
@@ -116,7 +116,7 @@ class [!A^aa!] {}
116116```dart
117117class Aaa
118118```
119- *package :test/main.dart*
119+ Declared in _package :test/main.dart_.
120120
121121---
122122This is my class.''' ;
You can’t perform that action at this time.
0 commit comments