blob: 16cc83c67f74ff07db261f9adf2492e776a6712c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
configs.julials = {
default_config = {
cmd = {
"julia", "--project", "--startup-file=no", "--history-file=no", "-e", [[
using LanguageServer;
using Pkg;
server = LanguageServer.LanguageServerInstance(stdin, stdout, false, dirname(Pkg.Types.Context().env.project_file));
server.runlinter = true; run(server);
]]
};
filetypes = {'julia'};
log_level = vim.lsp.protocol.MessageType.Warning;
root_dir = function(fname)
return util.find_git_ancestor(fname) or vim.loop.os_homedir()
end;
};
docs = {
vscode = "julialang.language-julia";
description = [[
https://github.com/julia-vscode/julia-vscode
`LanguageServer.jl` can be installed via `:LspInstall julials` or by yourself the `julia` and `Pkg`:
```sh
julia -e 'using Pkg; Pkg.add("LanguageServer")'
```
]];
};
}
configs.julials.install = function()
local script = [[
julia -e 'using Pkg; Pkg.add("LanguageServer")'
]]
util.sh(script, vim.loop.os_homedir())
end
configs.julials.install_info = function()
local script = [[
julia -e 'using LanguageServer'
]]
local status = pcall(vim.fn.system, script)
return {
is_installed = status and vim.v.shell_error == 0;
}
end
--- vim:et ts=2 sw=2
|