fix(49178): check expression with type arguments in inlay hints (#49179)

This commit is contained in:
Oleksandr T 2022-06-01 01:22:16 +03:00 committed by GitHub
parent a5b1f95c23
commit 3da165e3df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -47,7 +47,7 @@ namespace ts.InlayHints {
return;
}
if (isTypeNode(node)) {
if (isTypeNode(node) && !isExpressionWithTypeArguments(node)) {
return;
}

View File

@ -0,0 +1,25 @@
/// <reference path="fourslash.ts" />
////const foo = (a = 1) => class { }
////
////const C1 = class extends foo(/*1*/1) { }
////class C2 extends foo(/*2*/1) { }
const markers = test.markers();
verify.getInlayHints([
{
text: 'a:',
position: markers[0].position,
kind: ts.InlayHintKind.Parameter,
whitespaceAfter: true
},
{
text: 'a:',
position: markers[1].position,
kind: ts.InlayHintKind.Parameter,
whitespaceAfter: true
},
], undefined, {
includeInlayParameterNameHints: "literals"
});