summaryrefslogtreecommitdiff
path: root/autoload/ale/codefix.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2023-09-14 00:38:12 +0100
committerw0rp <devw0rp@gmail.com>2023-09-14 00:40:56 +0100
commitbe69af270547b0d1dd5fe947efb3f61455f709ed (patch)
tree3d72ab429ed3d6025fb88accbd2be753fb78f26a /autoload/ale/codefix.vim
parent9092af9ad6a5c93a759be571323ea1d0cafa8d6e (diff)
downloadale-be69af270547b0d1dd5fe947efb3f61455f709ed.zip
#4607 No conflicts with nvim-lspconfig by default
Default `g:ale_disable_lsp` to a new mode `'auto'` by default. With this setting applied, ALE will now check for the presence of nvim-lspconfig and automatically turn off particular LSP linters if already configured via nvim-lspconfig. For users that do not use `nvim-lspconfig`, everything should work as before.
Diffstat (limited to 'autoload/ale/codefix.vim')
-rw-r--r--autoload/ale/codefix.vim14
1 files changed, 4 insertions, 10 deletions
diff --git a/autoload/ale/codefix.vim b/autoload/ale/codefix.vim
index 34ce3e15..6eaadb23 100644
--- a/autoload/ale/codefix.vim
+++ b/autoload/ale/codefix.vim
@@ -473,15 +473,9 @@ function! ale#codefix#Execute(range, ...) abort
endif
let l:MenuCallback = get(a:000, 0, v:null)
- let l:lsp_linters = []
+ let l:linters = ale#lsp_linter#GetEnabled(bufnr(''))
- for l:linter in ale#linter#Get(&filetype)
- if !empty(l:linter.lsp)
- call add(l:lsp_linters, l:linter)
- endif
- endfor
-
- if empty(l:lsp_linters)
+ if empty(l:linters)
if l:MenuCallback is v:null
call s:message('No active LSPs')
else
@@ -491,7 +485,7 @@ function! ale#codefix#Execute(range, ...) abort
return
endif
- for l:lsp_linter in l:lsp_linters
- call s:ExecuteGetCodeFix(l:lsp_linter, a:range, l:MenuCallback)
+ for l:linter in l:linters
+ call s:ExecuteGetCodeFix(l:linter, a:range, l:MenuCallback)
endfor
endfunction