-
Notifications
You must be signed in to change notification settings - Fork 199
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
Flymake doesn't start properly when using eglot over Tramp #670
Comments
If you don't provide But since you seem to understand how to call programs from the shell, can you try with? It would be much better if
Regardless, I think I have enough to reproduce your issue when I find some time. Thanks! |
I commented out everything in my I think I was just overthinking the instructions in the bug template. Since I'm testing on Emacs 27, eglot depends on the newer GNU ELPA versions of several core packages, including Flymake. I was worried that this would result in things breaking in unexpected ways. I had had issues originally when I installed eglot via It turns out I didn't need to go through all that for this bug, but it could be relevant when other people try to report bugs on older versions of Emacs. |
After some debugging, I think I've found where the issue is: Line 1652 in fc221c8
This takes a URI from the LSP server, converts it into a regular path, and then tries to find a buffer for it. However, Luckily, we know what the current server is, since the snippet above is in I can write a patch for this, but I'm still waiting for copyright assignment paperwork for some other Emacs changes. A patch for this is probably small enough to not count as "legally significant", but I have a couple of merged Tramp patches that put me at the limit. I'm not sure if it would be against the rules for me to supply a patch here (at least not until my copyright paperwork is done), so I've erred on the side of caution and avoided writing a patch. |
Nice. Good analysis. So I guess this should either be called from the correct buffer, or |
Can you try this patch? diff --git a/eglot.el b/eglot.el
index 20f5995..f926709 100644
--- a/eglot.el
+++ b/eglot.el
@@ -945,7 +945,8 @@ This docstring appeases checkdoc, that's all."
(format "*%s stderr*" readable-name))
:file-handler t)))))))
(spread (lambda (fn) (lambda (server method params)
- (apply fn server method (append params nil)))))
+ (let ((eglot--cached-server server))
+ (apply fn server method (append params nil))))))
(server
(apply
#'make-instance class |
That also works! Flymake errors show up correctly and editing the file correctly updates the Flymake annotations. However, I do get another unusual problem as a result of this: occasionally, if I make successive edits to the file, eventually I get this error message: @albinus, do you have any thoughts on the "Forbidden reentrant call of Tramp" error? I'll try to provide more details here as I narrow down what's actually happening. |
@jimporter nice, so I'll fix this issue, but please open another, different issue for this seemingly completely different problem. |
@joaotavora I installed the latest revision from MELPA on an MS Windows system and it all looks good, with one weird issue I don't understand: the automatically-compiled I'm not sure what's causing this (it's all magic to me), but I figured I'd mention it. Maybe there's something eglot can do about this, or maybe it's just a bug in Emacs (or package.el specifically)... Edit: Hmm, I notice that the Travis CI build for eglot failed with an error pointing to the newly-added code: https://travis-ci.org/github/joaotavora/eglot/jobs/767765262#L513 |
Per #670. Otherwise the dynamic binding of it in in eglot--connect won't work. * eglot.el (eglot--cached-server): Move up.
…ion handlers * eglot.el (eglot--connect): Ensure `eglot--cached-server` bound when calling notification/request methods.
Per joaotavora/eglot#670. Otherwise the dynamic binding of it in in eglot--connect won't work. * eglot.el (eglot--cached-server): Move up.
…ion handlers * eglot.el (eglot--connect): Ensure `eglot--cached-server` bound when calling notification/request methods.
Per joaotavora/eglot#670. Otherwise the dynamic binding of it in in eglot--connect won't work. * eglot.el (eglot--cached-server): Move up.
* eglot.el (eglot--connect): Ensure `eglot--cached-server` bound when calling notification/request methods. #670: joaotavora/eglot#670
Per #670. Otherwise the dynamic binding of it in in eglot--connect won't work. * eglot.el (eglot--cached-server): Move up. #673: joaotavora/eglot#673 #670: joaotavora/eglot#670
* eglot.el (eglot--connect): Ensure `eglot--cached-server` bound when calling notification/request methods. GitHub-reference: fix joaotavora/eglot#670
Per joaotavora/eglot#670. Otherwise the dynamic binding of it in in eglot--connect won't work. * eglot.el (eglot--cached-server): Move up. GitHub-reference: fix joaotavora/eglot#673
When opening a file over Tramp, Flymake fails to highlight errors, and once you make a change to the file, the Flymake status in the modeline will be stuck at "Wait" forever. To test this, I used the following C++ file:
If I open this file locally and activate eglot via
M-x eglot
, I see Flymake errors on lines 3 (at the{
) and 5 (at the.
), which is what I'd expect. If I open this file over Tramp (withC-x C-f /ssh:localhost:~/path/to/file.cpp RET
) and activate eglot, I don't see Flymake errors. However, I am able to use LSP completion as normal, e.g. by putting the point at the end of the file and hittingC-M-i
; all the member functions forstd::vector
show up as expected.I'm not sure if there's a Flymake-specific buffer that I should provide to help diagnose this (I've never really used Flymake until now), so just let me know if you need any other info.
Note: this seems similar to #632, but I only see a problem when editing a file over Tramp.
LSP transcript - M-x eglot-events-buffer (mandatory unless Emacs inoperable)
Minimal configuration (mandatory)
# Type this in a shell to start an Emacs with Eglot configured $ emacs
The text was updated successfully, but these errors were encountered: