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: Tue, 22 Aug 2023 13:02:47 +0200 Message-ID: References: <87edjw6wtz.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="27723"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65418@debbugs.gnu.org, Philip Kaludercic , Felician Nemeth 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 Tue Aug 22 17:25:11 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 1qYTFl-0006tJ-NU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Aug 2023 17:25:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYTFc-0005F4-FJ; Tue, 22 Aug 2023 11:25:00 -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 1qYTFb-0005B6-Er for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 11:24:59 -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 1qYTFb-0003ze-6J for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 11:24:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYTFd-0002ci-WD for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 11:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Filippo Argiolas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Aug 2023 15:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65418 X-GNU-PR-Package: emacs Original-Received: via spool by 65418-submit@debbugs.gnu.org id=B65418.169271788210053 (code B ref 65418); Tue, 22 Aug 2023 15:25:01 +0000 Original-Received: (at 65418) by debbugs.gnu.org; 22 Aug 2023 15:24:42 +0000 Original-Received: from localhost ([127.0.0.1]:60194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYTFJ-0002c5-LF for submit@debbugs.gnu.org; Tue, 22 Aug 2023 11:24:42 -0400 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:56323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYPAC-0000jb-Lc for 65418@debbugs.gnu.org; Tue, 22 Aug 2023 07:03:09 -0400 Original-Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-26814e27a9eso2352788a91.0 for <65418@debbugs.gnu.org>; Tue, 22 Aug 2023 04:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692702179; x=1693306979; 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=Cls0gmyBtMI1ookt/VnO0yP+GARVrvX8SfETDgmq/sU=; b=lBxxcdN6hw4zNXFUW5QVy171pdrOCCeR8kuHAH2kbNicHcvjaax6RARxjHWSU6UMp4 8VX7snTGW+twie/EuEbVneQE/4JgXEP0cgTOWd84eo1omp6hzu898pskzzS+F568zEPH atX6L1bRNau7+8eta0noPznkEkj/ka+Kwsq62fPWDIP+7SEFwvMIzG/eYKT2y6vroa9/ G4bxTK++iy+ZcesuauUK48f0N1AjnWo1RIabNZ8OxkQQOWlfmtbVML/7XIs7MFbwJzRp DY3tz0ccgNsm56E/XNkEg/hy/J2T+ILbI9nIJ5v/HkFl5w9qBKjzlG11F0wXcn6VFutU 3zgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692702179; x=1693306979; 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=Cls0gmyBtMI1ookt/VnO0yP+GARVrvX8SfETDgmq/sU=; b=G2h//jRtufDsWKTM2K9Q5cPb0OFP/86SkiBQKbya1RP2GhKZcARfr//a1fQd7dbmzk BlYlPDfQQ+ixh5+IAAE3uAEPYjBya9HgQmQ9S4YWBb7Qui+NB+DfshLJQULlaAOX58CP UkC7eAMVHJOxUkYLBjNPdobplU55LHx+OOfecIvwhwA1ExJM9r+g2DFcBNqmzSi7PXFw YMxPUMWWvjsFJoQYG8ihU/a5EPkFq9mPED+hwQOqPeFLadlnF7FZoSc76flwBUS7UgIb zUdZRRjBga6LhpC7LjGr6EsZSO2AeFpnjKVTx1rs+O5g9vbAh0KtMVUgMDniQmsH7vmQ 1oog== X-Gm-Message-State: AOJu0YzQwH+CJm/QxsESRalNaAQxeCGyNnxMaWhxmFKkoPqqr6zM8jiT r8RFqTcpZ+WXTlBSrBnJMW54uH5aILDBaFTPgRU= X-Google-Smtp-Source: AGHT+IHwrMcrGo+hHi9+iN4TuLk1aSXryqEHwstrICUPU5Vp/+/foUAFLS4heHdgT34zQcaHCwrC37ZkibXqO8GscmQ= X-Received: by 2002:a17:90a:854c:b0:26d:1201:a8c4 with SMTP id a12-20020a17090a854c00b0026d1201a8c4mr6650799pjw.13.1692702179445; Tue, 22 Aug 2023 04:02:59 -0700 (PDT) In-Reply-To: X-Mailman-Approved-At: Tue, 22 Aug 2023 11:24:40 -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:268178 Archived-At: On Tue, Aug 22, 2023 at 10:56=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: > I'm more worried that this isn't even out yet. Afaik Filippo you compiled= a Clangd 17 with a patch, right? I have done that in the past, but it's no= t very practical every time, so either we wait for this to stabilize or you= have to tell me where to grab the patched Clangd and llvm toolchain somewh= ere. It's much easier than that! They release unstable git snapshots in github. You can find them at https://github.com/clangd/clangd/releases Clangd is released as a static binary you can just copy in your path (e.g. in ~/.local/bin). From what I can tell you don't need to upgrade the whole toolchain, the binary runs fine on its own. Latest one for linux is at https://github.com/clangd/clangd/releases/download/snapshot_202= 30820/clangd-linux-snapshot_20230820.zip It would be great if you could test it and see if you can get server notifications for inactiveRegions. I think the interface should be already stable, reading the review the only thing that is probably going to change at some point is dropping the support to generate semantic tokens for inactive regions as comments, which they are keeping for backwards compatibility. >> Also this IMHO would solve quite an important problem with C >> development, not sure if it's worth waiting while we could solve it >> now with the extension and move to the standard protocol if and once >> the LSP spec will support this. > > I'm also personally interested in this feature. But how likely is it that= this makes it into the LSP standard, in your opinion? Honestly I don't know :-) Only information I could find is this vscode issue https://github.com/microsoft/vscode/issues/123352 where they seemed to agree it's not something that belongs in semantic tokens but then the discussion stalled. > FWIW, other languages have similar features. Common Lisp has read-time co= nditionals for example, which are similar if not identical in function (and= obviously not as rotten as C macros). > > By the way, if you didn't know this silly trick, if you're in a #ifdef we= b, a half-decent way to know whether a given point is active is to try and = find a definition inside it or type some syntactically correct code. If Egl= ot jumps to target or highlights variable names, the region is active, else= it probably isn't. Thanks! that's actually a great way to see if the highlighted code is active! Still greying it out or dimming the colors would be great to see at a glance if a region is dead, especially for big regions. It's also one of those few features that Emacs still misses when compared to vscode. Filippo