diff options
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]) |