Closed Ionizing closed 3 years ago
Have you customized the value of eglot-jl-language-server-project
? If not could you check the value of that variable? Could you also paste the output of running M-: (eglot-jl--ls-invocation nil)
?
Thanks for the reply!
I've paste the output according the reply.
Have you customized the value of eglot-jl-language-server-project? If not could you check the value of that variable?
No, the only thing I did about eglot is listed in the follow:
$ rg eglot ~/.doom.d
packages.el
69:(package! eglot-jl)
config.el
182:(setq eglot-jl-default-environment "~/.julia/environments/v1.6") ;; found on julia forum
The value of variable eglot-jl-language-server-project
is "~/.julia/environments/v1.0"
Could you also paste the output of running M-: (eglot-jl--ls-invocation nil)?
("julia" "--startup-file=no" "--project=~/.julia/environments/v1.0" "/Users/ionizing/.doom.d/.local/straight/build-28.0.50/eglot-jl/eglot-jl.jl" "/Users/ionizing/github/namd.jl/src/" "")
It seems eglot works well if eglot-jl-language-server-project
is set to "~/.julia/environments/v1.6"
manually.
I am curious about why that variable is set to v1.0 environment by default... 🤔🤔
This is strange, because eglot-jl
should set this variable automatically to the correct default value.
What do you see when running:
M-xcustomize-variable
RETeglot-jl-language-server-project
RET
You should get something like this
Eglot Jl Language Server Project: /Users/ionizing/.doom.d/.local/straight/build-28.0.50/eglot-jl/
[State] : STANDARD.
Julia project to run language server from.
The project should have LanguageServer and SymbolServer packages
available.
Groups: Eglot Jl
Note in particular the customization state. If it is not is listed as "STANDARD" (like above), try clicking the State
button and the Erase customization
entry in the menu.
Anyway, the correct value for this variable should be something like
/Users/ionizing/.doom.d/.local/straight/build-28.0.50/eglot-jl/
and not
~/.julia/environments/v1.6
Thanks for the reply! @ffevotte
You should get something like this
Here is what I get without customized eglot-jl-language-server-project
:
It's interesting that it is CHANGED outside Customize
. It seems I have to set it to (setq eglot-jl-language-server-project "/Users/ionizing/.emacs.d/.local/straight/repos/eglot-jl")
.
By the way, would it be possible that someone adds the documentation of customizable variables of eglot-jl
to something like FAQ in README? It may help the ones in trouble save a lot of time. Anyway, I appreciate your patient replies.
It seems that manually (setq eglot-jl-language-server-project "/Users/ionizing/.emacs.d/.local/straight/repos/eglot-jl")
is a workaround for this issue. It should be the time close this issue.
Thanks for your help!
This "bug" is intentionally caused by doom: https://github.com/hlissner/doom-emacs/blob/ea3adb0e72a4c4baa88c6704678edf813757130e/modules/lang/julia/config.el#L97 :/
Hi, thanks for your fantastic work on eglot-jl, which may help me a lot on julia coding.
It seemed I came across an issue on the julia environment passed to eglot-jl.
My environments
I've installed julia v1.6 on my machine and
in which
v1.0
was created byeglot-jl-init
andeglot
.If I directly
cd
intoeglot-jl
folder and runjulia --project eglot-jl.jl
, it said:it seemed the
SymbolServer
andLanguageServer
works well.Also I am using the latest DoomEmacs with
(package! eglot-jl)
added topackages.el
only.The issue
However, if I open a julia project, then
:eglot-jl-init
and:eglot
, it complained:[click to expand] `ERROR: LoadError: ArgumentError: Package LanguageServer not found in current path.`
``` [client-request] (id:1) Tue May 11 21:17:31 2021: (:jsonrpc "2.0" :id 1 :method "initialize" :params (:processId 31148 :rootPath "/Users/ionizing/github/namd.jl/" :rootUri "file:///Users/ionizing/github/namd.jl" :initializationOptions #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data ()) :capabilities (:workspace (:applyEdit t :executeCommand (:dynamicRegistration :json-false) :workspaceEdit (:documentChanges :json-false) :didChangeWatchedFiles (:dynamicRegistration t) :symbol (:dynamicRegistration :json-false) :configuration t) :textDocument (:synchronization (:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t) :completion (:dynamicRegistration :json-false :completionItem (:snippetSupport t) :contextSupport t) :hover (:dynamicRegistration :json-false :contentFormat ["markdown" "plaintext"]) :signatureHelp (:dynamicRegistration :json-false :signatureInformation (:parameterInformation (:labelOffsetSupport t) :activeParameterSupport t)) :references (:dynamicRegistration :json-false) :definition (:dynamicRegistration :json-false) :declaration (:dynamicRegistration :json-false) :implementation (:dynamicRegistration :json-false) :typeDefinition (:dynamicRegistration :json-false) :documentSymbol (:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :symbolKind (:valueSet [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26])) :documentHighlight (:dynamicRegistration :json-false) :codeAction (:dynamicRegistration :json-false :codeActionLiteralSupport (:codeActionKind (:valueSet ["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"])) :isPreferredSupport t) :formatting (:dynamicRegistration :json-false) :rangeFormatting (:dynamicRegistration :json-false) :rename (:dynamicRegistration :json-false) :publishDiagnostics (:relatedInformation :json-false)) :experimental #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data ())))) [stderr] nil [stderr] No Changes to `~/.julia/environments/v1.0/Project.toml` [stderr] No Changes to `~/.julia/environments/v1.0/Manifest.toml` [stderr] [ Info: Environment successfully resolved [stderr] nil [stderr] nil [stderr] ERROR: LoadError: ArgumentError: Package LanguageServer not found in current path: [stderr] - Run `import Pkg; Pkg.add("LanguageServer")` to install the LanguageServer package. [stderr] [stderr] Stacktrace: [stderr] Stacktrace: [stderr] nil [stderr] [1] require(into::Module, mod::Symbol) [stderr] [1] require(into::Module, mod::Symbol) [stderr] @ Base ./loading.jl:871 [stderr] in expression starting at /Users/ionizing/.emacs.d/.local/straight/build-28.0.50/eglot-jl/eglot-jl.jl:47 [internal] Tue May 11 21:17:32 2021: (:message "Connection state changed" :change "exited abnormally with code 1\n") ----------b---y---e---b---y---e---------- [stderr] [stderr] [stderr] nil [stderr] nil [stderr] Process EGLOT (namd/julia-mode) stderr finished ```The
Project.toml
:The line
[stderr] No Changes to '~/.julia/environments/v1.0/Project.toml'
means eglot-jl is usingv1.0
environment, instead ofv1.6
, so can I solve this problem by defining the right julia environment within eglot-jl? Also it confuses me that why eglot-jl is usingv1.0
environment ...If more info is required, I'll provide as much as I can.
Looking forward to your reply~