From 7d78f58187cdcb9bed632992cde347fd5f3c83eb Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Sun, 16 Oct 2022 13:39:43 +1100 Subject: feat: support inlay hints (#16287) Closes: #11853 --- cli/tsc/99_main_compiler.js | 9 +++++++++ cli/tsc/compiler.d.ts | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'cli/tsc') diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index ab43af38d..b39f56cf6 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -898,6 +898,15 @@ delete Object.prototype.__proto__; ), ); } + case "provideInlayHints": + return respond( + id, + languageService.provideInlayHints( + request.specifier, + request.span, + request.preferences, + ), + ); default: throw new TypeError( // @ts-ignore exhausted case statement sets type to never diff --git a/cli/tsc/compiler.d.ts b/cli/tsc/compiler.d.ts index 31c8b8c64..ffd4695ae 100644 --- a/cli/tsc/compiler.d.ts +++ b/cli/tsc/compiler.d.ts @@ -77,7 +77,8 @@ declare global { | GetTypeDefinitionRequest | PrepareCallHierarchy | ProvideCallHierarchyIncomingCalls - | ProvideCallHierarchyOutgoingCalls; + | ProvideCallHierarchyOutgoingCalls + | ProvideInlayHints; interface BaseLanguageServerRequest { id: number; @@ -255,6 +256,13 @@ declare global { position: number; } + interface ProvideInlayHints extends BaseLanguageServerRequest { + method: "provideInlayHints"; + specifier: string; + span: ts.TextSpan; + preferences?: ts.UserPreferences; + } + interface Restart extends BaseLanguageServerRequest { method: "restart"; } -- cgit v1.2.3