Implement listing all returned results for LSP textDocument/implements (#4755)

* Fix list of definitions
* Fix when LSP returns single response on definition/implementation
* Update tag stack on ShowSelection
This commit is contained in:
Bryan Garber
2024-05-01 07:58:06 -03:00
committed by GitHub
parent d19b238aa2
commit 70eeae54fb
2 changed files with 110 additions and 27 deletions

View File

@@ -458,19 +458,15 @@ Execute(Definition responses with lists should be handled):
\ }
\)
AssertEqual
\ [
\ 'edit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ],
\ g:expr_list
AssertEqual [3, 8], getpos('.')[1:2]
" Multiple results should either open the ALEPreview or go to quickfix
AssertEqual [1, 1], getpos('.')[1:2]
AssertEqual {}, ale#definition#GetMap()
Execute(Definition responses with null response should be handled):
call ale#definition#SetMap({3: {'open_in': 'current-buffer'}})
call ale#definition#HandleLSPResponse(1, {'id': 3, 'result': v:null})
AssertEqual [], g:expr_list
AssertEqual ['echom ''No definitions found'''], g:expr_list
Execute(LSP definition requests should be sent):
runtime ale_linters/python/pylsp.vim