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: Tue, 16 May 2023 19:34:18 +0100 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> 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="1099"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sebastian.poeplau@mailbox.org, adonovan@google.com, 62116@debbugs.gnu.org To: Felician Nemeth , Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 16 20:33:16 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 1pyzU3-00009N-Ur for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 May 2023 20:33:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyzTu-00039G-0t; Tue, 16 May 2023 14:33:06 -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 1pyzTr-00038w-JM for bug-gnu-emacs@gnu.org; Tue, 16 May 2023 14:33:03 -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 1pyzTq-0003kO-TT for bug-gnu-emacs@gnu.org; Tue, 16 May 2023 14:33:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pyzTq-0004LB-Gm for bug-gnu-emacs@gnu.org; Tue, 16 May 2023 14:33: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: Tue, 16 May 2023 18:33: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.168426194616633 (code B ref 62116); Tue, 16 May 2023 18:33:02 +0000 Original-Received: (at 62116) by debbugs.gnu.org; 16 May 2023 18:32:26 +0000 Original-Received: from localhost ([127.0.0.1]:48046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyzTG-0004KD-0K for submit@debbugs.gnu.org; Tue, 16 May 2023 14:32:26 -0400 Original-Received: from mail-oo1-f53.google.com ([209.85.161.53]:55762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyzT7-0004Jp-5D for 62116@debbugs.gnu.org; Tue, 16 May 2023 14:32:24 -0400 Original-Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-54f846d24d1so3138787eaf.3 for <62116@debbugs.gnu.org>; Tue, 16 May 2023 11:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684261931; x=1686853931; 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=VvGHNH4cos/i50kPPWZvKaXFiY6NlRg+rjuRoiyqZGo=; b=EfzFKA89joMnl3nCzGZiXrY/A574PYV46ovPP5Lr6PIhqJwS4cGI2m6HaG3VVQx76f R6JK52H4zeqGacNo0CwjX1YZsBa7ODm0ObmyeijETM+7GSDJHpYyZBVNIx2KVm8W8yCp wjvhWgVE/CEmXqSkTvqvO6Sm30Z8Hl4pBgSlMY6XhnH2v4omhjdJehAJNlfjtWDXGtx2 /Okz32VK9qedpvb5n4WrdC/4XpcJQwO3PJipDClDthnDJJnDSCfDvrApBCIEG7N0OHC1 gSqTQNVJPdNPhl8eY1VrFfQCCHkVnAKsCJwqZDCQOOLcFaKWa+Ic/mH1xMIJI9n8oFxa 5eJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684261931; x=1686853931; 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=VvGHNH4cos/i50kPPWZvKaXFiY6NlRg+rjuRoiyqZGo=; b=TFPNklYKEKW2t8kFxinIV4V47wXS8WBD29Df5cDA9fWc1cM7i4NDedi3LPSyhBu+7Y rhG7wBlNRYwsmnjbm5YMq1LSia/bZtRgyHZtID5bJ3DAdzRpzPi1VqY2GJbstSbixjLc Dp2S7DPNj6JmQ83Q/R/1j9fgR05JUh55OZIJKvCfywCrvCAKliGgtMAIgTBF1j6jGSfs gNYnM3mXTbTikYlAjomiUanr40oh6NFqedxLdU945WtU2GnUMfFU/lo+6n9alWBRD57E 9fSsASkNTfU9XF6QIGNUv9yQ0aVu4kqjYw4j9AKpGYrTc/MdghuOUXV+4+HbGqtKzXyR 6Vow== X-Gm-Message-State: AC+VfDx53A5JZitXkd260d35oDP2tgg4xCWk/G2ijErXctHwT9pkanbN LXc9Op5fhPB8tmliewlNXl8T4ZfWyE84bxxlswc= X-Google-Smtp-Source: ACHHUZ7JkNhshpL0mytlW7saezvq4XXlaZZ0DwYBj+rp70gY+FdXSYqugMt5LiU+bb9xx5KIPwDvf5An8T0U/h06TIQ= X-Received: by 2002:a05:6808:14d6:b0:396:63a:a704 with SMTP id f22-20020a05680814d600b00396063aa704mr4686846oiw.56.1684261931230; Tue, 16 May 2023 11:32:11 -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:261807 Archived-At: [ 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