diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-01-15 00:40:25 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-15 00:40:25 -0800 |
| commit | 4e8b8de1b32e248eb5e14f498310dd6ebeabb26a (patch) | |
| tree | 7286e0c861449e767d1cd9e6fc7e78402963ebe3 /lua/lspconfig/julials.lua | |
| parent | Merge pull request #669 from mjlbach/fix_filetypes (diff) | |
| parent | [docgen] Update README.md (diff) | |
| download | nvim-lspconfig-4e8b8de1b32e248eb5e14f498310dd6ebeabb26a.tar nvim-lspconfig-4e8b8de1b32e248eb5e14f498310dd6ebeabb26a.tar.gz nvim-lspconfig-4e8b8de1b32e248eb5e14f498310dd6ebeabb26a.tar.bz2 nvim-lspconfig-4e8b8de1b32e248eb5e14f498310dd6ebeabb26a.tar.lz nvim-lspconfig-4e8b8de1b32e248eb5e14f498310dd6ebeabb26a.tar.xz nvim-lspconfig-4e8b8de1b32e248eb5e14f498310dd6ebeabb26a.tar.zst nvim-lspconfig-4e8b8de1b32e248eb5e14f498310dd6ebeabb26a.zip | |
Merge pull request #661 from mjlbach/lspinfo_fix_display
LspInfo: fix display when client cmd contains newlines
Diffstat (limited to 'lua/lspconfig/julials.lua')
| -rw-r--r-- | lua/lspconfig/julials.lua | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/lua/lspconfig/julials.lua b/lua/lspconfig/julials.lua index c72ae52e..35a1c2a1 100644 --- a/lua/lspconfig/julials.lua +++ b/lua/lspconfig/julials.lua @@ -1,29 +1,32 @@ local configs = require 'lspconfig/configs' local util = require 'lspconfig/util' +local cmd = { + "julia", + "--startup-file=no", + "--history-file=no", + "-e", [[ + using Pkg; + Pkg.instantiate() + using LanguageServer; using SymbolServer; + depot_path = get(ENV, "JULIA_DEPOT_PATH", "") + project_path = dirname(something(Base.current_project(pwd()), Base.load_path_expand(LOAD_PATH[2]))) + # Make sure that we only load packages from this environment specifically. + @info "Running language server" env=Base.load_path()[1] pwd() project_path depot_path + server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path); + server.runlinter = true; + run(server); + ]] +}; + configs.julials = { default_config = { - on_new_config = function(new_config,new_root_dir) + cmd = cmd; + on_new_config = function(new_config, _) local server_path = vim.fn.system("julia -e 'print(Base.find_package(\"LanguageServer\"))'") - local cmd = { - "julia", - "--project="..server_path:sub(0,-19), - "--startup-file=no", - "--history-file=no", - "-e", [[ - using Pkg; - Pkg.instantiate() - using LanguageServer; using SymbolServer; - depot_path = get(ENV, "JULIA_DEPOT_PATH", "") - project_path = dirname(something(Base.current_project(pwd()), Base.load_path_expand(LOAD_PATH[2]))) - # Make sure that we only load packages from this environment specifically. - @info "Running language server" env=Base.load_path()[1] pwd() project_path depot_path - server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path); - server.runlinter = true; - run(server); - ]] - }; - new_config.cmd = cmd + local new_cmd = vim.deepcopy(cmd) + table.insert(new_cmd, 2, "--project="..server_path:sub(0,-19)) + new_config.cmd = new_cmd end, filetypes = {'julia'}; root_dir = function(fname) |
