forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick PR microsoft#45426 into release-4.4 (microsoft#45445)
Component commits: 01077c1 fix(45417): show inlay hints for null and literal-like identifiers Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
- Loading branch information
1 parent
55dd850
commit 7b0e665
Showing
5 changed files
with
112 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
////function foo( | ||
//// a: string, | ||
//// b: undefined, | ||
//// c: null, | ||
//// d: boolean, | ||
//// e: boolean, | ||
//// f: number, | ||
//// g: number, | ||
//// h: number, | ||
//// i: RegExp, | ||
//// j: bigint, | ||
////) { | ||
////} | ||
//// | ||
////foo( | ||
//// /*a*/"hello", | ||
//// /*b*/undefined, | ||
//// /*c*/null, | ||
//// /*d*/true, | ||
//// /*e*/false, | ||
//// /*f*/Infinity, | ||
//// /*g*/-Infinity, | ||
//// /*h*/NaN, | ||
//// /*i*//hello/g, | ||
//// /*j*/123n, | ||
////); | ||
|
||
const [a, b, c, d, e, f, g, h, i, j] = test.markers(); | ||
verify.getInlayHints([ | ||
{ | ||
text: "a:", | ||
position: a.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "b:", | ||
position: b.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "c:", | ||
position: c.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "d:", | ||
position: d.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "e:", | ||
position: e.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "f:", | ||
position: f.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "g:", | ||
position: g.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "h:", | ||
position: h.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "i:", | ||
position: i.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
}, | ||
{ | ||
text: "j:", | ||
position: j.position, | ||
kind: ts.InlayHintKind.Parameter, | ||
whitespaceAfter: true | ||
} | ||
], undefined, { | ||
includeInlayParameterNameHints: "literals" | ||
}); |