summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorAndrey Popp <8mayday@gmail.com>2019-01-22 02:06:28 +0300
committerw0rp <w0rp@users.noreply.github.com>2019-01-21 23:06:28 +0000
commitd0284f22ea45a5e7796da2224373c22232af1777 (patch)
treecdb86bbb13a5d0c11f6579aeebe4deaed75e32ab /plugin
parenta4932679b5c0d2917a399614a25c9827d63eecb1 (diff)
downloadale-d0284f22ea45a5e7796da2224373c22232af1777.zip
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
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ale.vim10
1 files changed, 10 insertions, 0 deletions
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 <silent> <Plug>(ale_go_to_definition) :ALEGoToDefinition<Return>
nnoremap <silent> <Plug>(ale_go_to_definition_in_tab) :ALEGoToDefinitionInTab<Return>
nnoremap <silent> <Plug>(ale_go_to_definition_in_split) :ALEGoToDefinitionInSplit<Return>
nnoremap <silent> <Plug>(ale_go_to_definition_in_vsplit) :ALEGoToDefinitionInVSplit<Return>
+nnoremap <silent> <Plug>(ale_go_to_type_definition) :ALEGoToTypeDefinition<Return>
+nnoremap <silent> <Plug>(ale_go_to_type_definition_in_tab) :ALEGoToTypeDefinitionInTab<Return>
+nnoremap <silent> <Plug>(ale_go_to_type_definition_in_split) :ALEGoToTypeDefinitionInSplit<Return>
+nnoremap <silent> <Plug>(ale_go_to_type_definition_in_vsplit) :ALEGoToTypeDefinitionInVSplit<Return>
nnoremap <silent> <Plug>(ale_find_references) :ALEFindReferences<Return>
nnoremap <silent> <Plug>(ale_hover) :ALEHover<Return>
nnoremap <silent> <Plug>(ale_documentation) :ALEDocumentation<Return>