Typescript Code-Actions Do Nothing #1225
-
I have a simple .ts file class ToBeMethoded {
constructor() {
this.myMethod();
}
} where I place the cursor in Further, any code action that is supposed to edit the buffer seems to fail silently. I have no idea where to start to find out what's wrong here. The full content of the As far as I can tell, the language server behaves as expected.
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 9 replies
-
This may (or may not be) a bug in Eglot. It seems the server is providing a lot of actions, which in this case are commands and you choose this one. Eglot issues,
The server doesn't send anything back. Normally it would initiate an edit. But here, the edit to be performed was already there. So Eglot could -- in theory -- have just applied it. I need you to supply the Eglot and Emacs versions exactly as described in https://joaotavora.github.io/eglot/#Troubleshooting-Eglot. That is step 5 in that list. |
Beta Was this translation helpful? Give feedback.
-
Thanks! Emacs version is
According to the top of
It seems I still get Eglot via straight ... if not intentionally. Isn't that prepackaged with Emacs 29? |
Beta Was this translation helpful? Give feedback.
-
Okay ... it seems the issue is introduced between
When I use the built in version, things work as expected. |
Beta Was this translation helpful? Give feedback.
-
OK, so it is a regression, as I feared.
It is, but Eglot development continues anyway and packaged versions will have new features, bugfixes... and in this case regressions :-) |
Beta Was this translation helpful? Give feedback.
-
OK. but just to be clear, you need to keep using some sort package manager (straight.el or sth else) if you want to get new eglot releases in Emacs-29. So moving to Emacs-29 doesn't necessarily mean you want to disable it.
You're very welcome. |
Beta Was this translation helpful? Give feedback.
-
I believe this was just a typo. Can you check if this fixes it? diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index cd5831efc48..0140db0c4b3 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -741,7 +741,7 @@ eglot-execute
(((Command)) (eglot--request server :workspace/executeCommand action))
(((CodeAction) edit command)
(when edit (eglot--apply-workspace-edit edit))
- (when command (eglot--request server :workspace/executeCommand action))))))
+ (when command (eglot--request server :workspace/executeCommand command))))))
(cl-defgeneric eglot-initialization-options (server)
"JSON object to send under `initializationOptions'." |
Beta Was this translation helpful? Give feedback.
I believe this was just a typo. Can you check if this fixes it?