1
0
Fork 0
mirror of synced 2024-11-17 22:45:34 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/julia/languageserver.vim
Amir Salihefendic f50b2142bc Updated plugins
2019-03-08 08:04:56 -03:00

21 lines
970 B
VimL

" Author: Bartolomeo Stellato <bartolomeo.stellato@gmail.com>
" Description: A language server for Julia
" Set julia executable variable
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);'
return ale#Escape(l:julia_executable) . ' --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
endfunction
call ale#linter#Define('julia', {
\ 'name': 'languageserver',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'julia_executable')},
\ 'command': function('ale_linters#julia#languageserver#GetCommand'),
\ 'language': 'julia',
\ 'project_root': function('ale#julia#FindProjectRoot'),
\})