Replies: 6 comments 18 replies
-
True, but according to the rust-analyzer docs "If a language client does not know about rust-analyzer's configuration options it can get sensible defaults by doing any of the following: Not sending initializationOptions..." . Which is what Eglot does at the moment. |
Beta Was this translation helpful? Give feedback.
-
then you can try to set the variable (cl-defmethod eglot-initialization-options ((server eglot-lsp-server))
(if (eq 'rust-mode (eglot--major-mode server))
eglot-workspace-configuration
eglot--{})) (The proper way would be to create a defclass for rust-analyzer similarly to eglot-eclipse-jdt) |
Beta Was this translation helpful? Give feedback.
-
Yes it is, but that doesn't mean it's wrong or useless. Have you or anyone said it to them? Anyway, I'm starting to see, from your description, hat InitializeParams is really little more than typescriptish command line arguments, also arbitrary. So I wonder if there's space for this in |
Beta Was this translation helpful? Give feedback.
-
Sorry to dig up old discussions, but I'm trying out trunk - this is especially painful with an unconfigured rust-analyzer, since trunk's This means that, every time I change anything, first rust-analyzer will rebuild the whole project (because trunk built a different target last time it served something), eglot will show rust-analyzer's lints, and then trunk will rebuild the whole project, dooming the whole thing to be repeated next time I save. Combined with rust's long build times, this means a good 5-10 minutes of CPU churning every time I make the tiniest change to my project. Digging a bit through rust-analyzer issues, the vscode people seem to solve this like so: ((rust-mode
. ((eglot-workspace-configuration
. ((:rust-analyzer (:cargo (:target "wasm32-unknown-unknown")))))))) But that won't work, and I was left scratching my head until I found this. Ultimately this isn't at all eglot's fault, but as-is this is horribly unusable. Could we carve out a place to document how to handle quirky servers, and which servers are quirky in the first place? I really wasn't expecting this to be so broken. |
Beta Was this translation helpful? Give feedback.
-
Ahh, ok. But at least I understand your solution for the red herring now. I do wonder how to make fixes like this simple for users and not too onerous on Eglot's code base. I guess the approach you used is decent. And btw there's a section in the README "Handling quirky servers", i think. |
Beta Was this translation helpful? Give feedback.
-
Commit 83a61f6 implemented the requested feature, so I mark this as |
Beta Was this translation helpful? Give feedback.
-
Currently, it is impossible to configure servers like rust-analyzer due to the inability to set options via the InitializeParams message. Supporting this would allow the simple use of such servers.
Beta Was this translation helpful? Give feedback.
All reactions