Skip to content

Commit

Permalink
feat(julials): use a separate package env for LanguageServer.jl (#1153)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Aug 17, 2021
1 parent acb4208 commit 79a73d1
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions lua/lspconfig/julials.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()'
```
Expand Down

0 comments on commit 79a73d1

Please sign in to comment.