Support for LSP/tsserver Code Actions (#3437)

* Added tsserver and LSP code action support.
* tsserver refactors support added.
* Handling special case when new text is added after new line symbol.
* ale#code_action#ApplyChanges simplified.
* Initial attempt on LSP Code Actions.
* workspace/executeCommand added.
* Some null checks added.
* Add last column to LSP Code Action message.
* Pass diagnostics to LSP code action.

Previously ApplyChanges code was applied from top-to-bottom that required 
extra parameters to track progress and there was bug. I have changed code
to bottom-to-top approach as that does not require those extra parameters
and solved the bug.

Tested with typescript-language-server and it is working.
This commit is contained in:
Dalius Dobravolskas
2020-11-14 12:15:17 +02:00
committed by GitHub
parent 1ec573bf0d
commit 01800a23ad
15 changed files with 1260 additions and 86 deletions

View File

@@ -617,6 +617,7 @@ function! ale#completion#ParseLSPCompletions(response) abort
let l:user_data = {'_ale_completion_item': 1}
if has_key(l:item, 'additionalTextEdits')
\ && l:item.additionalTextEdits isnot v:null
let l:text_changes = []
for l:edit in l:item.additionalTextEdits