summaryrefslogtreecommitdiff
path: root/ale_linters/rust/rls.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/rust/rls.vim')
-rw-r--r--ale_linters/rust/rls.vim13
1 files changed, 2 insertions, 11 deletions
diff --git a/ale_linters/rust/rls.vim b/ale_linters/rust/rls.vim
index cd13291d..60dd3667 100644
--- a/ale_linters/rust/rls.vim
+++ b/ale_linters/rust/rls.vim
@@ -4,19 +4,10 @@
call ale#Set('rust_rls_executable', 'rls')
call ale#Set('rust_rls_toolchain', 'nightly')
-function! ale_linters#rust#rls#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'rust_rls_executable')
-endfunction
-
function! ale_linters#rust#rls#GetCommand(buffer) abort
- let l:executable = ale_linters#rust#rls#GetExecutable(a:buffer)
let l:toolchain = ale#Var(a:buffer, 'rust_rls_toolchain')
- if empty(l:toolchain)
- return ale#Escape(l:executable)
- else
- return ale#Escape(l:executable) . ' +' . ale#Escape(l:toolchain)
- endif
+ return '%e' . (!empty(l:toolchain) ? ' +' . ale#Escape(l:toolchain) : '')
endfunction
function! ale_linters#rust#rls#GetProjectRoot(buffer) abort
@@ -28,7 +19,7 @@ endfunction
call ale#linter#Define('rust', {
\ 'name': 'rls',
\ 'lsp': 'stdio',
-\ 'executable_callback': 'ale_linters#rust#rls#GetExecutable',
+\ 'executable_callback': ale#VarFunc('rust_rls_executable'),
\ 'command_callback': 'ale_linters#rust#rls#GetCommand',
\ 'project_root_callback': 'ale_linters#rust#rls#GetProjectRoot',
\})