Merge pull request #3485 from andreaconti/master
Fix Julia Language Server Support
This commit is contained in:
commit
9387ccfbc5
2 changed files with 6 additions and 6 deletions
|
@ -6,9 +6,9 @@ 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(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);'
|
||||
let l:cmd_string = 'using LanguageServer; using Pkg; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, dirname(Pkg.Types.Context().env.project_file)); server.runlinter = true; run(server);'
|
||||
|
||||
return ale#Escape(l:julia_executable) . ' --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
|
||||
return ale#Escape(l:julia_executable) . ' --project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('julia', {
|
||||
|
|
|
@ -11,16 +11,16 @@ After:
|
|||
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(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);')
|
||||
\' --project=@. --startup-file=no --history-file=no -e ' .
|
||||
\ ale#Escape('using LanguageServer; using Pkg; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, dirname(Pkg.Types.Context().env.project_file)); server.runlinter = true; run(server);')
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
let g:ale_julia_executable = 'julia-new'
|
||||
|
||||
AssertLinter 'julia-new',
|
||||
\ ale#Escape('julia-new') .
|
||||
\' --startup-file=no --history-file=no -e ' .
|
||||
\ ale#Escape('using LanguageServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);')
|
||||
\' --project=@. --startup-file=no --history-file=no -e ' .
|
||||
\ ale#Escape('using LanguageServer; using Pkg; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, dirname(Pkg.Types.Context().env.project_file)); server.runlinter = true; run(server);')
|
||||
|
||||
Execute(The project root should be detected correctly):
|
||||
AssertLSPProject ''
|
||||
|
|
Reference in a new issue