-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:initializationOptions key in eglot-server-programs does not work #940
Labels
Comments
See also #845 (reply in thread). EDIT See also https://bugs.gnu.org/57725. |
Thanks. This is a new feature that hasn't been properly tested. |
@vitvakatu can you try with this patch to eglot.el (or simply evaluate the form) diff --git a/eglot.el b/eglot.el
index ff94d5ca5f..3b1b1a9536 100644
--- a/eglot.el
+++ b/eglot.el
@@ -796,6 +796,8 @@ treated as in `eglot-dbind'."
:documentation
"Represents a server. Wraps a process for LSP communication.")
+(cl-defmethod initialize-instance :before ((_server eglot-lsp-server) &optional args)
+ (cl-remf args :initializationOptions))
;;; Process management
(defvar eglot--servers-by-project (make-hash-table :test #'equal) |
joaotavora
added a commit
that referenced
this issue
Sep 17, 2022
Also see #1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions.
joaotavora
added a commit
that referenced
this issue
Sep 17, 2022
Also see #1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions.
joaotavora
added a commit
that referenced
this issue
Sep 17, 2022
Also see #1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions.
joaotavora
added a commit
that referenced
this issue
Sep 17, 2022
Also see #1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions. * eglot-tests.el (eglot-server-programs-simple-missing-executable): Update test.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 18, 2022
…r-programs Also see joaotavora/eglot#1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions. * eglot-tests.el (eglot-server-programs-simple-missing-executable): Update test.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 19, 2022
…r-programs Also see joaotavora/eglot#1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions. * eglot-tests.el (eglot-server-programs-simple-missing-executable): Update test.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 19, 2022
Also see #1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions. * eglot-tests.el (eglot-server-programs-simple-missing-executable): Update test. #940: joaotavora/eglot#940 #1038: joaotavora/eglot#1038
joaotavora
added a commit
that referenced
this issue
Sep 24, 2022
* eglot.el (eglot--guess-contact): Add back 'split-string-and-unquote' lost in #940 fix.
jollaitbot
pushed a commit
to sailfishos-mirror/emacs
that referenced
this issue
Oct 12, 2022
Also see joaotavora/eglot#1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions. * eglot-tests.el (eglot-server-programs-simple-missing-executable): Update test. GitHub-reference: fix joaotavora/eglot#940
jollaitbot
pushed a commit
to sailfishos-mirror/emacs
that referenced
this issue
Oct 20, 2022
Also see joaotavora/eglot#1038. This feature was poorly tested, and simply wouldn't work when trying to initialize the server object. The simple solution is to ignore :initializationOptions initarg in this context. It is still stored separately as and accessed as the 'eglot--saved-initargs' slot. Another complication arises in eglot--guess-contact, which tried too hard to be able to compose an interactive prompt (when the server program can't be found). The solution is just to give up when :autoport or :initializationOptions is found. It's not easy or practical to have the user provide non-string arguments via a string interface like the minibuffer. * eglot.el (initialize-instance :before eglot-lsp-server): Don't pass :initializationOptions initarg onward. (eglot--guess-contact): Simplify. Don't try heroics with :autoport and :initializationOptions. * eglot-tests.el (eglot-server-programs-simple-missing-executable): Update test. GitHub-reference: fix joaotavora/eglot#940
jollaitbot
pushed a commit
to sailfishos-mirror/emacs
that referenced
this issue
Oct 20, 2022
* eglot.el (eglot--guess-contact): Add back 'split-string-and-unquote' lost in joaotavora/eglot#940 fix. GitHub-reference: per joaotavora/eglot#940
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LSP transcript - M-x eglot-events-buffer (mandatory unless Emacs inoperable)
Not possible to provide -
eglot
is not starting.Backtrace (mandatory, unless no error message seen or heard):
Minimum Reproducible Example (mandatory)
I start Emacs GUI
I downloaded the latest
rust-analyzer
executable from here: https://github.com/rust-lang/rust-analyzer/releases/tag/2022-04-25 and placed it to the directory inPATH
.I can reproduce on any Rust file or repository, but let's take https://github.com/rust-lang/rustfmt. Go to file
rustfmt/src/config/mod.rs
.I have the following Eglot config in my Emacs config file:
M-x eglot
in any Rust file, I get the following error:I expect
eglot
to start normally, as the documentation states:The text was updated successfully, but these errors were encountered: