Skip to content

Commit 3da165e

Browse files
authored
fix(49178): check expression with type arguments in inlay hints (#49179)
1 parent a5b1f95 commit 3da165e

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

src/services/inlayHints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace ts.InlayHints {
4747
return;
4848
}
4949

50-
if (isTypeNode(node)) {
50+
if (isTypeNode(node) && !isExpressionWithTypeArguments(node)) {
5151
return;
5252
}
5353

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
////const foo = (a = 1) => class { }
4+
////
5+
////const C1 = class extends foo(/*1*/1) { }
6+
////class C2 extends foo(/*2*/1) { }
7+
8+
const markers = test.markers();
9+
10+
verify.getInlayHints([
11+
{
12+
text: 'a:',
13+
position: markers[0].position,
14+
kind: ts.InlayHintKind.Parameter,
15+
whitespaceAfter: true
16+
},
17+
{
18+
text: 'a:',
19+
position: markers[1].position,
20+
kind: ts.InlayHintKind.Parameter,
21+
whitespaceAfter: true
22+
},
23+
], undefined, {
24+
includeInlayParameterNameHints: "literals"
25+
});

0 commit comments

Comments
 (0)