From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#62116: RFE: eglot: support window.showDocument LSP RPC Date: Fri, 05 May 2023 18:19:23 +0100 Message-ID: <87pm7esnl0.fsf@gmail.com> References: <87jzznxx8f.fsf@gmail.com> <83fsabwhpg.fsf@gnu.org> <87v8j7vy48.fsf@gmail.com> <83r0tuv62t.fsf@gnu.org> <874jp8gu8a.fsf@betli.tmit.bme.hu> <838re3jowg.fsf@gnu.org> <87ttwqsow9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33805"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sebastian.poeplau@mailbox.org, Felician Nemeth , 62116@debbugs.gnu.org To: Alan Donovan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 05 19:18:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puz4N-0008dk-JB for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 May 2023 19:18:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puz4F-0001lB-P7; Fri, 05 May 2023 13:18:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puz4E-0001l2-O5 for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puz4E-0001LT-Eu for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puz4E-00074O-9h for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 May 2023 17:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62116 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 62116-submit@debbugs.gnu.org id=B62116.168330704027122 (code B ref 62116); Fri, 05 May 2023 17:18:02 +0000 Original-Received: (at 62116) by debbugs.gnu.org; 5 May 2023 17:17:20 +0000 Original-Received: from localhost ([127.0.0.1]:57354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puz3X-00073O-Oo for submit@debbugs.gnu.org; Fri, 05 May 2023 13:17:20 -0400 Original-Received: from mail-wm1-f49.google.com ([209.85.128.49]:62812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puz3V-000738-4W for 62116@debbugs.gnu.org; Fri, 05 May 2023 13:17:18 -0400 Original-Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3f315735514so107022495e9.1 for <62116@debbugs.gnu.org>; Fri, 05 May 2023 10:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683307031; x=1685899031; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yi9OBPzFFPXPzN8+rebtPl4POljeqJTTDGDLspNmUZs=; b=MAVmopuaVJukQh3JXENwpJ6RibMYun1Hh0NCLLPK07S7vPfVnRb1GIve/OxkL/ewk8 bMGo48tq7IQod2bLg9xkyi5KfU+ZBN1uOo6QFYpOsBV5dL+vb6elYivWAr0c7QUYOClR bqXt6yd8tBhdTXJ3+zgVbPgsgg52S5lxXP4dixtMWBNnPEkN9kw9D4f5be5iEF0tq9OP IE85TDQOB0dIAD34OhL9S3K0Ji3eZ4DdGAi5GkmWDGIsy5ynGl0GwI5hW67UhNDVYzZt qcHA0VxBqwAGMEmljsAdRjLSU2PLeHwCf6UKpYVYJ+3/GSd93uDZyK7BD+HS/KOXvf/J wwxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683307031; x=1685899031; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yi9OBPzFFPXPzN8+rebtPl4POljeqJTTDGDLspNmUZs=; b=HsNdd2tp2f8EEzqKJI5xPTheLW9rqDoMNbN5hQk3JBMlTjL8J59zo/aG+6F0bm706n Jtsp6TNbEMdoQCkCpvJgf87bxSQESe9hnpiCZ5cMXGjKF9bBt1RPtAasE2U/mZGVleNA +IEqFldQ6oxYTch+rx8ucKLppkTtHt0Y3X0ZF6HJeIGKoLvfr/D/bqTiNbJaIbMeTum4 pUOrF2yi+5w68PjO47weO7X7cAI8BEIBDcAUShxzcreADewSzot6FZZn+ijvkGfqVUFK NZntLMY7fh60U6fUui3an87Duh/2aWGddAHqVBwaGs8Vo+fAzG/KyC1OM+BX+GW7Cg9Q FAfg== X-Gm-Message-State: AC+VfDxAlInReU44b69hDmGlNpQi/KiVkz0zmM1EJT4w2LfjjY8jqRsv QV6EZZaOWrpPMHEA3LUWH20= X-Google-Smtp-Source: ACHHUZ6R56U8njUinnfN9I997YIJhLT0LAMzw+6CyR652RBJDsWPeOI53gbIKxfvQ9c6FHP867PV4g== X-Received: by 2002:a1c:f719:0:b0:3f1:70d5:1be8 with SMTP id v25-20020a1cf719000000b003f170d51be8mr2121186wmh.15.1683307031065; Fri, 05 May 2023 10:17:11 -0700 (PDT) Original-Received: from krug (87-196-74-197.net.novis.pt. [87.196.74.197]) by smtp.gmail.com with ESMTPSA id b13-20020a05600010cd00b00306299be5a2sm2968337wrx.72.2023.05.05.10.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 10:17:10 -0700 (PDT) In-Reply-To: (Alan Donovan's message of "Fri, 5 May 2023 13:06:58 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261125 Archived-At: Alan Donovan writes: > Hi Joao, sorry for the long radio silence. I've been meaning to return > to this but we're in a release crunch lately. Thanks for replying back. > The reason for the async approach is to avoid nested RPCs between the > client and gopls (Go LSP) server. The server is effectively > single-threaded (the underlying JSON RPC implementation is full duplex > but gopls' handlers use a lock), so if a server RPC initiates a > showDocument downcall, which causes the client to open a file, then > the find-file hooks for that file will make another RPC to the server, > which causes it to get stuck. Arguably this is a problem in the design > of gopls, but I doubt it is easy to fix, and I wonder how many other > LSP servers have ended up taking the same approach. An alternative > solution would be for gopls never to make a synchronous showDocument > downcall, but instead to fire it off in another thread. Yes, but I don't really think this is a design problem with gopls. Or at least I don't hink Eglot should not make these nested calls in the first place. So I would like to understand how this nested RPC requests takes place. From my reading of the eglot.el's code, there aren't any -- t= hat is, with Emacs -Q -- at least. So I would like to reproduce this situation to analyse what can be done. I have gopls on my archlinux machine, though I seldom program in Go. How does one go about setting up gopls in terms of workspace configuration, command line options, etc so that the feature is exercised? Also, can I somehow make use of this feature with any small hello world project or do I need something bigger? In that case can you point me to a git repository that I can download, or attach that project? >> 1. if you think the Emacs frame should be raised and/or focused when a w= indow.showDocument comes in. > > I think this is appropriate, since there's otherwise a good chance > that nothing would appear to happen in response to (e.g.) a click. But > perhaps we can play with it and get some experience. It may warrant a > configuration option, but let's try to avoid that if possible. Agree 100%. My main curiosity is where does this "click" happen in the first place... (that's related to my lack of hands-on experience with this feature, as described above) >> 2. if browse-url should be used for non-file: urls (it might open a brow= ser window outside of Emacs, which IMO is fine.) > > What's the alternative? The very purpose of the operation is to open a > URL in a browser. Not always, IIUC. Sometimes it's just to open a file. Also Emacs has a web browser built-in. We could theoretically force it to use this web browser (though I don't think we should). Jo=C3=A3o