File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ class DartUnitHoverComputer {
56
56
node is VariableDeclaration ||
57
57
node is VariablePattern ||
58
58
node is PatternFieldName ||
59
- node is DartPattern ) {
59
+ node is DartPattern ||
60
+ (node is LibraryDirective && node.name2 == null )) {
60
61
var range = _hoverRange (node, locationEntity);
61
62
var hover = HoverInformation (range.offset, range.length);
62
63
// element
@@ -196,6 +197,7 @@ class DartUnitHoverComputer {
196
197
VariablePattern () => node.name,
197
198
PatternFieldName () => node.name,
198
199
WildcardPattern () => node.name,
200
+ LibraryDirective () => node.libraryKeyword,
199
201
_ => null ,
200
202
};
201
203
}
Original file line number Diff line number Diff line change @@ -802,6 +802,22 @@ Type: `String?`
802
802
803
803
*package:test/main.dart*
804
804
805
+ ---
806
+ This is a string.''' ;
807
+ await assertStringContents (content, equals (expected));
808
+ }
809
+
810
+ Future <void > test_unnamed_library_directive () async {
811
+ var content = '''
812
+ /// This is a string.
813
+ [!lib^rary!];
814
+ ''' ;
815
+ var expected = '''
816
+ ```dart
817
+ library package:test/main.dart
818
+ ```
819
+ *package:test/main.dart*
820
+
805
821
---
806
822
This is a string.''' ;
807
823
await assertStringContents (content, equals (expected));
You can’t perform that action at this time.
0 commit comments