mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-30 14:45:29 +08:00
Support going to type definition with tsserver (#3545)
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user