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/lsp/tsc.rs | |
parent | bf5657cd590a0624d614a09ff6fc3538f94643da (diff) |
feat(lsp): add type definition provider (#12789)
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r-- | cli/lsp/tsc.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index e56b7ab68..9647a79fc 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -2769,6 +2769,11 @@ pub enum RequestMethod { GetSmartSelectionRange((ModuleSpecifier, u32)), /// Get the diagnostic codes that support some form of code fix. GetSupportedCodeFixes, + /// Get the type definition information for a specific position. + GetTypeDefinition { + specifier: ModuleSpecifier, + position: u32, + }, /// Resolve a call hierarchy item for a specific position. PrepareCallHierarchy((ModuleSpecifier, u32)), /// Resolve incoming call hierarchy items for a specific position. @@ -2811,7 +2816,7 @@ impl RequestMethod { "id": id, "method": "getApplicableRefactors", "specifier": state.denormalize_specifier(specifier), - "range": { "pos": span.start, "end": span.start + span.length}, + "range": { "pos": span.start, "end": span.start + span.length }, "kind": kind, }), RequestMethod::GetEditsForRefactor(( @@ -2950,6 +2955,15 @@ impl RequestMethod { "id": id, "method": "getSupportedCodeFixes", }), + RequestMethod::GetTypeDefinition { + specifier, + position, + } => json!({ + "id": id, + "method": "getTypeDefinition", + "specifier": state.denormalize_specifier(specifier), + "position": position + }), RequestMethod::PrepareCallHierarchy((specifier, position)) => { json!({ "id": id, |