1
0
Fork 0
mirror of synced 2024-11-13 20:58:57 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/julia/languageserver.vim

23 lines
1.1 KiB
VimL
Raw Normal View History

2018-09-24 20:40:17 -04:00
" 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')
2021-05-05 04:25:00 -04:00
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);'
2018-09-24 20:40:17 -04:00
2021-05-05 04:25:00 -04:00
return ale#Escape(l:julia_executable) . ' --project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
2018-09-24 20:40:17 -04:00
endfunction
call ale#linter#Define('julia', {
\ 'name': 'languageserver',
2024-01-07 10:14:20 -05:00
\ 'aliases': ['julials'],
2018-09-24 20:40:17 -04:00
\ 'lsp': 'stdio',
2019-03-08 06:04:56 -05:00
\ 'executable': {b -> ale#Var(b, 'julia_executable')},
\ 'command': function('ale_linters#julia#languageserver#GetCommand'),
2018-09-24 20:40:17 -04:00
\ 'language': 'julia',
2019-03-08 06:04:56 -05:00
\ 'project_root': function('ale#julia#FindProjectRoot'),
2018-09-24 20:40:17 -04:00
\})