aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/julials.lua
diff options
context:
space:
mode:
authorFredrik Ekre <ekrefredrik@gmail.com>2021-08-17 17:29:57 +0200
committerGitHub <noreply@github.com>2021-08-17 11:29:57 -0400
commit79a73d1c3c6bf4e000451c9df06c4e2a2b889c9b (patch)
treea75345e68adb7a7863a913abab79f287753d5866 /lua/lspconfig/julials.lua
parentMerge pull request #1150 from defntvdm/pyright_root_files (diff)
downloadnvim-lspconfig-79a73d1c3c6bf4e000451c9df06c4e2a2b889c9b.tar
nvim-lspconfig-79a73d1c3c6bf4e000451c9df06c4e2a2b889c9b.tar.gz
nvim-lspconfig-79a73d1c3c6bf4e000451c9df06c4e2a2b889c9b.tar.bz2
nvim-lspconfig-79a73d1c3c6bf4e000451c9df06c4e2a2b889c9b.tar.lz
nvim-lspconfig-79a73d1c3c6bf4e000451c9df06c4e2a2b889c9b.tar.xz
nvim-lspconfig-79a73d1c3c6bf4e000451c9df06c4e2a2b889c9b.tar.zst
nvim-lspconfig-79a73d1c3c6bf4e000451c9df06c4e2a2b889c9b.zip
feat(julials): use a separate package env for LanguageServer.jl (#1153)
Diffstat (limited to 'lua/lspconfig/julials.lua')
-rw-r--r--lua/lspconfig/julials.lua25
1 files changed, 19 insertions, 6 deletions
diff --git a/lua/lspconfig/julials.lua b/lua/lspconfig/julials.lua
index f5e66dab..25f1ffb4 100644
--- a/lua/lspconfig/julials.lua
+++ b/lua/lspconfig/julials.lua
@@ -7,9 +7,15 @@ local cmd = {
'--history-file=no',
'-e',
[[
- using Pkg
- Pkg.instantiate()
+ # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig
+ # with the regular load path as a fallback
+ ls_install_path = joinpath(
+ get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")),
+ "environments", "nvim-lspconfig"
+ )
+ pushfirst!(LOAD_PATH, ls_install_path)
using LanguageServer
+ popfirst!(LOAD_PATH)
depot_path = get(ENV, "JULIA_DEPOT_PATH", "")
project_path = let
dirname(something(
@@ -51,13 +57,20 @@ configs.julials = {
description = [[
https://github.com/julia-vscode/julia-vscode
-`LanguageServer.jl` can be installed with `julia` and `Pkg`:
+LanguageServer.jl can be installed with `julia` and `Pkg`:
```sh
-julia -e 'using Pkg; Pkg.add("LanguageServer"); Pkg.add("SymbolServer")'
+julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")'
```
-This installs LanguageServer.jl into your global julia environment.
+where `~/.julia/environments/nvim-lspconfig` is the location where
+the default configuration expects LanguageServer.jl to be installed.
-In order to have LanguageServer.jl pick up installed packages or dependencies in a Julia project, you must first instantiate the project:
+To update an existing install, use the following command:
+```sh
+julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()'
+```
+
+Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a
+Julia project, you must make sure that the project is instantiated:
```sh
julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()'
```