Fix the Julia languagserver linter for Julia 0.7

This commit is contained in:
w0rp 2018-09-17 09:16:41 +01:00
parent f1f2a22228
commit 0b163ec656
No known key found for this signature in database
GPG key ID: 0FC1ECAA8C81CD83
2 changed files with 7 additions and 3 deletions

View file

@ -6,7 +6,7 @@ call ale#Set('julia_executable', 'julia')
function! ale_linters#julia#languageserver#GetCommand(buffer) abort
let l:julia_executable = ale#Var(a:buffer, 'julia_executable')
let l:cmd_string = 'using LanguageServer; server = LanguageServer.LanguageServerInstance(STDIN, STDOUT, false); server.runlinter = true; run(server);'
let l:cmd_string = 'using LanguageServer; server = LanguageServer.LanguageServerInstance(stdin, stdout, false); server.runlinter = true; run(server);'
return ale#Escape(l:julia_executable) . ' --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
endfunction

View file

@ -1,14 +1,18 @@
Before:
Save g:ale_julia_executable
call ale#assert#SetUpLinterTest('julia', 'languageserver')
After:
Restore
call ale#assert#TearDownLinterTest()
Execute(The default executable path should be correct):
AssertLinter 'julia',
\ ale#Escape('julia') .
\' --startup-file=no --history-file=no -e ' .
\ ale#Escape('using LanguageServer; server = LanguageServer.LanguageServerInstance(STDIN, STDOUT, false); server.runlinter = true; run(server);')
\ ale#Escape('using LanguageServer; server = LanguageServer.LanguageServerInstance(stdin, stdout, false); server.runlinter = true; run(server);')
Execute(The executable should be configurable):
let g:ale_julia_executable = 'julia-new'
@ -16,7 +20,7 @@ Execute(The executable should be configurable):
AssertLinter 'julia-new',
\ ale#Escape('julia-new') .
\' --startup-file=no --history-file=no -e ' .
\ ale#Escape('using LanguageServer; server = LanguageServer.LanguageServerInstance(STDIN, STDOUT, false); server.runlinter = true; run(server);')
\ ale#Escape('using LanguageServer; server = LanguageServer.LanguageServerInstance(stdin, stdout, false); server.runlinter = true; run(server);')
Execute(The project root should be detected correctly):
AssertLSPProject ''