aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim_lsp/julials.lua
diff options
context:
space:
mode:
authorDheepak Krishnamurthy <me@kdheepak.com>2020-02-05 01:15:37 -0700
committerGitHub <noreply@github.com>2020-02-05 00:15:37 -0800
commit92649c7f081bc18c7cc558057789e1b7fc3c4294 (patch)
treeaff5b493c9902531ff754ed92e662059df2bf0e0 /lua/nvim_lsp/julials.lua
parentMerge #112 'docgen.lua: call require_all_configs() earlier' (diff)
downloadnvim-lspconfig-92649c7f081bc18c7cc558057789e1b7fc3c4294.tar
nvim-lspconfig-92649c7f081bc18c7cc558057789e1b7fc3c4294.tar.gz
nvim-lspconfig-92649c7f081bc18c7cc558057789e1b7fc3c4294.tar.bz2
nvim-lspconfig-92649c7f081bc18c7cc558057789e1b7fc3c4294.tar.lz
nvim-lspconfig-92649c7f081bc18c7cc558057789e1b7fc3c4294.tar.xz
nvim-lspconfig-92649c7f081bc18c7cc558057789e1b7fc3c4294.tar.zst
nvim-lspconfig-92649c7f081bc18c7cc558057789e1b7fc3c4294.zip
julials #91
Diffstat (limited to 'lua/nvim_lsp/julials.lua')
-rw-r--r--lua/nvim_lsp/julials.lua53
1 files changed, 53 insertions, 0 deletions
diff --git a/lua/nvim_lsp/julials.lua b/lua/nvim_lsp/julials.lua
new file mode 100644
index 00000000..ab5187c9
--- /dev/null
+++ b/lua/nvim_lsp/julials.lua
@@ -0,0 +1,53 @@
+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;
+ settings = {};
+ 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