diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-11-23 11:09:19 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 11:09:19 +1100 |
commit | 210300d0497005f74d64a1d028e1becbae9f27e8 (patch) | |
tree | 982d0ea9bf52a24b82f6743f6ced98cf037527e1 /cli/tsc | |
parent | bf5657cd590a0624d614a09ff6fc3538f94643da (diff) |
feat(lsp): add type definition provider (#12789)
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 9 | ||||
-rw-r--r-- | cli/tsc/compiler.d.ts | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 1b3999bf9..d309956cb 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -810,6 +810,15 @@ delete Object.prototype.__proto__; ts.getSupportedCodeFixes(), ); } + case "getTypeDefinition": { + return respond( + id, + languageService.getTypeDefinitionAtPosition( + request.specifier, + request.position, + ), + ); + } case "prepareCallHierarchy": { return respond( id, diff --git a/cli/tsc/compiler.d.ts b/cli/tsc/compiler.d.ts index 8e6b6d417..d206c0b6b 100644 --- a/cli/tsc/compiler.d.ts +++ b/cli/tsc/compiler.d.ts @@ -66,6 +66,7 @@ declare global { | GetSignatureHelpItemsRequest | GetSmartSelectionRange | GetSupportedCodeFixes + | GetTypeDefinitionRequest | PrepareCallHierarchy | ProvideCallHierarchyIncomingCalls | ProvideCallHierarchyOutgoingCalls; @@ -220,6 +221,12 @@ declare global { method: "getSupportedCodeFixes"; } + interface GetTypeDefinitionRequest extends BaseLanguageServerRequest { + method: "getTypeDefinition"; + specifier: string; + position: number; + } + interface PrepareCallHierarchy extends BaseLanguageServerRequest { method: "prepareCallHierarchy"; specifier: string; |