Skip to content

Instantly share code, notes, and snippets.

@norcalli
Created January 3, 2020 01:00
Show Gist options
  • Save norcalli/8000d38c61fa93b317bfdf2fd74e7b6a to your computer and use it in GitHub Desktop.
Save norcalli/8000d38c61fa93b317bfdf2fd74e7b6a to your computer and use it in GitHub Desktop.
require'nvim_lsp/skeleton'.julials = {
default_config = {
cmd = {'julia', '--startup-file=no', '--history-file=no', '-e', [[
using Pkg;
using LanguageServer;
import StaticLint;
import SymbolServer;
env_path = dirname(Pkg.Types.Context().env.project_file);
debug = false;
server = LanguageServer.LanguageServerInstance(stdin, stdout, debug, env_path, "", Dict());
server.runlinter = true;
run(server);
]]};
filetypes = {'julia'};
log_level = vim.lsp.protocol.MessageType.Warning;
settings = {};
root_dir = function(fname)
return nvim_lsp.util.find_git_ancestor(fname) or vim.loop.os_homedir()
end;
};
}
require'nvim_lsp/skeleton'.julials.install = function()
local script = [[
julia -e 'using Pkg; Pkg.add("LanguageServer") Pkg.add("SymbolServer") Pkg.add("StaticLint")'
]]
nvim_lsp.util.sh(script, vim.loop.os_homedir())
end
require'nvim_lsp/skeleton'.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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment