mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-10 00:20:22 -06:00
Add missing whitespace after type parameter's modifiers in interactive inlay hints (#62246)
This commit is contained in:
parent
8ea03f88d0
commit
11ee01b22d
@ -582,6 +582,7 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
|
||||
Debug.assertNode(node, isTypeParameterDeclaration);
|
||||
if (node.modifiers) {
|
||||
visitDisplayPartList(node.modifiers, " ");
|
||||
parts.push({ text: " " });
|
||||
}
|
||||
visitForDisplayParts(node.name);
|
||||
if (node.constraint) {
|
||||
@ -597,6 +598,7 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
|
||||
Debug.assertNode(node, isParameter);
|
||||
if (node.modifiers) {
|
||||
visitDisplayPartList(node.modifiers, " ");
|
||||
parts.push({ text: " " });
|
||||
}
|
||||
if (node.dotDotDotToken) {
|
||||
parts.push({ text: "..." });
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
// === Inlay Hints ===
|
||||
function test1() {
|
||||
^
|
||||
{
|
||||
"text": "",
|
||||
"displayParts": [
|
||||
{
|
||||
"text": ": "
|
||||
},
|
||||
{
|
||||
"text": "<"
|
||||
},
|
||||
{
|
||||
"text": "const"
|
||||
},
|
||||
{
|
||||
"text": " "
|
||||
},
|
||||
{
|
||||
"text": "T",
|
||||
"span": {
|
||||
"start": 44,
|
||||
"length": 1
|
||||
},
|
||||
"file": "/tests/cases/fourslash/inlayHintsTypeParameterModifiers1.ts"
|
||||
},
|
||||
{
|
||||
"text": ">"
|
||||
},
|
||||
{
|
||||
"text": "("
|
||||
},
|
||||
{
|
||||
"text": "a"
|
||||
},
|
||||
{
|
||||
"text": ": "
|
||||
},
|
||||
{
|
||||
"text": "T",
|
||||
"span": {
|
||||
"start": 44,
|
||||
"length": 1
|
||||
},
|
||||
"file": "/tests/cases/fourslash/inlayHintsTypeParameterModifiers1.ts"
|
||||
},
|
||||
{
|
||||
"text": ")"
|
||||
},
|
||||
{
|
||||
"text": " => "
|
||||
},
|
||||
{
|
||||
"text": "void"
|
||||
}
|
||||
],
|
||||
"position": 16,
|
||||
"kind": "Type",
|
||||
"whitespaceBefore": true
|
||||
}
|
||||
|
||||
return function <const T>(a: T) {};
|
||||
^
|
||||
{
|
||||
"text": "",
|
||||
"displayParts": [
|
||||
{
|
||||
"text": ": "
|
||||
},
|
||||
{
|
||||
"text": "void"
|
||||
}
|
||||
],
|
||||
"position": 52,
|
||||
"kind": "Type",
|
||||
"whitespaceBefore": true
|
||||
}
|
||||
10
tests/cases/fourslash/inlayHintsTypeParameterModifiers1.ts
Normal file
10
tests/cases/fourslash/inlayHintsTypeParameterModifiers1.ts
Normal file
@ -0,0 +1,10 @@
|
||||
///<reference path="fourslash.ts" />
|
||||
|
||||
//// function test1() {
|
||||
//// return function <const T>(a: T) {};
|
||||
//// }
|
||||
|
||||
verify.baselineInlayHints(undefined, {
|
||||
interactiveInlayHints: true,
|
||||
includeInlayFunctionLikeReturnTypeHints: true,
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user