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: Mon, 15 May 2023 11:45:37 +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="18944"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sebastian.poeplau@mailbox.org, adonovan@google.com, 62116@debbugs.gnu.org To: Felician Nemeth Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 15 12:44:17 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 1pyVgf-0004ne-29 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 May 2023 12:44:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyVgT-0006E4-Lk; Mon, 15 May 2023 06:44:05 -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 1pyVgR-0006Du-9p for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 06:44:04 -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 1pyVgQ-0001RP-VV for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 06:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pyVgQ-0000GY-G7 for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 06:44: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: Mon, 15 May 2023 10:44: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.1684147418984 (code B ref 62116); Mon, 15 May 2023 10:44:02 +0000 Original-Received: (at 62116) by debbugs.gnu.org; 15 May 2023 10:43:38 +0000 Original-Received: from localhost ([127.0.0.1]:42849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyVg1-0000Fo-J6 for submit@debbugs.gnu.org; Mon, 15 May 2023 06:43:37 -0400 Original-Received: from mail-ot1-f53.google.com ([209.85.210.53]:61679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyVg0-0000Fb-2V for 62116@debbugs.gnu.org; Mon, 15 May 2023 06:43:36 -0400 Original-Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6aaf52ff35bso8815991a34.2 for <62116@debbugs.gnu.org>; Mon, 15 May 2023 03:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684147410; x=1686739410; 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=B/x3znmmYJlIfQOtEXi8oCckFTW8GuC+u01ToOpJzAA=; b=YUB+EYPpMmjq0XFRCQBVWdAuXPr0WVboBQHJkXpEoFHymcmGIhBNHeGBa/JXrV+q5S 0en35crIRXszfXzNJO+ut5c0HRcq5B1krSTRUo+AzRkrKRjJe3EVxEU6yB/nMEx5Nabq M9UWOqLH6q4vPE9W+5LUZIBUHMYlv+ezMcNVZMEgDoKnLbOecgjWt6LvSUo+mFk1V5QI AcDhpR2KorOZdoRItA6XEmNl1q5+cDoFxXiWeaSNjtvnDX/uMfBDzmcL7laSd//HiBoo YmVy63cEuVP0pEnKFdcnCFKGpYqnBK/5gIzRkUPxYjho7sItcxKCY2BWm47DUOGKH2Be Qn0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684147410; x=1686739410; 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=B/x3znmmYJlIfQOtEXi8oCckFTW8GuC+u01ToOpJzAA=; b=lc7VCCA/eBLZc6UzJtQIK0GJbrMwPo4xDC+sxutByvfh6OOSRLHznWRE5nONmjNhSZ TNNIynFa+gmwx2Bfp6lwge1dfP3j9afEyG0lSjHHm9UZJpD8ceVhwbnNFO8/4b67J+Cy xhjGvJfkmuxJvDwHCql67qQJRuyw0eioqDmLVoJGuGuFrHYgz5sZu3F8H136UrRr3vn6 FQi6maGMceYa7BV0/bbF2OKZ9NTU3f7yPvUI08vm6d04dajmjShY/OTXcvJjYyl6WWil yvD2W7dGKPKa5hYDu+7a/hmeaGfIS9c4XxqOpMHYOjDZg7L7KfoE6n2PudaDWaJh6jhm Q0qw== X-Gm-Message-State: AC+VfDzMw4K0486h7j4wpGwBNxmmjHTuaQujVRRvW5aPAtXJjKIAgTzr DV6wQ0lpRHOhPkJ5f1wGy98Zuq2VsjOVsIRfpi0= X-Google-Smtp-Source: ACHHUZ6xu+C0/mKsGxvJobup3YUvHgsXryrR+Up5mviewKVqSmXty+Qylk2uOKXaeD1XbITt3ty01pI8zFB7dKYpWYg= X-Received: by 2002:a05:6808:2907:b0:392:6e33:28eb with SMTP id ev7-20020a056808290700b003926e3328ebmr9800069oib.13.1684147410364; Mon, 15 May 2023 03:43:30 -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:261734 Archived-At: On Sun, May 14, 2023 at 8:19=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: > > URI. So if it cannot open the file, because the user does not have the > > required permissions, it is too late to send an error to the server. > > Oof, you're right. That's why I didn't want the async version. Hmm, so > either we go back to the sync version (and solve the problems that that m= ay > bring -- which AFAICT are only speculations about imenu/which-func at thi= s > point) or we do some file-readable-p checking. > > Though the latter isn't horrible, ideally we would just proclaim that > putting request-generating hooks into the major-mode hook isn't allowed. > Because it's a bad idea anyway, since a mode hook is supposed to be cheap= . Scratch that. It's true that it's a bad idea in this particular case, but my proposal is far from "ideal". The right thing to do is to extend jsonrp= c.el so that it allows asynchronous request dispatchers. Not only would this so= lve the "needs to run in separate stack frame problem" but it would solve futur= e problems where Elisp JSONRPC endpoints need to contact other potentially slow endpoints. 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 a= sync. Jo=C3=A3o