GNU bug report logs -
#62116
RFE: eglot: support window.showDocument LSP RPC
Previous Next
Full log
View this message in rfc822 format
On Fri, May 12, 2023 at 9:46 PM Alan Donovan <adonovan <at> google.com> wrote:
>
> Thanks Joao,
>
> I quickly tried this patch, and found two problems.
>
> The first is that, because eglot-widening uses save-excursion, it
> doesn't leave the cursor in the correct position; it merely jumps
> there for a moment and then goes back to wherever it was before.
> Removing the eglot-widening is an effective workaround.
OK, I'll have a look.
> The second issue is that Emacs still often gets stuck making a
> recursive RPC, as previously discussed. I interrupted it using
> toggle-debug-on-quit and recorded the emacs Lisp function call stack.
> I've lightly tidied it to omit arguments and non-function sexprs:
>
> accept-process-output
> jsonrpc-request textDocument/documentSymbol
> eglot-imenu
> run-hooks(after-change-major-mode-hook)
> run-mode-hooks(go-mode-hook)
> go-mode()
> set-auto-mode-0(go-mode nil)
> set-auto-mode--apply-alist
> set-auto-mode
> normal-mode
> after-find-file
> find-file-noselect-1 foo.go
> find-file-noselect foo.go
> eglot-handle-request window/showDocument
> jsonrpc-connection-receive window/showDocument
> jsonrpc--process-filter
>
> In short the handling of the showDocument downcall causes eglot to
> find-file a new Go source file, whose go-mode hooks cause a
> documentSymbol upcall to be sent to the server, which then blocks
> indefinitely as it is still in the middle of whatever active request
> sent the showDocument downcall.
>
> I hope this was helpful.
It was, at least to confirm that you do have eglot-imenu
in your go-mode-hook somehow. I say "somehow" because it's still
not clear why eglot-imenu is in there. I've asked you this already
in the past, but maybe I wasn't clear. Can you try to reproduce
these problems with a controlled experiment from Emacs -Q? That
means "Emacs without any customizations".
Also not immediately clear is if you tried the patch
I attached earlier or if you tried the most recent
code I ended up pushing to the emacs master branch.
From your backtrace, I'm fairly sure you tried the
former. Please try the latter and report back (and
if possible try it from a non-user-configuration
Emacs -Q run).
João
This bug report was last modified 1 year and 292 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.