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: Sun, 14 May 2023 20:19:25 +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="706"; 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 Sun May 14 21:18:24 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 1pyHEe-000AeM-83 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 May 2023 21:18:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyHEK-0005jb-W6; Sun, 14 May 2023 15:18: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 1pyHEI-0005jS-6U for bug-gnu-emacs@gnu.org; Sun, 14 May 2023 15:18: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 1pyHEH-0005eV-V0 for bug-gnu-emacs@gnu.org; Sun, 14 May 2023 15:18:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pyHEH-0004Yl-PM for bug-gnu-emacs@gnu.org; Sun, 14 May 2023 15:18: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: Sun, 14 May 2023 19:18: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.168409184717479 (code B ref 62116); Sun, 14 May 2023 19:18:01 +0000 Original-Received: (at 62116) by debbugs.gnu.org; 14 May 2023 19:17:27 +0000 Original-Received: from localhost ([127.0.0.1]:41591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyHDi-0004Xr-JL for submit@debbugs.gnu.org; Sun, 14 May 2023 15:17:26 -0400 Original-Received: from mail-oo1-f46.google.com ([209.85.161.46]:44114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyHDh-0004Xc-3D for 62116@debbugs.gnu.org; Sun, 14 May 2023 15:17:25 -0400 Original-Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-54fb7dc3456so3192195eaf.0 for <62116@debbugs.gnu.org>; Sun, 14 May 2023 12:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684091839; x=1686683839; 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=WkR4vOLCJvPf1SMB6qIKMpei33/Qx4PNxalFhDaEjGE=; b=eGWt2PZKIt9Mg+Fx4yvULXfVppOBSiKLUKbQG93GKqkExydy1BkX7Xnm+00c9mCa96 r4jx53OpRo4NmIwEubG8qMwwO9Ns3BS06HK8H3b1rek+/LEzL43wcMdInb3EN1hG/SzN /nlUCWr86Hhlo2tMGUe8wjaY2k8vZEEUFtEBT1TXfYlCjzBTX+xXM3KnJWS/niEscnSW n1ZGMxi2rlD2SzE5dJNfVLrlS3BuFfxYHd6evnQDj7n+I2Df6mUXTkfSycyc61bqCmCk 4kgSCS/bLwdW4Go0eGavEfUt8VwnqhW1o8EWpmUqZrxxFeKkSbPgWkx/UGZjWXqOOFNJ XC7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684091839; x=1686683839; 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=WkR4vOLCJvPf1SMB6qIKMpei33/Qx4PNxalFhDaEjGE=; b=NIffV9J5l8JgC3telzvJ8R2/c/QPBiG4QreiI5FIV4CianGmQqn/UYZaNP9dVK+cbZ 5pSeF4QtSNpmqvasFuB7QdyqiRQ2bjwdQSZft25bbgVuzVjwUC8t9eXc0tusbH+6Zf0Q nQ02lUAjIb7FRsg7onORHNxh5Nk33WJnX3uM3Sj4MVS0RcTUylU15gEwIzllxM7xjhcl uMPthai8yn8Msg6MwHUW1VJYGHfXhMyd+MXecpXSx7YqlmrfaImhsuMMiycgRIm6NPUS Zhba94GB0NX7j1HxcbrGrnwvc0oVn7S1C+2ul+b3MEfbBLGTaG2D+N2U2Ek+EL413iqA eQow== X-Gm-Message-State: AC+VfDx7b+XBIMQsYsb+z0wYr5wZmWacDauMYYWhuh9NubivSZpOrvAr CDFIqpx78MCEYJm93nc5Qk5V73oJS3MgcYXgdzk= X-Google-Smtp-Source: ACHHUZ7Ny5L0pDh4/rjYR/wxWvB1oa31aIduKmsUrhdnQBDlQmrQwMY8nxZjMcR/tt2Wy1RnOy3vkYPPrMA6dfulzSQ= X-Received: by 2002:a05:6808:10d1:b0:396:cd:82b1 with SMTP id s17-20020a05680810d100b0039600cd82b1mr1368477ois.2.1684091839511; Sun, 14 May 2023 12:17:19 -0700 (PDT) In-Reply-To: <87353y91p1.fsf@betli.tmit.bme.hu> 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:261720 Archived-At: On Sun, May 14, 2023 at 8:02=E2=80=AFPM Felician Nemeth wrote: > > >> Even when takeFous is nil, shouldn't we still at least raise the frame= ? > >> Otherwise Emacs might not show the document. > > > > I don't understand. Can you show this problem. , I think display-buffe= r > > ensures the buffer is displayed. It doesn't guarantee that it is > > visible in the context of the windowing system, but that's another > > matter. > > I was worried about the case when there are two frames: frame A is in > focus, and frame B is minimized but contains the target buffer. But > you're right. display-buffer does raise frame B and keeps the focus in > frame A. I hadn't thought of this, but good to know that display-buffer handles it. > > I pushed a version with the above adjustments to master, as we're > > converging anyway and it's easier than trading patches. > > The pushed version is good, but there is one minor problematic detail. > It returns "success" even before it tries to find-file the requested > 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 may bring -- which AFAICT are only speculations about imenu/which-func at this 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. Maybe eglot-request could error out (or warn and return nil) when it detects it's running in the mode hook. FWIW my new breadcrumb.el extension= , which also uses imenu, _can_ be put in the mode hook because it calls the imenu-building, request-generating function asynchronously. So it isn't a problem there. I wonder if Alan could inform us about the contents of his go-mode-hook, to check if which-function-mode lives there. That would dispel the speculation. Jo=C3=A3o