ale/ale_linters/julia/languageserver.vim

21 lines
888 B
VimL
Raw Normal View History

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