File tree Expand file tree Collapse file tree 3 files changed +89
-0
lines changed Expand file tree Collapse file tree 3 files changed +89
-0
lines changed Original file line number Diff line number Diff line change @@ -582,6 +582,7 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
582582 Debug . assertNode ( node , isTypeParameterDeclaration ) ;
583583 if ( node . modifiers ) {
584584 visitDisplayPartList ( node . modifiers , " " ) ;
585+ parts . push ( { text : " " } ) ;
585586 }
586587 visitForDisplayParts ( node . name ) ;
587588 if ( node . constraint ) {
@@ -597,6 +598,7 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
597598 Debug . assertNode ( node , isParameter ) ;
598599 if ( node . modifiers ) {
599600 visitDisplayPartList ( node . modifiers , " " ) ;
601+ parts . push ( { text : " " } ) ;
600602 }
601603 if ( node . dotDotDotToken ) {
602604 parts . push ( { text : "..." } ) ;
Original file line number Diff line number Diff line change 1+ // === Inlay Hints ===
2+ function test1() {
3+ ^
4+ {
5+ "text": "",
6+ "displayParts": [
7+ {
8+ "text": ": "
9+ },
10+ {
11+ "text": "<"
12+ },
13+ {
14+ "text": "const"
15+ },
16+ {
17+ "text": " "
18+ },
19+ {
20+ "text": "T",
21+ "span": {
22+ "start": 44,
23+ "length": 1
24+ },
25+ "file": "/tests/cases/fourslash/inlayHintsTypeParameterModifiers1.ts"
26+ },
27+ {
28+ "text": ">"
29+ },
30+ {
31+ "text": "("
32+ },
33+ {
34+ "text": "a"
35+ },
36+ {
37+ "text": ": "
38+ },
39+ {
40+ "text": "T",
41+ "span": {
42+ "start": 44,
43+ "length": 1
44+ },
45+ "file": "/tests/cases/fourslash/inlayHintsTypeParameterModifiers1.ts"
46+ },
47+ {
48+ "text": ")"
49+ },
50+ {
51+ "text": " => "
52+ },
53+ {
54+ "text": "void"
55+ }
56+ ],
57+ "position": 16,
58+ "kind": "Type",
59+ "whitespaceBefore": true
60+ }
61+
62+ return function <const T>(a: T) {};
63+ ^
64+ {
65+ "text": "",
66+ "displayParts": [
67+ {
68+ "text": ": "
69+ },
70+ {
71+ "text": "void"
72+ }
73+ ],
74+ "position": 52,
75+ "kind": "Type",
76+ "whitespaceBefore": true
77+ }
Original file line number Diff line number Diff line change 1+ ///<reference path="fourslash.ts" />
2+
3+ //// function test1() {
4+ //// return function <const T>(a: T) {};
5+ //// }
6+
7+ verify . baselineInlayHints ( undefined , {
8+ interactiveInlayHints : true ,
9+ includeInlayFunctionLikeReturnTypeHints : true ,
10+ } ) ;
You can’t perform that action at this time.
0 commit comments