From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filippo Argiolas Newsgroups: gmane.emacs.bugs Subject: bug#65418: 29.1; Eglot: support clangd inactiveRegions extension Date: Mon, 21 Aug 2023 10:41:46 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30266"; mail-complaints-to="usenet@ciao.gmane.io" To: 65418@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 21 10:58:18 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 1qY0jp-0007fI-DH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Aug 2023 10:58:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qY0jb-0005AS-IP; Mon, 21 Aug 2023 04:58:03 -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 1qY0jY-00059z-1w for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 04:58:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY0jX-0006la-Q0 for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 04:57:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qY0jZ-0006Ou-RE for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 04:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Filippo Argiolas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Aug 2023 08:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65418 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169260822824536 (code B ref -1); Mon, 21 Aug 2023 08:58:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Aug 2023 08:57:08 +0000 Original-Received: from localhost ([127.0.0.1]:55533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY0ih-0006Nf-KD for submit@debbugs.gnu.org; Mon, 21 Aug 2023 04:57:08 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:41684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY0UE-0005wL-P4 for submit@debbugs.gnu.org; Mon, 21 Aug 2023 04:42:12 -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 1qY0U6-0008Mt-S1 for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 04:42:02 -0400 Original-Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY0U4-00036J-HM for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 04:42:02 -0400 Original-Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68a40d85593so423135b3a.2 for ; Mon, 21 Aug 2023 01:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692607318; x=1693212118; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=zHkxHgQx5H/vGOuKqu9m2UFSF3XXOxGbAgKNdyKc7gY=; b=YnTKe9vcWbyCkUDVfryVCr/gJp4RlV1xnNnCqx4PZPIkmG/bBB8DB2jL5AzFeGAdfr QGUQb/Hy72581I6DlCmo0uf2C5+HAf2Y1OivLLFop/eaGrtejBbgEUo+y/Tiq4HymzVq uKOurwD/O3DlpC66vdokipv91rb8Nomtbffr74OC2h16JdGg5S1t6eF2xmr23lLFqVXB BDXRRDv52hwIDmDXSc+6UHAog+XJ80VtKgonMQGAhf33m5mwc8SGxcV545k5zjZXm+Ii 3dAh8fQ12jPU8WUw5Kt2YaRFZkpT7UrqOBOZs9l6gM+qYedGVy/D4ZyLhZKop3Nbv2PT TvbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692607318; x=1693212118; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zHkxHgQx5H/vGOuKqu9m2UFSF3XXOxGbAgKNdyKc7gY=; b=Dk97FQTi/fPvMPCqWW5V38eI8yJQ2WtWzK5YgqCNG4RrKBAfEPpozUmi/xLfCjgkAH p3XDdQRgTSCC1Yatgai8fAlG2rnaw94jyRwGgat9CAnmiQ/5/9L4w4RBHHsf18hFZqh8 5Kv4xecpY4/D3IHj3NUNLN4Mx9bdN1GDUJB8+oSSfhdNOQDBbrayXq00v3jlwZJzTSXD FoQ6l6O4fWpwtdPX2ji6yYQOPIYAJowLk+8n4ePhjutVDUBQ3aqU7Xgqq4HShNQHoFEZ A6ybHWQQMpshTDNq6vCa9rvlg0cy33W9sUOi9lWaU9ySA2JBuG18i5nI2xX49Wan6Ec4 xHVw== X-Gm-Message-State: AOJu0Yyt329AnfoooJw1K4e+DFm/dT8lgOSlS1w8J1h378hUxx6dNUVy NDBnOSSGI2URcW4PM0COPz7J5x/qcTyCThx2WPzGySC5nhI= X-Google-Smtp-Source: AGHT+IENopFqH/pW6yM78RYXIJ2XEoNBrskZ+gHj/tHqrTQ5gOaauklRA6qTteOVdVBGRN3MH/5B1+5cwdFNmb/YIg8= X-Received: by 2002:a05:6a00:22d4:b0:687:60bf:aed9 with SMTP id f20-20020a056a0022d400b0068760bfaed9mr4860000pfj.24.1692607317841; Mon, 21 Aug 2023 01:41:57 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=filippo.argiolas@gmail.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 21 Aug 2023 04:57:05 -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:268072 Archived-At: Hi, I've recently been working in some big C project with ton of ifdefs and inactive code regions. One of the few annoyances (maybe the last) remaining with emacs+eglot is the inability to show these regions as grayed out in a LSP aware way. This was maybe possibile until now with clangd with semantic tokens but they've recently introduced a new protocol extension that should solve this problem in a much easier to implement way. It's been introduced in clangd 17 with the review [1]. It should be pretty straightforward to implement as it's just a server notification that sends inactive regions ranges once enabled. In [2] you can find the pull request that added support for this in vscode clangd extension. I did some experiment on my own but I'm still not able to see the notifications. Probably I'm missing something within eglot code base, my impression was that enabling the inactiveRegions capability would get me some Unknown notification message but I wasn't able to see them. Anyways it would be great if eglot could support this. Not sure UI-wise what would be the best approach, vscode patch reduces the opacity of the inactive regions but rendering them as comment would also be nice at first. 1. https://reviews.llvm.org/D143974 2. https://github.com/clangd/vscode-clangd/pull/193/commits/ef75f637e7f79f94064369368ca665861836e482