diff options
author | Alex LaFroscia <alex@lafroscia.com> | 2021-02-20 11:09:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-20 16:09:28 +0000 |
commit | d340710fcfbd4db7bd2a8e4cd126306d4d7ef4e2 (patch) | |
tree | cfd8c202bc4088c64163633e4d4a4a78f0cdcdec /test/test_go_to_definition.vader | |
parent | 3ea887d2f4d43dd55d81213517344226f6399ed6 (diff) | |
download | ale-d340710fcfbd4db7bd2a8e4cd126306d4d7ef4e2.zip |
Support going to type definition with tsserver (#3545)
Diffstat (limited to 'test/test_go_to_definition.vader')
-rw-r--r-- | test/test_go_to_definition.vader | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test_go_to_definition.vader b/test/test_go_to_definition.vader index f2f34280..c7805932 100644 --- a/test/test_go_to_definition.vader +++ b/test/test_go_to_definition.vader @@ -242,6 +242,30 @@ Execute(tsserver definition requests should be sent): \ g:message_list AssertEqual {'42': {'open_in': 'current-buffer'}}, ale#definition#GetMap() +Execute(tsserver type definition requests should be sent): + runtime ale_linters/typescript/tsserver.vim + call setpos('.', [bufnr(''), 2, 5, 0]) + + ALEGoToTypeDefinition + + " We shouldn't register the callback yet. + AssertEqual '''''', string(g:Callback) + + AssertEqual type(function('type')), type(g:InitCallback) + call g:InitCallback() + + AssertEqual 'typeDefinition', g:capability_checked + AssertEqual + \ 'function(''ale#definition#HandleTSServerResponse'')', + \ string(g:Callback) + AssertEqual + \ [ + \ ale#lsp#tsserver_message#Change(bufnr('')), + \ [0, 'ts@typeDefinition', {'file': expand('%:p'), 'line': 2, 'offset': 5}] + \ ], + \ g:message_list + AssertEqual {'42': {'open_in': 'current-buffer'}}, ale#definition#GetMap() + Execute(tsserver tab definition requests should be sent): runtime ale_linters/typescript/tsserver.vim call setpos('.', [bufnr(''), 2, 5, 0]) |