summaryrefslogtreecommitdiff
path: root/cli/tsc
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2022-10-16 13:39:43 +1100
committerGitHub <noreply@github.com>2022-10-16 13:39:43 +1100
commit7d78f58187cdcb9bed632992cde347fd5f3c83eb (patch)
tree80bd06e16db12e7578b2946eaf0b72ca0ac34c6c /cli/tsc
parent6d2656fd56e8ac0f1b1443e28d474bf3ceca89bb (diff)
feat: support inlay hints (#16287)
Closes: #11853
Diffstat (limited to 'cli/tsc')
-rw-r--r--cli/tsc/99_main_compiler.js9
-rw-r--r--cli/tsc/compiler.d.ts10
2 files changed, 18 insertions, 1 deletions
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";
}