summaryrefslogtreecommitdiff
path: root/ale_linters/rust/rls.vim
diff options
context:
space:
mode:
authorBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
committerBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
commitd2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch)
treebb8145e69bf1bcb8968b29cb1a68c47ceb83674d /ale_linters/rust/rls.vim
parentef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff)
parent0a384a49d371838903d8401c5358ec60f3f4266d (diff)
downloadale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip
Merge branch 'master' into sridhars
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',
\})