From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Donovan via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62116: RFE: eglot: support window.showDocument LSP RPC Date: Fri, 5 May 2023 13:06:58 -0400 Message-ID: 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> Reply-To: Alan Donovan 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="25562"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sebastian.poeplau@mailbox.org, Felician Nemeth , 62116@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 05 19:08:19 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 1puyup-0006Wi-Bc for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 May 2023 19:08:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puyua-0007E6-7k; Fri, 05 May 2023 13:08:04 -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 1puyuY-0007DY-Hw for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:08: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 1puyuX-0007ec-PK for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puyuX-0006oK-KN for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 13:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Donovan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 May 2023 17:08:01 +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.168330643926124 (code B ref 62116); Fri, 05 May 2023 17:08:01 +0000 Original-Received: (at 62116) by debbugs.gnu.org; 5 May 2023 17:07:19 +0000 Original-Received: from localhost ([127.0.0.1]:57344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puytr-0006nI-35 for submit@debbugs.gnu.org; Fri, 05 May 2023 13:07:19 -0400 Original-Received: from mail-pl1-f177.google.com ([209.85.214.177]:37314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puyto-0006mz-DI for 62116@debbugs.gnu.org; Fri, 05 May 2023 13:07:17 -0400 Original-Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1aae90f5ebcso605385ad.1 for <62116@debbugs.gnu.org>; Fri, 05 May 2023 10:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683306430; x=1685898430; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Ncyw176dHXXiAXbHcHbJnw66HoYD/SxLwkp9GVPbuiY=; b=NMMHA5LfyfApR4DrZKqkE9+onUROEgQ82w7pWyh1LsK7FlMgdyWLL/XWvY0IA6f2iz nC6+jiGq+eQiRjpI9z0GOxzuooXPIVBB4znxHAZkVm1QYfhKI9lWB5bQotfI/cbsC3W8 Wh7Sb4qDRSc6cWe2k+X2FnwYi7Qw6YYATHNYkATB/fMHusIm8p0K+aHq5/YXp/pt+7GL 6KRVnN0NC3hzdr5Ua/AovLufJ9kdvdEnEHxZatX0EWQRh+Yf1UJVnLmrazASd78Rwd/k dMfFsmJAIcyetEJsKV2+yGw+NUOzKBSS69+K114aUxy6II7NuLBQcIzNIXa18f3hXXee Kbew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683306430; x=1685898430; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ncyw176dHXXiAXbHcHbJnw66HoYD/SxLwkp9GVPbuiY=; b=fUu2fIITjYwkudO2Ttnv1yo+C1Tx/9oKjqzEPp4C9FUJL9+eQ7qf4yghT4P/7WXjID DxHgWX+XxbVia+G0YOsag11DoCSNVOpUXGHYuvLY38Y9zY812iya1OssPD/CmXobwACg H6GrbMmcTruugeiXcSAEpHXRfGV80im7bbJyYijTKDGWlLvJYgzHB0BMEm6twP5KDCcf Ry4ZzCuW1184z/yDzcfM1HnrZLJ55McX2ZmXVp5zsbebgNmrg/aVsqKjc5Zm9Hyevr+X DruemdC/dyxf4onQCZ2ymDw78jS31oawEDfk15N/T3XTvdaMDhfFnbKm/jZ2zaM3XJG8 4L7A== X-Gm-Message-State: AC+VfDxVG9EbVUhQFXUAOGgh/vPmiyURJIF2dMvJvNq8J6kmDAdvi2Lf BUKv+8BJkpr7oBvlQg51uPAJEd6xgtEMruYGmU/7CQ== X-Google-Smtp-Source: ACHHUZ52ne8a9YkcA544Td1cPVSc6GDysyQa8du/1FD70V4SiZX9seCd5tonWihrGYuyXgm7ByMa7X3qnjmbUlTCT4s= X-Received: by 2002:a17:902:d487:b0:1a9:7cbf:a7c1 with SMTP id c7-20020a170902d48700b001a97cbfa7c1mr205944plg.13.1683306430395; Fri, 05 May 2023 10:07:10 -0700 (PDT) In-Reply-To: <87ttwqsow9.fsf@gmail.com> 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:261123 Archived-At: On Fri, 5 May 2023 at 12:48, Jo=C3=A3o T=C3=A1vora w= rote: > Also, can you comment on why you think Alan Donovan's patch has that > non-synchronous find-file mechanism? Since Alan, doesn't reply, what do > you conjecture is the reason his patch goes through this trouble? Hi Joao, sorry for the long radio silence. I've been meaning to return to this but we're in a release crunch lately. 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. > 1. if you think the Emacs frame should be raised and/or focused when a wi= ndow.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. > 2. if browse-url should be used for non-file: urls (it might open a brows= er 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. cheers alan