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.devel Subject: Re: [NonGNU ELPA] new package: clangd-inactive-regions Date: Mon, 4 Nov 2024 08:17:13 +0100 Message-ID: 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="17211"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , emacs-devel@gnu.org, eliz@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 04 08:18:31 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 1t7rM7-0004Es-67 for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Nov 2024 08:18:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7rLC-00026q-FJ; Mon, 04 Nov 2024 02:17:34 -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 1t7rLA-00025v-3Z for emacs-devel@gnu.org; Mon, 04 Nov 2024 02:17:32 -0500 Original-Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7rL5-0004nS-Un; Mon, 04 Nov 2024 02:17:30 -0500 Original-Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-20e6981ca77so40073195ad.2; Sun, 03 Nov 2024 23:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730704645; x=1731309445; darn=gnu.org; 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=t8vfDiEHJF6EN1/rPcBdnvNXOyQ9QjyUIK/TVX3gJwc=; b=eq8aU8VsX00OvmGl+sR7vNSxku9iBAIiNHlRc8nVJxt9jYqoWS1x2O5oBwH97l1WsA tU7zn9IY/Wt/LNTF0XduKgmhAwFEjA5Jl+XQze7FE8o/YweH0tbTw3h1Dg4uX/uIBTKW tHjs1PKesvsIdX+dZMoR5FhuDl/AD9x9WaqqjO9pUpNbI41xYURoADIX618hiAe+Ks+f FBQX78jGBsCf6IddjiWsCnpNoYq2gKDlj03qil5sr8tDBFLvZnzjM+CIHvUu5NCzEt/o 8v1qv5+EpeT/TxgSdDHKG1JDpVjRU5QOIspMlaU89i/viYUDs9riw1RMVibLQh0d9I/c b2wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730704645; x=1731309445; 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=t8vfDiEHJF6EN1/rPcBdnvNXOyQ9QjyUIK/TVX3gJwc=; b=c3dxU4TqOz7MscO0kffzRnv0Ko3BofMDjHSvZIkVkYR+vvWCJIrbDMi0DMG5a/eAxn 5JKbJy+MHnuX1AH/woyLVEULiZXLx/7BLQjretFUx8iePc9LJeV1RB846x6aCGlLBpSW ndD9uFTwB+lbFc5ec/PVBPEI8UuP9h/W9oO2A+tkJf4sEBQZANCxSz5q9C8aCWUzCBLM SdY83k75fZR3wiPUip+KukorPc1J1EXhsiM/nsulDBXeYmdXs5yPq0xM/1NVlNa/K2+9 SGsIU1/DvzRL5qNfCV2ALhT9bG5AYMmqkHBqRAw6uBL7i3hb9Q/QukbKm3ib5DI0Ld7B Y14g== X-Forwarded-Encrypted: i=1; AJvYcCUYU2HG8N0Njr2nooLBO1UJ7Ot7rXTYakHINEyRohhdJ4yPomuTn4uBH5N7z7gaOA87S9vkEglqksYt/80=@gnu.org, AJvYcCUgJb5+94G7sl1YySrT1HhJ8RG3Xr7oFg7N/Txr5IOvqIoG6dcnpGNwFFD4TtDOzVHT9Bs/@gnu.org X-Gm-Message-State: AOJu0YzEqPKDKR2yd/0BUR8sPx7srWcSMgviJ5phVtPoMlIEKofb2eHH v1JuevColz9ZEKYr2ZEpEi19n/SEls5HH5zbUTiSl8owYyKxDVw5lq2xJ17PFcUsHyf0OPuej2l MaWUfT+i0lLn6NjWzKLcfIKZaDwx1KaIT X-Google-Smtp-Source: AGHT+IGZt75xWZTwmzkXfQy9VUsj33X+ViB83hZsb6pw8MHpdHP7ySV/gblqBAltkdI98dYOSSw0ATaMmAZgMlGMgsU= X-Received: by 2002:a17:90b:4c8b:b0:2d3:d063:bdb6 with SMTP id 98e67ed59e1d1-2e93c15c26dmr20424213a91.4.1730704644802; Sun, 03 Nov 2024 23:17:24 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=filippo.argiolas@gmail.com; helo=mail-pl1-x62d.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-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:325079 Archived-At: On Mon, Nov 4, 2024 at 6:34=E2=80=AFAM Richard Stallman wrote= : > > > 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 curre= nt > > > 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? 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