summaryrefslogtreecommitdiff
path: root/ale_linters/julia/languageserver.vim
diff options
context:
space:
mode:
authorBartolomeo Stellato <bartolomeo.stellato@gmail.com>2018-08-30 15:40:04 -0400
committerBartolomeo Stellato <bartolomeo.stellato@gmail.com>2018-08-30 15:40:04 -0400
commit8bf5d144ed2299e0ecd6fa8f9703647e5c5ef02f (patch)
treeb73aa00660ae038a0a5b2f6931ea7e529cabd0ab /ale_linters/julia/languageserver.vim
parentea01cc708b4beed3831a10065664c84dba68b5dc (diff)
downloadale-8bf5d144ed2299e0ecd6fa8f9703647e5c5ef02f.zip
Started adding julia languageserver
Diffstat (limited to 'ale_linters/julia/languageserver.vim')
-rw-r--r--ale_linters/julia/languageserver.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/ale_linters/julia/languageserver.vim b/ale_linters/julia/languageserver.vim
new file mode 100644
index 00000000..1755c794
--- /dev/null
+++ b/ale_linters/julia/languageserver.vim
@@ -0,0 +1,30 @@
+" Author: Bartolomeo Stellato <bartolomeo.stellato@gmail.com>
+" Description: A language server for Julia
+
+call ale#Set('julia_languageserver_executable', 'julia')
+call ale#Set('julia_languageserver_use_global', get(g:, 'ale_use_global_executables', 0))
+
+function! ale_linters#julia#languageserver#GetExecutable(buffer) abort
+ let l:binary = ale#Var(a:buffer, 'julia_languageserver_executable')
+ return ale#Escape(l:binary)
+endfunction
+
+function! ale_linters#julia#languageserver#GetCommand(buffer) abort
+ let l:executable = ale_linters#julia#languageserver#GetExecutable(a:buffer)
+ let l:options = '--startup-file=no --history-file=no -e ' . '"
+\ using LanguageServer;
+\ server = LanguageServer.LanguageServerInstance(STDIN, STDOUT, false);
+\ server.runlinter = true;
+\ run(server);"'
+
+ return ale#Escape(l:executable) . ale#Escape(l:options)
+
+endfunction
+
+call ale#linter#Define('julia', {
+\ 'name': 'languageserver',
+\ 'lsp': 'stdio',
+\ 'executable_callback': 'ale_linters#julia#languageserver#GetExecutable',
+\ 'command_callback': 'ale_linters#julia#languageserver#GetCommand',
+\ 'project_root_callback': 'ale#julia#FindProjectRoot',
+\})