-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interactive type inlay hints (#55141)
- Loading branch information
1 parent
1a68590
commit 0b82e1a
Showing
28 changed files
with
1,130 additions
and
32 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
tests/baselines/reference/inlayHintsInteractiveFunctionParameterTypes1.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
const f1: F1 = (a, b) => { } | ||
^ | ||
{ | ||
"text": ": string", | ||
"position": 58, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
const f1: F1 = (a, b) => { } | ||
^ | ||
{ | ||
"text": ": number", | ||
"position": 61, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
const f2: F1 = (a, b: number) => { } | ||
^ | ||
{ | ||
"text": ": string", | ||
"position": 87, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
foo1((a) => { }) | ||
^ | ||
{ | ||
"text": ": string", | ||
"position": 157, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
foo2((a) => { }) | ||
^ | ||
{ | ||
"text": ": 2 | 3", | ||
"position": 232, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
foo3(a => { | ||
^ | ||
{ | ||
"text": ": (c: (d: 2 | 3) => void) => void", | ||
"position": 331, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
a(d => {}) | ||
^ | ||
{ | ||
"text": ": 2 | 3", | ||
"position": 344, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
foo4(1, a => { }) | ||
^ | ||
{ | ||
"text": ": number", | ||
"position": 409, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
const foo5: F2 = (a) => { } | ||
^ | ||
{ | ||
"text": ": { a: number; b: string; }", | ||
"position": 492, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} |
1 change: 1 addition & 0 deletions
1
tests/baselines/reference/inlayHintsInteractiveFunctionParameterTypes2.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
=== No inlay hints === |
17 changes: 17 additions & 0 deletions
17
tests/baselines/reference/inlayHintsInteractiveFunctionParameterTypes3.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
bar: function (x?): void { | ||
^ | ||
{ | ||
"text": ": boolean", | ||
"position": 87, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
set foo(value) { this.#value = value; } | ||
^ | ||
{ | ||
"text": ": number", | ||
"position": 250, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} |
1 change: 1 addition & 0 deletions
1
tests/baselines/reference/inlayHintsInteractiveFunctionParameterTypes4.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
=== No inlay hints === |
1 change: 1 addition & 0 deletions
1
tests/baselines/reference/inlayHintsInteractiveImportType1.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
=== No inlay hints === |
33 changes: 33 additions & 0 deletions
33
tests/baselines/reference/inlayHintsInteractiveImportType2.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function bar () { return require('./a').a; } | ||
^ | ||
{ | ||
"text": "", | ||
"displayParts": [ | ||
{ | ||
"text": ": " | ||
}, | ||
{ | ||
"text": "1" | ||
} | ||
], | ||
"position": 58, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} | ||
|
||
const d = bar() | ||
^ | ||
{ | ||
"text": "", | ||
"displayParts": [ | ||
{ | ||
"text": ": " | ||
}, | ||
{ | ||
"text": "1" | ||
} | ||
], | ||
"position": 111, | ||
"kind": "Type", | ||
"whitespaceBefore": true | ||
} |
43 changes: 43 additions & 0 deletions
43
tests/baselines/reference/inlayHintsInteractiveJsDocParameterNames.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
y.foo(1, 2) | ||
^ | ||
{ | ||
"text": "", | ||
"position": 88, | ||
"kind": "Parameter", | ||
"whitespaceAfter": true, | ||
"displayParts": [ | ||
{ | ||
"text": "a", | ||
"span": { | ||
"start": 40, | ||
"length": 1 | ||
}, | ||
"file": "/a.js" | ||
}, | ||
{ | ||
"text": ":" | ||
} | ||
] | ||
} | ||
|
||
y.foo(1, 2) | ||
^ | ||
{ | ||
"text": "", | ||
"position": 91, | ||
"kind": "Parameter", | ||
"whitespaceAfter": true, | ||
"displayParts": [ | ||
{ | ||
"text": "b", | ||
"span": { | ||
"start": 51, | ||
"length": 1 | ||
}, | ||
"file": "/a.js" | ||
}, | ||
{ | ||
"text": ":" | ||
} | ||
] | ||
} |
Oops, something went wrong.