Merge pull request #1498 from Eyenseo/master
Fix rust rls linter argument
This commit is contained in:
commit
3401a4e8ea
@ -12,8 +12,11 @@ function! ale_linters#rust#rls#GetCommand(buffer) abort
|
|||||||
let l:executable = ale_linters#rust#rls#GetExecutable(a:buffer)
|
let l:executable = ale_linters#rust#rls#GetExecutable(a:buffer)
|
||||||
let l:toolchain = ale#Var(a:buffer, 'rust_rls_toolchain')
|
let l:toolchain = ale#Var(a:buffer, 'rust_rls_toolchain')
|
||||||
|
|
||||||
return ale#Escape(l:executable)
|
if empty(l:toolchain)
|
||||||
\ . ' +' . ale#Escape(l:toolchain)
|
return ale#Escape(l:executable)
|
||||||
|
else
|
||||||
|
return ale#Escape(l:executable) . ' +' . ale#Escape(l:toolchain)
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#rust#rls#GetLanguage(buffer) abort
|
function! ale_linters#rust#rls#GetLanguage(buffer) abort
|
||||||
|
@ -28,6 +28,13 @@ Execute(The toolchain should be configurable):
|
|||||||
\ ale#Escape('rls') . ' +' . ale#Escape('stable'),
|
\ ale#Escape('rls') . ' +' . ale#Escape('stable'),
|
||||||
\ ale_linters#rust#rls#GetCommand(bufnr(''))
|
\ ale_linters#rust#rls#GetCommand(bufnr(''))
|
||||||
|
|
||||||
|
Execute(The toolchain should be ommitted if not given):
|
||||||
|
let g:ale_rust_rls_toolchain = ''
|
||||||
|
|
||||||
|
AssertEqual
|
||||||
|
\ ale#Escape('rls'),
|
||||||
|
\ ale_linters#rust#rls#GetCommand(bufnr(''))
|
||||||
|
|
||||||
Execute(The language string should be correct):
|
Execute(The language string should be correct):
|
||||||
AssertEqual 'rust', ale_linters#rust#rls#GetLanguage(bufnr(''))
|
AssertEqual 'rust', ale_linters#rust#rls#GetLanguage(bufnr(''))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user