]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/ale_linters/julia/languageserver.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / ale_linters / julia / languageserver.vim
1 " Author: Bartolomeo Stellato <bartolomeo.stellato@gmail.com>
2 " Description: A language server for Julia
3
4 " Set julia executable variable
5 call ale#Set('julia_executable', 'julia')
6
7 function! ale_linters#julia#languageserver#GetCommand(buffer) abort
8     let l:julia_executable = ale#Var(a:buffer, 'julia_executable')
9     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);'
10
11     return ale#Escape(l:julia_executable) . ' --project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
12 endfunction
13
14 call ale#linter#Define('julia', {
15 \   'name': 'languageserver',
16 \   'aliases': ['julials'],
17 \   'lsp': 'stdio',
18 \   'executable': {b -> ale#Var(b, 'julia_executable')},
19 \   'command': function('ale_linters#julia#languageserver#GetCommand'),
20 \   'language': 'julia',
21 \   'project_root': function('ale#julia#FindProjectRoot'),
22 \})