Replies: 1 comment 3 replies
-
Analysis is nice, but reproductions is better. I've reproduced this in one specific situation, using |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have found that rust-analyzer often crashes when used together with eglot. Upon investigation, I discovered that this is because the
languageId
parameter in thedidOpen
request of eglot is set to null, causing rust-analyzer to panic during unwrapping.Further investigation revealed that this is due to the request issued by
eglot--maybe-activate-editing-mode
in theafter-change-major-mode-hook
. The functionnormal-mode
inlisp/files.el
indicates thatafter-change-major-mode-hook
is executed beforeset-auto-mode
, causing the current major mode to befundamental-mode
at this point. As eglot cannot find the languageId for fundamental mode, it sends null as the languageId. However, according to the LSP spec, thelanguageId
parameter must be a String, not String?, so we cannot send null.In any case, eglot may need to set a default value for languageId, such as "Unknown".
Beta Was this translation helpful? Give feedback.
All reactions