From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: [NonGNU ELPA] new package: clangd-inactive-regions Date: Mon, 04 Nov 2024 12:02:14 +0000 Message-ID: <87msifmcl5.fsf@posteo.net> References: 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="40271"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, Stefan Kangas , emacs-devel@gnu.org, eliz@gnu.org To: Filippo Argiolas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 04 13:02:54 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t7vnJ-000AFL-Ly for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Nov 2024 13:02:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7vmu-0007Vh-IM; Mon, 04 Nov 2024 07:02:28 -0500 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 1t7vmq-0007VE-9O for emacs-devel@gnu.org; Mon, 04 Nov 2024 07:02:26 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7vmn-0004FS-2u for emacs-devel@gnu.org; Mon, 04 Nov 2024 07:02:23 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AB456240027 for ; Mon, 4 Nov 2024 13:02:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1730721737; bh=6oKBgIXL6KHZo0+n4exU+BR6KdeKKElDdt/txxAYKiA=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=Z6oTthFKjHqCHYvL4xt/v/bNDL2N3cbP87E2G7ugnhJ0sXmomWAjcW2mY+cKoflDq v6LTiZGjb4TTAc778L3k/0Z5DyN/Scy6FCFh8BJ/ydB32jIW4QjXAWnNew7tYus5Sk 9+tEwF7BDYMV2kiF7GIVs8sB8ZW3xBOIOn+EK/jipgO1NjS0PlF2vKlXA+WtnSFdaI va+9dUsz8XxyAZFYYlvZpErh0/C0EYoOrHXUOQt82TwwGQJVH3Z35p34iuMBcnN7z5 tU50tsLdrCT9EY3LFH/xrR4oFK4YAhyR4MgZDxLkErrHJmt4rVYXTrce7H5a8Rx8sW 9w/LDeDVFD7SA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XhqpJ4vS3z6tvn; Mon, 4 Nov 2024 13:02:16 +0100 (CET) In-Reply-To: (Filippo Argiolas's message of "Mon, 4 Nov 2024 08:17:13 +0100") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325091 Archived-At: Filippo Argiolas writes: > On Mon, Nov 4, 2024 at 6:34=E2=80=AFAM Richard Stallman wro= te: >> > > It's an eglot extension that listens to clangd inactiveRegions >> > > notifications and shades inactive code accordingly. It's useful to >> > > highlight disabled code sections in a LSP aware way, honoring curr= ent >> > > building options and defines. >> >> Does "inactive region" mean unreachable code? I am guessin so. >> >> Is there a standard way for lamguage servers to report unreachable code? >> Could we make Emacs recognize that way? Then eglot could handle it >> for any language, and it would not be specific to clangd. > > In this context it means unreachable code as disabled by the > preprocessor stage, e.g. code under a currently disabled ifdef branch. > LSP advantage here is providing knowledge about how a file is compiled > with proper build time flags and defines for current build > configuration. > > At the moment it's a clangd specific extension, there was some plan[1] > for standard LSP inclusion but I'm not sure it went anywhere. > Also, does this specific meaning make sense for non c/c++/preprocessed > languages? It might not be a bad idea to anticipate future standardisations, or other LSP servers supporting similar functionality, and branding the package as eglot-inactive-regions instead of the more specific clangd-inactive-regions (which also doesn't hint that it is eglot specific). > I believe unreachable in the control flow/static analysis sense can > already be achieved with normal LSP diagnostics. If I am not mistaken > clangd already provides diagnostics for this when clang-tidy is > enabled. > > > 1. https://github.com/clangd/clangd/issues/132#issuecomment-1722327517 > > --=20 Philip Kaludercic on siskin