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: Sun, 27 Aug 2023 12:52:58 +0200 Message-ID: References: <87edjw6wtz.fsf@betli.tmit.bme.hu> <87zg2fnwm0.fsf@gmail.com> 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="4197"; 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 Sun Aug 27 16:55:41 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 1qaHAz-0000wh-CC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Aug 2023 16:55:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaHAI-0002Pv-EQ; Sun, 27 Aug 2023 10:54:58 -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 1qaHAH-0002Pf-5D for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 10:54:57 -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 1qaHAG-0002LP-TS for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 10:54:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qaHAM-0005at-Bo for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 10:55: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: Sun, 27 Aug 2023 14:55:02 +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.169314808621477 (code B ref 65418); Sun, 27 Aug 2023 14:55:02 +0000 Original-Received: (at 65418) by debbugs.gnu.org; 27 Aug 2023 14:54:46 +0000 Original-Received: from localhost ([127.0.0.1]:45953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaHA5-0005aL-RG for submit@debbugs.gnu.org; Sun, 27 Aug 2023 10:54:46 -0400 Original-Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]:60793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaDOT-0007hk-KF for 65418@debbugs.gnu.org; Sun, 27 Aug 2023 06:53:22 -0400 Original-Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5734b893a11so1273003eaf.1 for <65418@debbugs.gnu.org>; Sun, 27 Aug 2023 03:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693133590; x=1693738390; 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=b+o1Iz8JKZbTAb3aRi6yBccN6sWc9CsEp93LZvt7uzA=; b=WrdorQUKGvP82kyk5AXrmOBCOJbPG3sMmi7lwZfxSj4BVkx0t6sM3Lgyt8hMtuwq9t ddmGLddwtZod6eZhT+rBw8fWNtsdqvYbQBbyKLg2AT/I2xX60rHlJEMs1HVxDeghCFsB 3ucdORDq4MWkAZhXL7Zsd+AkyxLg+rSy89a1e4qqwKbUYl37vhqPJ+qlo0HdqLPTSvQ1 2Lu6WIaYGm4PDWnFrX9VlufBZNyrDzkdthIUYulMXOhz53I+O0EJ/eBmGucduBj+J62O 7blfpZaIP9ymenfLNc7TG1reuGYY/hRQHbRZ39y2GA5UPCXhVmHrZo31iYLZ7LvQf+oo s5ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693133590; x=1693738390; 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=b+o1Iz8JKZbTAb3aRi6yBccN6sWc9CsEp93LZvt7uzA=; b=JPlVR4mUV8S7EYbWGXCDWfaqA4iB9arSf8l4rzgPu1QQ3m9HaEdYkEGAgyBWAeX9mi +zIaAXYBNLDVkGYTDmK/u8Y08eq6pGI2AidXkIDLcM5xMFwkk8li1QXOnLq0kQ39QSkG iKE758oMRFhOFySpe0icH3ogFcZ2RoTWPuup8FDvfbF+TiRpvkEqRQBpHnkaqK5SvGBp ZMJmns1qu53G+bX3CI/BdNWshnlfKoTfJbW9Sg5M5RXRnOcBzKx7OJNXVjmd7VS5FHBz 3awV2GYNsu8JmbVW20Vs+bTQbsBZsykBj4adVcooVQDkwNke77V9ZcPxKnTBfG5Dt9Jv xc4Q== X-Gm-Message-State: AOJu0Yyj6RX/sgtMMoovTYdHiuGSqGKEwmjxBwCKAU6ne+obDdLnfGjQ g1Fdte2KKqXeumv4R897xD29GgiloPER2ZKU1Fc= X-Google-Smtp-Source: AGHT+IFUmmLf81XW+0v/PIBWIgf/w876vPads/HiyjhrNHxjunDXgCtA0VL7OiFm16kFVbgbhAhrywxkC/s/XCjErhA= X-Received: by 2002:a05:6358:2909:b0:135:499a:382b with SMTP id y9-20020a056358290900b00135499a382bmr27241785rwb.7.1693133589936; Sun, 27 Aug 2023 03:53:09 -0700 (PDT) In-Reply-To: <87zg2fnwm0.fsf@gmail.com> X-Mailman-Approved-At: Sun, 27 Aug 2023 10:54:44 -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:268558 Archived-At: On Fri, Aug 25, 2023 at 2:16=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: > > Filippo Argiolas writes: > > OK, after fetching that git snapshot today, I've done this: > > It's bare-bone but it works, because the method for communicating > "inactive regions" is very basic (and similar to unsolicited > diagnostics). > > Only minimally tested, so YMMV. > > This serves as a good example of how to support unofficial LSP > extensions using Eglot as an API. Could well be in the manual. > > The method for providing a client-side capability based on a server is > crude. Servers do identify themselves properly via LSP, but only after > being initialized, so it's too late and I had to use an heuritic based > on the command. We could also use a proper subclass for clangd servers, > but that's too verbose and overkill IMHO. That's great! Definitely owe you a beer or a bottle of your favorite bevera= ge! Still testing it but so far it seems to work perfectly! Love that clangd is smart enough to classify as inactive also other stuff beyond ifdefs, like headers included but not used. About the heuristic would it be that bad to just include inactiveRegions in the general client capabilities? Guess it would be just ignored by other servers not supporting it, wouldn't it? Kind of surprised clangd doesn't use some kind of namespacing convention for their protocol extensions. Anyway, it would be great if this could be a part of eglot but I can understand being careful given it's not in the standard protocol and not even in a released clangd yet. It would be great though if this example was included in the docs. It says a lot about how easy to extend and well designed eglot is. One thing about UI, all the themes I tried seem to render shadow as grey-ish but it was my impression reading the docs that it would be a dim version of the current face, so it would still have syntax highlighting. Is it just a theme limitation (probably because shadow wasn't used for something like this before) or it's not technically possible? Thanks a lot again, Filippo