From: "João Távora" <joaotavora@gmail.com>
To: Alan Donovan <adonovan@google.com>
Cc: sebastian.poeplau@mailbox.org,
Felician Nemeth <felician.nemeth@gmail.com>,
62116@debbugs.gnu.org
Subject: bug#62116: RFE: eglot: support window.showDocument LSP RPC
Date: Mon, 15 May 2023 09:48:50 +0100 [thread overview]
Message-ID: <CALDnm51-Rj_QseDvbnAd9uHQ9FP2+2-DscPc9BVe3RFkfjY8CA@mail.gmail.com> (raw)
In-Reply-To: <CAPVWWDUEnvic0jDx40g_Ju7yLG-YBCXNU8SCQy=Hp9Rn60c39Q@mail.gmail.com>
On Fri, May 12, 2023 at 9:46 PM Alan Donovan <adonovan@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
next prev parent reply other threads:[~2023-05-15 8:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 15:34 bug#62115: RFE: eglot: support window.showDocument LSP RPC Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-10 15:40 ` bug#62116: " Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-11 12:56 ` João Távora
2023-03-11 13:17 ` Eli Zaretskii
2023-03-11 20:20 ` João Távora
2023-03-12 6:26 ` Eli Zaretskii
2023-04-22 9:08 ` Felician Nemeth
2023-05-05 6:03 ` Eli Zaretskii
2023-05-05 7:35 ` João Távora
2023-05-05 16:51 ` João Távora
2023-05-05 17:06 ` Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-05 17:19 ` João Távora
2023-05-05 17:35 ` Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-05 17:36 ` Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-11 23:12 ` João Távora
2023-05-06 12:46 ` Felician Nemeth
2023-05-08 13:23 ` Felician Nemeth
2023-05-08 16:36 ` João Távora
2023-05-09 17:03 ` Felician Nemeth
2023-05-09 17:13 ` Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-11 22:41 ` João Távora
2023-05-12 0:54 ` João Távora
2023-05-12 20:46 ` Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-15 8:48 ` João Távora [this message]
2023-05-13 10:21 ` Felician Nemeth
2023-05-13 11:57 ` João Távora
2023-05-14 19:02 ` Felician Nemeth
2023-05-14 19:19 ` João Távora
2023-05-15 10:45 ` João Távora
2023-05-16 18:34 ` João Távora
2023-05-24 22:13 ` Alan Donovan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-25 1:03 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALDnm51-Rj_QseDvbnAd9uHQ9FP2+2-DscPc9BVe3RFkfjY8CA@mail.gmail.com \
--to=joaotavora@gmail.com \
--cc=62116@debbugs.gnu.org \
--cc=adonovan@google.com \
--cc=felician.nemeth@gmail.com \
--cc=sebastian.poeplau@mailbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).