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: Wed, 24 May 2023 18:13:25 -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> <87ttwpbpaj.fsf@betli.tmit.bme.hu> <875y93arek.fsf@betli.tmit.bme.hu> <87h6sla14k.fsf@betli.tmit.bme.hu> <871qjm5pzk.fsf@gmail.com> <877ctc8rc9.fsf@betli.tmit.bme.hu> <87wn1c4f65.fsf@gmail.com> <87353y91p1.fsf@betli.tmit.bme.hu> 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="16745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sebastian.poeplau@mailbox.org, 62116@debbugs.gnu.org, Felician Nemeth , Dmitry Gutov 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 Thu May 25 00:14:23 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 1q1wkR-0004Ah-Ls for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 May 2023 00:14:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1wk8-0005sA-Up; Wed, 24 May 2023 18:14: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 1q1wk6-0005rf-Ux for bug-gnu-emacs@gnu.org; Wed, 24 May 2023 18:14: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 1q1wk6-00034G-Ne for bug-gnu-emacs@gnu.org; Wed, 24 May 2023 18:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q1wk6-00036X-Bt for bug-gnu-emacs@gnu.org; Wed, 24 May 2023 18:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Donovan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 May 2023 22:14: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.168496642611899 (code B ref 62116); Wed, 24 May 2023 22:14:02 +0000 Original-Received: (at 62116) by debbugs.gnu.org; 24 May 2023 22:13:46 +0000 Original-Received: from localhost ([127.0.0.1]:45394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1wjq-00035r-01 for submit@debbugs.gnu.org; Wed, 24 May 2023 18:13:46 -0400 Original-Received: from mail-pl1-f177.google.com ([209.85.214.177]:37237) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1wjn-00035a-Ga for 62116@debbugs.gnu.org; Wed, 24 May 2023 18:13:45 -0400 Original-Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1ae3f74c98bso25055ad.1 for <62116@debbugs.gnu.org>; Wed, 24 May 2023 15:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684966417; x=1687558417; 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=eW0SY6faYQuYdYnNsY9oLK7e/sqtgy9g6pP6iZissYU=; b=a6IB89wuYJ8OvSZKpMTGMPczUk0WkrOiDG6Q3Qwt3ygq5+7MREguw3OyhNyS+elz1z FuwJALBgWJSj59EOrS5/0kXoixsU2Ko39Rzato/7HNqKISfRz3bMK2HfeVXQ4W0o8lSQ 4xhYW/DqbJoWSR7xPOYflIGiuZTJa5f8NC1wBsNcV2y2vX7ET1csxNZ5Mvt2ePIdkIwT 1VDungEDeNEXwX+VDIBpYJwHdxT/kdcoFXoNUUVQvOVoYLJNcGakSKH2aie19ThVCJo0 MVTKWtdD4deU7Usms+u6jCugHCdFtPRnGjNda2oXg0YOUpDGnqeBU/0j0qEwCosauu6h V+MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684966417; x=1687558417; 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=eW0SY6faYQuYdYnNsY9oLK7e/sqtgy9g6pP6iZissYU=; b=Wnabqqv8JwT0S0bJJHk4L05XP6h3NTNmjay5aA2wvG27kBTkctOCHPtl/TEZu1ECPN CBV6WT/Rbra5fz7WT6U1KdDdQLj79TIJEa1cUXT/BjNRgG9gWLOHnCL5tkvPxG5b+8BK 3PX3PvX0ViolQgULGpYbMTIVUqmgvuM7w4zXKhcRHDc57auHZw5g4FfbGrXc88pAvLWN 6+wP9J+IJ/whSAmPdIm/H1Uyrw0pjfIb5NWwGotIXlPj8GaB12Ct1beCv+QKNJ84CKqD oZP9JmPcVJgfT2ACc3vWauyDRVALRmQn2BGF8FPHnJtk1ohuEgRdvVZT5BbTqALaU4lc u7Gg== X-Gm-Message-State: AC+VfDxGPErJ276iixYyahSyqL3T/vtrt3d+yEYiDcHPTgE7da7BLQ6C OTrSAVyf6yVkeRShtje1eN652Ao4nhpUntqIXMaYDg== X-Google-Smtp-Source: ACHHUZ7AEl/aCO8ZS1vSnPnfDUXlpRXSCqhtSDOqQ7/DqlsSeLdMxNAbVyQXpJ14Cvj7UYGspIzc45zgbzLkPXnETvA= X-Received: by 2002:a17:903:1cf:b0:19c:c5d4:afd2 with SMTP id e15-20020a17090301cf00b0019cc5d4afd2mr11738plh.11.1684966417389; Wed, 24 May 2023 15:13:37 -0700 (PDT) In-Reply-To: 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:262320 Archived-At: Thanks for following through with this change. I just tried the committed version and it works nicely for me. On Tue, 16 May 2023 at 14:32, Jo=C3=A3o T=C3=A1vora = wrote: > > [ Cc'ing Dmitry mostly because of the question in the last paragraph ] > > On Mon, May 15, 2023 at 11:45=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: > > > I'm working on this change to jsonrpc.el. This will solve the Eglot > > showDocument > > problem by allowing the find-file _and_ the return code calculation to = be async. > > Continuing this soliloquy :-) I'm putting this more ambitious change > on the back burner. It's not immediately clear how to implement this > cleanly. The best I can think of is to change jsonrpc.el to allow the > request handler to return a function that is then passed a "success" > and an "error" callbacks. But not only is this not spectacularly clean, > it doesn't really solve the "nested" request problem by itself. > Furthermore there aren't any other clients for these kinds of requests > yet, and there seems to be ongoing work for a future/promises system > which could make this cleaner. > > So for window/showDocument specifically, I went with the much simpler > check of file-readable-p before reporting success (or failure). > > I also addressed Alan's report of a problem with the widening. I > used xref--goto-pos, which I normally wouldn't do, but that > internal function semantics is exactly what was needed here. > Maybe Dmitry can agree to export it? > > Jo=C3=A3o