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, 12 May 2023 00:12:13 +0100 Message-ID: <87a5ya5upe.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> <87pm7esnl0.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="990"; 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 12 01:11:14 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 1pxFRK-000AcH-FS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 May 2023 01:11:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxFRA-0007dK-B2; Thu, 11 May 2023 19:11: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 1pxFR8-0007dC-Gk for bug-gnu-emacs@gnu.org; Thu, 11 May 2023 19:11: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 1pxFR8-00038w-8S for bug-gnu-emacs@gnu.org; Thu, 11 May 2023 19:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pxFR7-0003KP-Vk for bug-gnu-emacs@gnu.org; Thu, 11 May 2023 19:11:01 -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: Thu, 11 May 2023 23:11: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.168384660812719 (code B ref 62116); Thu, 11 May 2023 23:11:01 +0000 Original-Received: (at 62116) by debbugs.gnu.org; 11 May 2023 23:10:08 +0000 Original-Received: from localhost ([127.0.0.1]:53634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxFQG-0003J5-3w for submit@debbugs.gnu.org; Thu, 11 May 2023 19:10:08 -0400 Original-Received: from mail-wm1-f41.google.com ([209.85.128.41]:59508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxFQE-0003IQ-9e for 62116@debbugs.gnu.org; Thu, 11 May 2023 19:10:06 -0400 Original-Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3f423ac6e2dso40482185e9.2 for <62116@debbugs.gnu.org>; Thu, 11 May 2023 16:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683846600; x=1686438600; 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=CpmY//Is+VR1RIEfBPnwAGDkwlvIn/NTE59yZnMzZKo=; b=WcNFRI4WFQwZRa7VSBVXVCMpig2sqZ/nQ1Ud4dvMrojTVSqrFhDpE/yrcv9QupH9Bi HNujY02oSlBpcok9a6v0SDcsctXG4TOysYxMj/a2/Dt8KdBjrGbOy/vcHM25/VvYpkoN mXtqmQdyBiNGzNWCI/1n3V7J1cBkeYUMTDj7geDOtl9Q46ghNUJI5e11mm2y/Uhdrtzx z9DyXx6EAHw8xO/88GLOmLoYvGAeV5I3CglkNBp1ZzL3PsaMRVvnYOCPZVqjWl6iygqn CSR/oONixQ7md+Xe6zTEhqrZ/U2B/NdjPPg+0Qn8p89f54kzbeOpkoW85TPb92gKuFwm s0bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683846600; x=1686438600; 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=CpmY//Is+VR1RIEfBPnwAGDkwlvIn/NTE59yZnMzZKo=; b=Ac3Y4Bf8F8rdxiy8FDE0H48qpSawLjAN7k2jWrXW9K79S1w352YowoS+Nu5WUwa0MO dLiEKZI2yLTPgGp49rSi16AYJTeaxNzd/uVeY+pVMi0e2Sd+SVry9w2kvghCSg9fVyot fDtVEjJfElbzy9amqdpIZYwRikwG1FtbxF3ALCdayVmKp0iSukiY0LmouBoGI66Yy0Sv jGWCFLBefEqE4qAstaSdCMIfH/+kTXxOsOX7LE/+U/rQPGMymBQXxXBv8fPERRsYRcU4 GDeYDkvYfYv/+Xm2XAj0n5Ee9SfJL+NBnb3m3b9kbg788UFjCmEJUuPzMIdZk8bX4Brx NRJA== X-Gm-Message-State: AC+VfDy+2ui+w73b2aDddUYkBXiWbJmlInb/NY5IaFPVq0p9RqvYBdv+ i9DlRfY+LFlzTdRMIkUuztE= X-Google-Smtp-Source: ACHHUZ5WpniNuSeh5f0YzfFdJU9gMsKyDpIjQm+eKNwa+OCvbLT+bNBsITID8xwNX20LiEIcZVp8cg== X-Received: by 2002:adf:de03:0:b0:2f5:7ce1:781d with SMTP id b3-20020adfde03000000b002f57ce1781dmr14486742wrm.50.1683846600480; Thu, 11 May 2023 16:10:00 -0700 (PDT) Original-Received: from krug (87-196-72-49.net.novis.pt. [87.196.72.49]) by smtp.gmail.com with ESMTPSA id u1-20020a5d4681000000b003062f894b64sm21995701wrq.22.2023.05.11.16.09.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 16:09:59 -0700 (PDT) In-Reply-To: (Alan Donovan's message of "Fri, 5 May 2023 13:35:49 -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:261596 Archived-At: Alan Donovan writes: > On Fri, 5 May 2023 at 13:17, Jo=C3=A3o T=C3=A1vora = wrote: >> Yes, but I don't really think this is a design problem with gopls. Or >> at least I don't think 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 -= - that >> 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? > > Sure. You can reproduce the experimental setup like so: Hi Alan, I've now reproduced your setup more or less (though I had to C-u M-x eglot and point it to ~/.golang/bin/gopls instead). Instead of your original patch for window/showDocument, I used Felici=C3=A1= ns simpler alternative, and as I predicted, I didn't run into any hangs. When clicking links of the ephemeral web server spun by gopls, it predictably sends a window/showMessage request to Eglot like for example here. (:jsonrpc "2.0" :method "window/showDocument" :params (:uri "file:///home/capitaomorte/Source/Go/tools/go/analysis/va= lidate.go" :takeFocus t :selection (:start (:line 21 :character 5) :end (:line 21 :character 5))) :id 15) This causes Eglot to visit validate.go and shortly after a notification is sent Eglot -> gopls (:jsonrpc "2.0" :method "textDocument/didOpen" :params (:textDocument So there must be something more happening in your Emacs setup. If some kind of asynchronous behaviour is required, this recipe doesn't demonstrate it. I invite you to fine-tune your recipe and to start Emacs the -Q flag so that we can rule out interference from other packages or bits of configuration. In the meantime, I think we should go ahead with Felici=C3=A1ns patch. We can always adjust it later. Jo=C3=A3o PS: I did find a bug in Eglot, I think when trying your experiment, but it is unrelated to the matter at hand.