mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
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.
21 lines
780 B
VimL
21 lines
780 B
VimL
" Author: unpairedbracket ben.spiers22@gmail.com
|
|
" Description: A language server for fortran
|
|
|
|
call ale#Set('fortran_language_server_executable', 'fortls')
|
|
call ale#Set('fortran_language_server_use_global', get(g:, 'ale_use_global_executables', 0))
|
|
|
|
function! ale_linters#fortran#language_server#GetProjectRoot(buffer) abort
|
|
let l:fortls_file = ale#path#FindNearestFile(a:buffer, '.fortls')
|
|
|
|
return !empty(l:fortls_file) ? fnamemodify(l:fortls_file, ':h') : ''
|
|
endfunction
|
|
|
|
call ale#linter#Define('fortran', {
|
|
\ 'name': 'language_server',
|
|
\ 'aliases': ['fortls'],
|
|
\ 'lsp': 'stdio',
|
|
\ 'executable': {b -> ale#Var(b, 'fortran_language_server_executable')},
|
|
\ 'command': '%e',
|
|
\ 'project_root': function('ale_linters#fortran#language_server#GetProjectRoot'),
|
|
\})
|