summaryrefslogtreecommitdiff
path: root/ale_linters/julia
diff options
context:
space:
mode:
authorBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
committerBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
commitd2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch)
treebb8145e69bf1bcb8968b29cb1a68c47ceb83674d /ale_linters/julia
parentef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff)
parent0a384a49d371838903d8401c5358ec60f3f4266d (diff)
downloadale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip
Merge branch 'master' into sridhars
Diffstat (limited to 'ale_linters/julia')
-rw-r--r--ale_linters/julia/languageserver.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/ale_linters/julia/languageserver.vim b/ale_linters/julia/languageserver.vim
new file mode 100644
index 00000000..cd2000de
--- /dev/null
+++ b/ale_linters/julia/languageserver.vim
@@ -0,0 +1,21 @@
+" 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_callback': ale#VarFunc('julia_executable'),
+\ 'command_callback': 'ale_linters#julia#languageserver#GetCommand',
+\ 'language': 'julia',
+\ 'project_root_callback': 'ale#julia#FindProjectRoot',
+\})