From d0284f22ea45a5e7796da2224373c22232af1777 Mon Sep 17 00:00:00 2001 From: Andrey Popp <8mayday@gmail.com> Date: Tue, 22 Jan 2019 02:06:28 +0300 Subject: Add textDocument/typeDefinition for LSP (#2226) * Add textDocument/typeDefinition for LSP Doc to spec https://microsoft.github.io/language-server-protocol/specification#textDocument_typeDefinition This works like textDocument/definition but resolves a location of a type of an expression under the cursor. I'm not sure what to do with tsserver though. * Fix passing column to LSP * test_go_to_definition: wording * Add tests for textDocument/typeDefinition * Add docs for textDocument/typeDefinition --- plugin/ale.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugin') diff --git a/plugin/ale.vim b/plugin/ale.vim index 15e50e9f..7d6a48f0 100644 --- a/plugin/ale.vim +++ b/plugin/ale.vim @@ -192,6 +192,12 @@ command! -bar ALEGoToDefinitionInTab :call ale#definition#GoTo({'open_in': 'tab' command! -bar ALEGoToDefinitionInSplit :call ale#definition#GoTo({'open_in': 'horizontal-split'}) command! -bar ALEGoToDefinitionInVSplit :call ale#definition#GoTo({'open_in': 'vertical-split'}) +" Go to type definition for tsserver and LSP +command! -bar ALEGoToTypeDefinition :call ale#definition#GoToType({}) +command! -bar ALEGoToTypeDefinitionInTab :call ale#definition#GoToType({'open_in': 'tab'}) +command! -bar ALEGoToTypeDefinitionInSplit :call ale#definition#GoToType({'open_in': 'horizontal-split'}) +command! -bar ALEGoToTypeDefinitionInVSplit :call ale#definition#GoToType({'open_in': 'vertical-split'}) + " Find references for tsserver and LSP command! -bar ALEFindReferences :call ale#references#Find() @@ -228,6 +234,10 @@ nnoremap (ale_go_to_definition) :ALEGoToDefinition nnoremap (ale_go_to_definition_in_tab) :ALEGoToDefinitionInTab nnoremap (ale_go_to_definition_in_split) :ALEGoToDefinitionInSplit nnoremap (ale_go_to_definition_in_vsplit) :ALEGoToDefinitionInVSplit +nnoremap (ale_go_to_type_definition) :ALEGoToTypeDefinition +nnoremap (ale_go_to_type_definition_in_tab) :ALEGoToTypeDefinitionInTab +nnoremap (ale_go_to_type_definition_in_split) :ALEGoToTypeDefinitionInSplit +nnoremap (ale_go_to_type_definition_in_vsplit) :ALEGoToTypeDefinitionInVSplit nnoremap (ale_find_references) :ALEFindReferences nnoremap (ale_hover) :ALEHover nnoremap (ale_documentation) :ALEDocumentation -- cgit v1.2.3