diff options
author | godbless <26397224+sak96@users.noreply.github.com> | 2022-04-29 18:47:29 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 22:17:29 +0900 |
commit | 3348222abccb8ed9555cafe6983cf04754340362 (patch) | |
tree | 4ba91b299e26e9d0bc96b6b568d0523ab5832994 /autoload | |
parent | 6c51bb1573f0bf5deff04508769208fd503b5ff7 (diff) | |
download | ale-3348222abccb8ed9555cafe6983cf04754340362.zip |
Add CodeAction codeActionLiteralSupport Feature (#4163)
* Advertise codeActionLiteralSupport to LSP server
Without this, rust-analyzer doesn't return any code actions. With it,
everything works properly.
* linter fixes
* test cases fixes
* Fix underflow of column in position.
Special values like for example -1 to denote the end of a line are not supported.
[reference](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)
Co-authored-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/codefix.vim | 2 | ||||
-rw-r--r-- | autoload/ale/lsp.vim | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/autoload/ale/codefix.vim b/autoload/ale/codefix.vim index 938d9637..34ce3e15 100644 --- a/autoload/ale/codefix.vim +++ b/autoload/ale/codefix.vim @@ -457,7 +457,7 @@ function! s:ExecuteGetCodeFix(linter, range, MenuCallback) abort let [l:end_line, l:end_column] = getpos("'>")[1:2] endif - let l:column = min([l:column, len(getline(l:line))]) + let l:column = max([min([l:column, len(getline(l:line))]), 1]) let l:end_column = min([l:end_column, len(getline(l:end_line))]) let l:Callback = function( diff --git a/autoload/ale/lsp.vim b/autoload/ale/lsp.vim index a5c9dff9..acdcdac3 100644 --- a/autoload/ale/lsp.vim +++ b/autoload/ale/lsp.vim @@ -443,6 +443,11 @@ function! s:SendInitMessage(conn) abort \ }, \ 'codeAction': { \ 'dynamicRegistration': v:false, + \ 'codeActionLiteralSupport': { + \ 'codeActionKind': { + \ 'valueSet': [] + \ } + \ } \ }, \ 'rename': { \ 'dynamicRegistration': v:false, |