diff --git a/src/harness/client.ts b/src/harness/client.ts index 81ca520d9a5..76004edf58f 100644 --- a/src/harness/client.ts +++ b/src/harness/client.ts @@ -760,21 +760,20 @@ export class SessionClient implements LanguageService { const response = this.processResponse(request); return response.body!.map(item => { - const { text, position } = item; - const hint = typeof text === "string" ? text : text.map(({ text, span }) => ({ - text, - span: span && { - start: this.lineOffsetToPosition(span.file, span.start), - length: this.lineOffsetToPosition(span.file, span.end) - this.lineOffsetToPosition(span.file, span.start), - }, - file: span && span.file - })); + const { position, displayParts } = item; return ({ ...item, position: this.lineOffsetToPosition(file, position), - text: hint, - kind: item.kind as InlayHintKind + kind: item.kind as InlayHintKind, + displayParts: displayParts?.map(({ text, span }) => ({ + text, + span: span && { + start: this.lineOffsetToPosition(span.file, span.start), + length: this.lineOffsetToPosition(span.file, span.end) - this.lineOffsetToPosition(span.file, span.start), + }, + file: span && span.file + })), }); }); } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 227a50fd3fb..50fbe3deb13 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -2675,11 +2675,13 @@ export interface InlayHintsRequest extends Request { } export interface InlayHintItem { - text: string | InlayHintItemDisplayPart[]; + /** This property will be the empty string when displayParts is set. */ + text: string; position: Location; kind: InlayHintKind; whitespaceBefore?: boolean; whitespaceAfter?: boolean; + displayParts?: InlayHintItemDisplayPart[]; } export interface InlayHintItemDisplayPart { diff --git a/src/server/session.ts b/src/server/session.ts index 7ffca993518..ed3872c8f40 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1845,20 +1845,19 @@ export class Session implements EventSender { const hints = project.getLanguageService().provideInlayHints(file, args, this.getPreferences(file)); return hints.map(hint => { - const { text, position } = hint; - const hintText = typeof text === "string" ? text : text.map(({ text, span, file }) => ({ - text, - span: span && { - start: scriptInfo.positionToLineOffset(span.start), - end: scriptInfo.positionToLineOffset(span.start + span.length), - file: file! - } - })); + const { position, displayParts } = hint; return { ...hint, position: scriptInfo.positionToLineOffset(position), - text: hintText + displayParts: displayParts?.map(({ text, span, file }) => ({ + text, + span: span && { + start: scriptInfo.positionToLineOffset(span.start), + end: scriptInfo.positionToLineOffset(span.start + span.length), + file: file! + } + })), }; }); } diff --git a/src/services/inlayHints.ts b/src/services/inlayHints.ts index 9eb3d7aa4ea..770bca101e7 100644 --- a/src/services/inlayHints.ts +++ b/src/services/inlayHints.ts @@ -159,9 +159,11 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] { } function addParameterHints(text: string, parameter: Identifier, position: number, isFirstVariadicArgument: boolean, sourceFile: SourceFile | undefined) { - let hintText: string | InlayHintDisplayPart[] = `${isFirstVariadicArgument ? "..." : ""}${text}`; + let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`; + let displayParts: InlayHintDisplayPart[] | undefined; if (shouldUseInteractiveInlayHints(preferences)) { - hintText = [getNodeDisplayPart(hintText, parameter, sourceFile!), { text: ":" }]; + displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile!), { text: ":" }]; + hintText = ""; } else { hintText += ":"; @@ -172,6 +174,7 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] { position, kind: InlayHintKind.Parameter, whitespaceAfter: true, + displayParts, }); } diff --git a/src/services/types.ts b/src/services/types.ts index 571e677b208..dc69092d3fe 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -866,11 +866,13 @@ export const enum InlayHintKind { } export interface InlayHint { - text: string | InlayHintDisplayPart[]; + /** This property will be the empty string when displayParts is set. */ + text: string; position: number; kind: InlayHintKind; whitespaceBefore?: boolean; whitespaceAfter?: boolean; + displayParts?: InlayHintDisplayPart[]; } export interface InlayHintDisplayPart { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 95422c57020..4b9d52e470e 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2124,11 +2124,13 @@ declare namespace ts { arguments: InlayHintsRequestArgs; } interface InlayHintItem { - text: string | InlayHintItemDisplayPart[]; + /** This property will be the empty string when displayParts is set. */ + text: string; position: Location; kind: InlayHintKind; whitespaceBefore?: boolean; whitespaceAfter?: boolean; + displayParts?: InlayHintItemDisplayPart[]; } interface InlayHintItemDisplayPart { text: string; @@ -10390,11 +10392,13 @@ declare namespace ts { Enum = "Enum" } interface InlayHint { - text: string | InlayHintDisplayPart[]; + /** This property will be the empty string when displayParts is set. */ + text: string; position: number; kind: InlayHintKind; whitespaceBefore?: boolean; whitespaceAfter?: boolean; + displayParts?: InlayHintDisplayPart[]; } interface InlayHintDisplayPart { text: string; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 404f94a1807..ead6d07d8fb 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -6416,11 +6416,13 @@ declare namespace ts { Enum = "Enum" } interface InlayHint { - text: string | InlayHintDisplayPart[]; + /** This property will be the empty string when displayParts is set. */ + text: string; position: number; kind: InlayHintKind; whitespaceBefore?: boolean; whitespaceAfter?: boolean; + displayParts?: InlayHintDisplayPart[]; } interface InlayHintDisplayPart { text: string; diff --git a/tests/baselines/reference/inlayHintsShouldWork1.baseline b/tests/baselines/reference/inlayHintsShouldWork1.baseline index 9d5448c0eb8..a4ca2e72691 100644 --- a/tests/baselines/reference/inlayHintsShouldWork1.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork1.baseline @@ -1,7 +1,11 @@ foo(1, 2); ^ { - "text": [ + "text": "", + "position": 43, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ foo(1, 2); { "text": ":" } - ], - "position": 43, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, 2); ^ { - "text": [ + "text": "", + "position": 46, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -34,8 +39,5 @@ foo(1, 2); { "text": ":" } - ], - "position": 46, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork11.baseline b/tests/baselines/reference/inlayHintsShouldWork11.baseline index 24abb1ec94b..4253e6175a2 100644 --- a/tests/baselines/reference/inlayHintsShouldWork11.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork11.baseline @@ -1,7 +1,11 @@ foo(1)(2); ^ { - "text": [ + "text": "", + "position": 87, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ foo(1)(2); { "text": ":" } - ], - "position": 87, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1)(2); ^ { - "text": [ + "text": "", + "position": 90, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -34,8 +39,5 @@ foo(1)(2); { "text": ":" } - ], - "position": 90, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork12.baseline b/tests/baselines/reference/inlayHintsShouldWork12.baseline index f3dc18339d1..86108117993 100644 --- a/tests/baselines/reference/inlayHintsShouldWork12.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork12.baseline @@ -1,7 +1,11 @@ return a(1) + 2 ^ { - "text": [ + "text": "", + "position": 54, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -13,16 +17,17 @@ { "text": ":" } - ], - "position": 54, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo((c: number) => c + 1); ^ { - "text": [ + "text": "", + "position": 67, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -34,8 +39,5 @@ foo((c: number) => c + 1); { "text": ":" } - ], - "position": 67, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork13.baseline b/tests/baselines/reference/inlayHintsShouldWork13.baseline index be924a05582..425f8294f6a 100644 --- a/tests/baselines/reference/inlayHintsShouldWork13.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork13.baseline @@ -1,7 +1,11 @@ foo(a, 2); ^ { - "text": [ + "text": "", + "position": 66, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -13,8 +17,5 @@ foo(a, 2); { "text": ":" } - ], - "position": 66, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork2.baseline b/tests/baselines/reference/inlayHintsShouldWork2.baseline index a1d6e692ee1..0b4274fc30d 100644 --- a/tests/baselines/reference/inlayHintsShouldWork2.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork2.baseline @@ -1,7 +1,11 @@ foo(1, { c: 1 }); ^ { - "text": [ + "text": "", + "position": 44, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,8 +17,5 @@ foo(1, { c: 1 }); { "text": ":" } - ], - "position": 44, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork3.baseline b/tests/baselines/reference/inlayHintsShouldWork3.baseline index 217be4ed1d3..ea3e49735de 100644 --- a/tests/baselines/reference/inlayHintsShouldWork3.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork3.baseline @@ -1,7 +1,11 @@ foo(1, 1, 1, 1); ^ { - "text": [ + "text": "", + "position": 48, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ foo(1, 1, 1, 1); { "text": ":" } - ], - "position": 48, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, 1, 1, 1); ^ { - "text": [ + "text": "", + "position": 51, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "...b", "span": { @@ -34,8 +39,5 @@ foo(1, 1, 1, 1); { "text": ":" } - ], - "position": 51, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork32.baseline b/tests/baselines/reference/inlayHintsShouldWork32.baseline index 6200a607e61..ae2a23eb09d 100644 --- a/tests/baselines/reference/inlayHintsShouldWork32.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork32.baseline @@ -1,7 +1,11 @@ function c2 () { foo2(1, 2); } ^ { - "text": [ + "text": "", + "position": 293, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -13,16 +17,17 @@ function c2 () { foo2(1, 2); } { "text": ":" } - ], - "position": 293, - "kind": "Parameter", - "whitespaceAfter": true + ] } function c2 () { foo2(1, 2); } ^ { - "text": [ + "text": "", + "position": 296, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "d", "span": { @@ -34,16 +39,17 @@ function c2 () { foo2(1, 2); } { "text": ":" } - ], - "position": 296, - "kind": "Parameter", - "whitespaceAfter": true + ] } function c3 () { foo3(1, 2); } ^ { - "text": [ + "text": "", + "position": 324, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "e", "span": { @@ -55,16 +61,17 @@ function c3 () { foo3(1, 2); } { "text": ":" } - ], - "position": 324, - "kind": "Parameter", - "whitespaceAfter": true + ] } function c3 () { foo3(1, 2); } ^ { - "text": [ + "text": "", + "position": 327, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "f", "span": { @@ -76,16 +83,17 @@ function c3 () { foo3(1, 2); } { "text": ":" } - ], - "position": 327, - "kind": "Parameter", - "whitespaceAfter": true + ] } function c4 () { foo4(1, 2); } ^ { - "text": [ + "text": "", + "position": 355, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "g", "span": { @@ -97,16 +105,17 @@ function c4 () { foo4(1, 2); } { "text": ":" } - ], - "position": 355, - "kind": "Parameter", - "whitespaceAfter": true + ] } function c4 () { foo4(1, 2); } ^ { - "text": [ + "text": "", + "position": 358, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "h", "span": { @@ -118,8 +127,5 @@ function c4 () { foo4(1, 2); } { "text": ":" } - ], - "position": 358, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork33.baseline b/tests/baselines/reference/inlayHintsShouldWork33.baseline index 4bb95533ac6..f64b6f03927 100644 --- a/tests/baselines/reference/inlayHintsShouldWork33.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork33.baseline @@ -1,7 +1,11 @@ foo2(1, 2); ^ { - "text": [ + "text": "", + "position": 257, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -13,16 +17,17 @@ foo2(1, 2); { "text": ":" } - ], - "position": 257, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo2(1, 2); ^ { - "text": [ + "text": "", + "position": 260, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "d", "span": { @@ -34,16 +39,17 @@ foo2(1, 2); { "text": ":" } - ], - "position": 260, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo3(1, 2); ^ { - "text": [ + "text": "", + "position": 269, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "e", "span": { @@ -55,16 +61,17 @@ foo3(1, 2); { "text": ":" } - ], - "position": 269, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo3(1, 2); ^ { - "text": [ + "text": "", + "position": 272, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "f", "span": { @@ -76,16 +83,17 @@ foo3(1, 2); { "text": ":" } - ], - "position": 272, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo4(1, 2); ^ { - "text": [ + "text": "", + "position": 281, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "g", "span": { @@ -97,16 +105,17 @@ foo4(1, 2); { "text": ":" } - ], - "position": 281, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo4(1, 2); ^ { - "text": [ + "text": "", + "position": 284, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "h", "span": { @@ -118,8 +127,5 @@ foo4(1, 2); { "text": ":" } - ], - "position": 284, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork34.baseline b/tests/baselines/reference/inlayHintsShouldWork34.baseline index 5f49e0bc01d..e4945d9a5d0 100644 --- a/tests/baselines/reference/inlayHintsShouldWork34.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork34.baseline @@ -1,7 +1,11 @@ foo(1); ^ { - "text": [ + "text": "", + "position": 29, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -13,16 +17,17 @@ foo(1); { "text": ":" } - ], - "position": 29, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(''); ^ { - "text": [ + "text": "", + "position": 37, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -34,16 +39,17 @@ foo(''); { "text": ":" } - ], - "position": 37, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(true); ^ { - "text": [ + "text": "", + "position": 46, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -55,16 +61,17 @@ foo(true); { "text": ":" } - ], - "position": 46, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo((1)); ^ { - "text": [ + "text": "", + "position": 67, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -76,16 +83,17 @@ foo((1)); { "text": ":" } - ], - "position": 67, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(foo(1)); ^ { - "text": [ + "text": "", + "position": 81, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -97,8 +105,5 @@ foo(foo(1)); { "text": ":" } - ], - "position": 81, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork35.baseline b/tests/baselines/reference/inlayHintsShouldWork35.baseline index 7db0677035b..5bf2348d3b7 100644 --- a/tests/baselines/reference/inlayHintsShouldWork35.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork35.baseline @@ -1,7 +1,11 @@ foo(1); ^ { - "text": [ + "text": "", + "position": 29, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -13,16 +17,17 @@ foo(1); { "text": ":" } - ], - "position": 29, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(''); ^ { - "text": [ + "text": "", + "position": 37, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -34,16 +39,17 @@ foo(''); { "text": ":" } - ], - "position": 37, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(true); ^ { - "text": [ + "text": "", + "position": 46, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -55,16 +61,17 @@ foo(true); { "text": ":" } - ], - "position": 46, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(() => 1); ^ { - "text": [ + "text": "", + "position": 57, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -76,16 +83,17 @@ foo(() => 1); { "text": ":" } - ], - "position": 57, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(function () { return 1 }); ^ { - "text": [ + "text": "", + "position": 71, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -97,16 +105,17 @@ foo(function () { return 1 }); { "text": ":" } - ], - "position": 71, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo({}); ^ { - "text": [ + "text": "", + "position": 102, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -118,16 +127,17 @@ foo({}); { "text": ":" } - ], - "position": 102, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo({ a: 1 }); ^ { - "text": [ + "text": "", + "position": 111, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -139,16 +149,17 @@ foo({ a: 1 }); { "text": ":" } - ], - "position": 111, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo([]); ^ { - "text": [ + "text": "", + "position": 126, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -160,16 +171,17 @@ foo([]); { "text": ":" } - ], - "position": 126, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo([1]); ^ { - "text": [ + "text": "", + "position": 135, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -181,16 +193,17 @@ foo([1]); { "text": ":" } - ], - "position": 135, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(foo); ^ { - "text": [ + "text": "", + "position": 145, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -202,16 +215,17 @@ foo(foo); { "text": ":" } - ], - "position": 145, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo((1)); ^ { - "text": [ + "text": "", + "position": 155, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -223,16 +237,17 @@ foo((1)); { "text": ":" } - ], - "position": 155, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(foo(1)); ^ { - "text": [ + "text": "", + "position": 165, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -244,16 +259,17 @@ foo(foo(1)); { "text": ":" } - ], - "position": 165, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(foo(1)); ^ { - "text": [ + "text": "", + "position": 169, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "v", "span": { @@ -265,8 +281,5 @@ foo(foo(1)); { "text": ":" } - ], - "position": 169, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork36.baseline b/tests/baselines/reference/inlayHintsShouldWork36.baseline index 521dce897a4..d9e2b88aac5 100644 --- a/tests/baselines/reference/inlayHintsShouldWork36.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork36.baseline @@ -1,7 +1,11 @@ foo(a, 2); ^ { - "text": [ + "text": "", + "position": 63, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ foo(a, 2); { "text": ":" } - ], - "position": 63, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(a, 2); ^ { - "text": [ + "text": "", + "position": 66, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -34,8 +39,5 @@ foo(a, 2); { "text": ":" } - ], - "position": 66, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork4.baseline b/tests/baselines/reference/inlayHintsShouldWork4.baseline index d513fb4f5c3..c5b93f778b1 100644 --- a/tests/baselines/reference/inlayHintsShouldWork4.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork4.baseline @@ -1,7 +1,11 @@ foo(1) ^ { - "text": [ + "text": "", + "position": 166, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "w", "span": { @@ -13,16 +17,17 @@ foo(1) { "text": ":" } - ], - "position": 166, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, 2) ^ { - "text": [ + "text": "", + "position": 173, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -34,16 +39,17 @@ foo(1, 2) { "text": ":" } - ], - "position": 173, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, 2) ^ { - "text": [ + "text": "", + "position": 176, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -55,8 +61,5 @@ foo(1, 2) { "text": ":" } - ], - "position": 176, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork5.baseline b/tests/baselines/reference/inlayHintsShouldWork5.baseline index 0dccb2a3942..40fd6eab8de 100644 --- a/tests/baselines/reference/inlayHintsShouldWork5.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork5.baseline @@ -1,7 +1,11 @@ foo(1, 2, 3) ^ { - "text": [ + "text": "", + "position": 87, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -13,16 +17,17 @@ foo(1, 2, 3) { "text": ":" } - ], - "position": 87, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, 2, 3) ^ { - "text": [ + "text": "", + "position": 90, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -34,16 +39,17 @@ foo(1, 2, 3) { "text": ":" } - ], - "position": 90, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, 2, 3) ^ { - "text": [ + "text": "", + "position": 93, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -55,8 +61,5 @@ foo(1, 2, 3) { "text": ":" } - ], - "position": 93, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork50.baseline b/tests/baselines/reference/inlayHintsShouldWork50.baseline index b1c4d564ffc..df463016cca 100644 --- a/tests/baselines/reference/inlayHintsShouldWork50.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork50.baseline @@ -1,7 +1,11 @@ foo(1, '', false, 1, 2) ^ { - "text": [ + "text": "", + "position": 161, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "f", "span": { @@ -13,16 +17,17 @@ foo(1, '', false, 1, 2) { "text": ":" } - ], - "position": 161, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, '', false, 1, 2) ^ { - "text": [ + "text": "", + "position": 164, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -34,16 +39,17 @@ foo(1, '', false, 1, 2) { "text": ":" } - ], - "position": 164, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, '', false, 1, 2) ^ { - "text": [ + "text": "", + "position": 168, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -55,16 +61,17 @@ foo(1, '', false, 1, 2) { "text": ":" } - ], - "position": 168, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, '', false, 1, 2) ^ { - "text": [ + "text": "", + "position": 175, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "...c", "span": { @@ -76,16 +83,17 @@ foo(1, '', false, 1, 2) { "text": ":" } - ], - "position": 175, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo1(1, "", "") ^ { - "text": [ + "text": "", + "position": 186, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "f1", "span": { @@ -97,16 +105,17 @@ foo1(1, "", "") { "text": ":" } - ], - "position": 186, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo1(1, "", "") ^ { - "text": [ + "text": "", + "position": 189, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "...args", "span": { @@ -118,8 +127,5 @@ foo1(1, "", "") { "text": ":" } - ], - "position": 189, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork52.baseline b/tests/baselines/reference/inlayHintsShouldWork52.baseline index 7568d4fe52f..b0572fd914c 100644 --- a/tests/baselines/reference/inlayHintsShouldWork52.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork52.baseline @@ -10,7 +10,11 @@ function foo (aParameter: number, bParameter: number, cParameter: number) { } 2, ^ { - "text": [ + "text": "", + "position": 134, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "bParameter", "span": { @@ -22,16 +26,17 @@ function foo (aParameter: number, bParameter: number, cParameter: number) { } { "text": ":" } - ], - "position": 134, - "kind": "Parameter", - "whitespaceAfter": true + ] } 3 ^ { - "text": [ + "text": "", + "position": 338, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "cParameter", "span": { @@ -43,16 +48,17 @@ function foo (aParameter: number, bParameter: number, cParameter: number) { } { "text": ":" } - ], - "position": 338, - "kind": "Parameter", - "whitespaceAfter": true + ] } 1, ^ { - "text": [ + "text": "", + "position": 373, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "aParameter", "span": { @@ -64,16 +70,17 @@ function foo (aParameter: number, bParameter: number, cParameter: number) { } { "text": ":" } - ], - "position": 373, - "kind": "Parameter", - "whitespaceAfter": true + ] } 2, ^ { - "text": [ + "text": "", + "position": 380, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "bParameter", "span": { @@ -85,16 +92,17 @@ function foo (aParameter: number, bParameter: number, cParameter: number) { } { "text": ":" } - ], - "position": 380, - "kind": "Parameter", - "whitespaceAfter": true + ] } 3 ^ { - "text": [ + "text": "", + "position": 440, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "cParameter", "span": { @@ -106,8 +114,5 @@ function foo (aParameter: number, bParameter: number, cParameter: number) { } { "text": ":" } - ], - "position": 440, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork53.baseline b/tests/baselines/reference/inlayHintsShouldWork53.baseline index 75ad55b527b..9c090239a99 100644 --- a/tests/baselines/reference/inlayHintsShouldWork53.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork53.baseline @@ -1,7 +1,11 @@ fn(/* nobody knows exactly what this param is */ 42); ^ { - "text": [ + "text": "", + "position": 76, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "x", "span": { @@ -13,8 +17,5 @@ fn(/* nobody knows exactly what this param is */ 42); { "text": ":" } - ], - "position": 76, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork6.baseline b/tests/baselines/reference/inlayHintsShouldWork6.baseline index e7fa7dcc833..3f8bbed8692 100644 --- a/tests/baselines/reference/inlayHintsShouldWork6.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork6.baseline @@ -1,7 +1,11 @@ foo(1, 2, 3) ^ { - "text": [ + "text": "", + "position": 81, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -13,8 +17,5 @@ foo(1, 2, 3) { "text": ":" } - ], - "position": 81, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork62.baseline b/tests/baselines/reference/inlayHintsShouldWork62.baseline index 7c8f4d05c50..3f8f62af0d3 100644 --- a/tests/baselines/reference/inlayHintsShouldWork62.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork62.baseline @@ -1,7 +1,11 @@ trace(`${1}`); ^ { - "text": [ + "text": "", + "position": 41, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "message", "span": { @@ -13,16 +17,17 @@ trace(`${1}`); { "text": ":" } - ], - "position": 41, - "kind": "Parameter", - "whitespaceAfter": true + ] } trace(``); ^ { - "text": [ + "text": "", + "position": 56, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "message", "span": { @@ -34,8 +39,5 @@ trace(``); { "text": ":" } - ], - "position": 56, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork63.baseline b/tests/baselines/reference/inlayHintsShouldWork63.baseline index 6c1665a361d..674c1e4aea5 100644 --- a/tests/baselines/reference/inlayHintsShouldWork63.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork63.baseline @@ -1,7 +1,11 @@ foo(1, +1, -1, +"1"); ^ { - "text": [ + "text": "", + "position": 64, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ foo(1, +1, -1, +"1"); { "text": ":" } - ], - "position": 64, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, +1, -1, +"1"); ^ { - "text": [ + "text": "", + "position": 67, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -34,16 +39,17 @@ foo(1, +1, -1, +"1"); { "text": ":" } - ], - "position": 67, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, +1, -1, +"1"); ^ { - "text": [ + "text": "", + "position": 71, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -55,16 +61,17 @@ foo(1, +1, -1, +"1"); { "text": ":" } - ], - "position": 71, - "kind": "Parameter", - "whitespaceAfter": true + ] } foo(1, +1, -1, +"1"); ^ { - "text": [ + "text": "", + "position": 75, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "d", "span": { @@ -76,8 +83,5 @@ foo(1, +1, -1, +"1"); { "text": ":" } - ], - "position": 75, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork64.baseline b/tests/baselines/reference/inlayHintsShouldWork64.baseline index 3dfbe7a1521..3b0b481bfe4 100644 --- a/tests/baselines/reference/inlayHintsShouldWork64.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork64.baseline @@ -1,7 +1,11 @@ "hello", ^ { - "text": [ + "text": "", + "position": 183, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ { "text": ":" } - ], - "position": 183, - "kind": "Parameter", - "whitespaceAfter": true + ] } undefined, ^ { - "text": [ + "text": "", + "position": 196, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -34,16 +39,17 @@ { "text": ":" } - ], - "position": 196, - "kind": "Parameter", - "whitespaceAfter": true + ] } null, ^ { - "text": [ + "text": "", + "position": 211, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -55,16 +61,17 @@ { "text": ":" } - ], - "position": 211, - "kind": "Parameter", - "whitespaceAfter": true + ] } true, ^ { - "text": [ + "text": "", + "position": 221, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "d", "span": { @@ -76,16 +83,17 @@ { "text": ":" } - ], - "position": 221, - "kind": "Parameter", - "whitespaceAfter": true + ] } false, ^ { - "text": [ + "text": "", + "position": 231, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "e", "span": { @@ -97,16 +105,17 @@ { "text": ":" } - ], - "position": 231, - "kind": "Parameter", - "whitespaceAfter": true + ] } Infinity, ^ { - "text": [ + "text": "", + "position": 242, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "f", "span": { @@ -118,16 +127,17 @@ { "text": ":" } - ], - "position": 242, - "kind": "Parameter", - "whitespaceAfter": true + ] } -Infinity, ^ { - "text": [ + "text": "", + "position": 256, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "g", "span": { @@ -139,16 +149,17 @@ { "text": ":" } - ], - "position": 256, - "kind": "Parameter", - "whitespaceAfter": true + ] } NaN, ^ { - "text": [ + "text": "", + "position": 271, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "h", "span": { @@ -160,16 +171,17 @@ { "text": ":" } - ], - "position": 271, - "kind": "Parameter", - "whitespaceAfter": true + ] } /hello/g, ^ { - "text": [ + "text": "", + "position": 280, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "i", "span": { @@ -181,16 +193,17 @@ { "text": ":" } - ], - "position": 280, - "kind": "Parameter", - "whitespaceAfter": true + ] } 123n, ^ { - "text": [ + "text": "", + "position": 294, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "j", "span": { @@ -202,8 +215,5 @@ { "text": ":" } - ], - "position": 294, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork68.baseline b/tests/baselines/reference/inlayHintsShouldWork68.baseline index 6e5c31fc74f..32b0560b803 100644 --- a/tests/baselines/reference/inlayHintsShouldWork68.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork68.baseline @@ -1,7 +1,11 @@ const C1 = class extends foo(1) { } ^ { - "text": [ + "text": "", + "position": 63, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ const C1 = class extends foo(1) { } { "text": ":" } - ], - "position": 63, - "kind": "Parameter", - "whitespaceAfter": true + ] } class C2 extends foo(1) { } ^ { - "text": [ + "text": "", + "position": 91, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -34,8 +39,5 @@ class C2 extends foo(1) { } { "text": ":" } - ], - "position": 91, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork7.baseline b/tests/baselines/reference/inlayHintsShouldWork7.baseline index bd821805f44..17d74b5d61c 100644 --- a/tests/baselines/reference/inlayHintsShouldWork7.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork7.baseline @@ -1,7 +1,11 @@ call(1); ^ { - "text": [ + "text": "", + "position": 105, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ call(1); { "text": ":" } - ], - "position": 105, - "kind": "Parameter", - "whitespaceAfter": true + ] } call(1, 2); ^ { - "text": [ + "text": "", + "position": 114, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -34,16 +39,17 @@ call(1, 2); { "text": ":" } - ], - "position": 114, - "kind": "Parameter", - "whitespaceAfter": true + ] } call(1, 2); ^ { - "text": [ + "text": "", + "position": 117, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -55,8 +61,5 @@ call(1, 2); { "text": ":" } - ], - "position": 117, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork8.baseline b/tests/baselines/reference/inlayHintsShouldWork8.baseline index 26db5607064..f7cb28571a2 100644 --- a/tests/baselines/reference/inlayHintsShouldWork8.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork8.baseline @@ -1,7 +1,11 @@ new Class(1) ^ { - "text": [ + "text": "", + "position": 136, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ new Class(1) { "text": ":" } - ], - "position": 136, - "kind": "Parameter", - "whitespaceAfter": true + ] } new Class(1, 2) ^ { - "text": [ + "text": "", + "position": 149, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -34,16 +39,17 @@ new Class(1, 2) { "text": ":" } - ], - "position": 149, - "kind": "Parameter", - "whitespaceAfter": true + ] } new Class(1, 2) ^ { - "text": [ + "text": "", + "position": 152, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -55,8 +61,5 @@ new Class(1, 2) { "text": ":" } - ], - "position": 152, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsShouldWork9.baseline b/tests/baselines/reference/inlayHintsShouldWork9.baseline index 86a0659afd5..2e42331c3fa 100644 --- a/tests/baselines/reference/inlayHintsShouldWork9.baseline +++ b/tests/baselines/reference/inlayHintsShouldWork9.baseline @@ -1,7 +1,11 @@ call(1); ^ { - "text": [ + "text": "", + "position": 131, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "a", "span": { @@ -13,16 +17,17 @@ call(1); { "text": ":" } - ], - "position": 131, - "kind": "Parameter", - "whitespaceAfter": true + ] } call(1, 2); ^ { - "text": [ + "text": "", + "position": 140, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "b", "span": { @@ -34,16 +39,17 @@ call(1, 2); { "text": ":" } - ], - "position": 140, - "kind": "Parameter", - "whitespaceAfter": true + ] } call(1, 2); ^ { - "text": [ + "text": "", + "position": 143, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "c", "span": { @@ -55,16 +61,17 @@ call(1, 2); { "text": ":" } - ], - "position": 143, - "kind": "Parameter", - "whitespaceAfter": true + ] } new call(1); ^ { - "text": [ + "text": "", + "position": 156, + "kind": "Parameter", + "whitespaceAfter": true, + "displayParts": [ { "text": "d", "span": { @@ -76,8 +83,5 @@ new call(1); { "text": ":" } - ], - "position": 156, - "kind": "Parameter", - "whitespaceAfter": true + ] } \ No newline at end of file