summaryrefslogtreecommitdiff
path: root/ale_linters/julia
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-09-10 17:24:04 +0100
committerGitHub <noreply@github.com>2018-09-10 17:24:04 +0100
commit99e9417ef901824200040c6a2d3e84f2e0ff4b8e (patch)
treeac65bf64cf940aefab2cc2e513b1baf83225354c /ale_linters/julia
parentbfba216e617dd02d0dddcf390b3ec2eb0ab3e7e4 (diff)
parent169e4b67d3762cf03bd11eb8c2f6e11a43c45919 (diff)
downloadale-99e9417ef901824200040c6a2d3e84f2e0ff4b8e.zip
Add support for Julia Language Server (#1894)
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..b6bf8e73
--- /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(STDIN, 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',
+\})