mirror of
https://github.com/dense-analysis/ale
synced 2025-02-19 13:56:50 +00:00
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>
This commit is contained in:
parent
6c51bb1573
commit
3348222abc
@ -457,7 +457,7 @@ function! s:ExecuteGetCodeFix(linter, range, MenuCallback) abort
|
|||||||
let [l:end_line, l:end_column] = getpos("'>")[1:2]
|
let [l:end_line, l:end_column] = getpos("'>")[1:2]
|
||||||
endif
|
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:end_column = min([l:end_column, len(getline(l:end_line))])
|
||||||
|
|
||||||
let l:Callback = function(
|
let l:Callback = function(
|
||||||
|
@ -443,6 +443,11 @@ function! s:SendInitMessage(conn) abort
|
|||||||
\ },
|
\ },
|
||||||
\ 'codeAction': {
|
\ 'codeAction': {
|
||||||
\ 'dynamicRegistration': v:false,
|
\ 'dynamicRegistration': v:false,
|
||||||
|
\ 'codeActionLiteralSupport': {
|
||||||
|
\ 'codeActionKind': {
|
||||||
|
\ 'valueSet': []
|
||||||
|
\ }
|
||||||
|
\ }
|
||||||
\ },
|
\ },
|
||||||
\ 'rename': {
|
\ 'rename': {
|
||||||
\ 'dynamicRegistration': v:false,
|
\ 'dynamicRegistration': v:false,
|
||||||
|
@ -194,6 +194,11 @@ Before:
|
|||||||
\ },
|
\ },
|
||||||
\ 'codeAction': {
|
\ 'codeAction': {
|
||||||
\ 'dynamicRegistration': v:false,
|
\ 'dynamicRegistration': v:false,
|
||||||
|
\ 'codeActionLiteralSupport': {
|
||||||
|
\ 'codeActionKind': {
|
||||||
|
\ 'valueSet': []
|
||||||
|
\ }
|
||||||
|
\ }
|
||||||
\ },
|
\ },
|
||||||
\ 'rename': {
|
\ 'rename': {
|
||||||
\ 'dynamicRegistration': v:false,
|
\ 'dynamicRegistration': v:false,
|
||||||
|
Loading…
Reference in New Issue
Block a user