non-Jedi / eglot-jl

Wrapper for using Julia LanguageServer.jl with emacs eglot
Creative Commons Zero v1.0 Universal
62 stars 11 forks source link

Allow customizing environment language server run from #15

Closed non-Jedi closed 4 years ago

non-Jedi commented 4 years ago

Fixes #13.

This commit remove Pkg from the Project.toml since it can be loaded with the standard library in LOAD_PATH. This is convenient when developing LanguageServer.jl since it doesn't have Pkg in its dependencies.

Thoughts on loading Pkg by assuming standard library is on LOAD_PATH @ffevotte?

ffevotte commented 4 years ago

I guess it is a bit unorthodox, but I think it is a relatively safe assumption that "@stdlib" will always be in LOAD_PATH. And I can see the benefit to keep using eglot when developing LanguageServer itself.

There used to be a recommendation in the README.org to run

JULIA_LOAD_PATH="@" julia --project=path/to/eglot-jl/ path/to/eglot-jl/eglot-jl.jl path/to/project ""

but it isn't there anymore, so unless users keep doing it by sheer force of habit, such things are not likely to happen.

To err on the side of caution, it would also be possible to explicitly set LOAD_PATH before importing Pkg:

empty!(LOAD_PATH)
push!(LOAD_PATH, "@stdlib")
import Pkg
[...]

I'm not sure such precautions are needed, though...