2018-08-30 19:40:04 +00:00
|
|
|
" Author: Bartolomeo Stellato <bartolomeo.stellato@gmail.com>
|
|
|
|
" Description: A language server for Julia
|
|
|
|
|
2018-09-07 17:16:22 +00:00
|
|
|
" Set julia executable variable
|
|
|
|
call ale#Set('julia_executable', 'julia')
|
|
|
|
|
2018-08-30 19:40:04 +00:00
|
|
|
function! ale_linters#julia#languageserver#GetCommand(buffer) abort
|
2018-09-07 15:11:29 +00:00
|
|
|
let l:julia_executable = ale#Var(a:buffer, 'julia_executable')
|
2018-09-07 17:16:22 +00:00
|
|
|
return ale#Escape(l:julia_executable . " --startup-file=no --history-file=no -e 'using LanguageServer; server = LanguageServer.LanguageServerInstance(STDIN, STDOUT, false); server.runlinter = true; run(server);'")
|
2018-08-30 19:40:04 +00:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('julia', {
|
|
|
|
\ 'name': 'languageserver',
|
|
|
|
\ 'lsp': 'stdio',
|
2018-09-07 15:11:29 +00:00
|
|
|
\ 'executable_callback': ale#VarFunc('julia_executable'),
|
2018-08-30 19:40:04 +00:00
|
|
|
\ 'command_callback': 'ale_linters#julia#languageserver#GetCommand',
|
2018-09-07 15:11:29 +00:00
|
|
|
\ 'language': 'julia',
|
2018-08-30 19:40:04 +00:00
|
|
|
\ 'project_root_callback': 'ale#julia#FindProjectRoot',
|
|
|
|
\})
|