From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Eglot "inlay hints" landed Date: Thu, 23 Feb 2023 19:39:28 +0000 Message-ID: References: <83edqqaf8c.fsf@gnu.org> <2B284D77-97DF-4B3E-89FB-13F0CA93D240@gmail.com> <87356xv65z.fsf_-_@gmail.com> <83fsawriye.fsf@gnu.org> <835ybsr6aa.fsf@gnu.org> <83356wr224.fsf@gnu.org> <87bklktu89.fsf@gmail.com> <83y1oophd0.fsf@gnu.org> <83k008pah3.fsf@gnu.org> 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="7808"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , dalal.chinmay.0101@gmail.com, emacs-devel@gnu.org, dimitri@belopopsky.com, luangruo@yahoo.com To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 23 20:40:45 2023 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 1pVHSO-0001s4-J4 for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Feb 2023 20:40:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVHRW-0007E7-AK; Thu, 23 Feb 2023 14:39:50 -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 1pVHRT-0007B9-EU for emacs-devel@gnu.org; Thu, 23 Feb 2023 14:39:47 -0500 Original-Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVHRQ-0007HL-Kj; Thu, 23 Feb 2023 14:39:47 -0500 Original-Received: by mail-oo1-xc2a.google.com with SMTP id t5-20020a4ac885000000b005251f70a740so394516ooq.8; Thu, 23 Feb 2023 11:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677181179; 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=3UX1D9Cyqz8t6jT+byfRoWPiHj7n6Zg+rV5oAvZNiWc=; b=N/Qr3fMsGcP6NtT4oTdaQjFIbS4SKF84L3P6hzJbVVb3xys4Sm/ZsznU7q/PrkJ72t ljyBnb46dh7ao4Emql3InqxQ6CtpuNMcuZlQWGbBy4f3Z1jfoGfGOC2Cw5hRndfGxqzk s+8sCSEXjR1roR6KMSJKxJLuz0o6q+NNXGMSpP6cQf77Fi4WhiG00nrWSQ5UtRbNmJCW rDALDavyd7aL9paRMA40m2fZR15LnfBw0AWrGoLxY2ETmITtcSBNJoVz0t97F5KzAivO POiASIknMrQyzATQ+vEQ3VkBwjS1d0qcGeHMWdcct07h/1HI9+tqHmx6vuRZvK4ptTro T1xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677181179; 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=3UX1D9Cyqz8t6jT+byfRoWPiHj7n6Zg+rV5oAvZNiWc=; b=M5Y06fummQHWmxBazKwPFsNjdHKHr/1iUBASm/o/YffENPz0Z6/4gVOIR8dIBwcwPp IhSjN7qE7UfXCzxBE70xrTsdB90C/15DxbeUDAPukh2HZc8qpxiIBt+PQ47GFWeKoFMd 4ZmHwomhC9IIrX2HxZD0mSnUp6DDr3CADbrXEfk6gGovsGtLKKJFO+L+h8RARE+Mbcsu 5BXmhjjzTnJ9WE1aQ7v2z1OxLMpKbVw/EFOs5PXGu+Bdx7CuI2ejAj/zX8w9NWuD7zAp i/rlTu+8269AwdEp/x1Iswx0cq9GpljLbisAO6oXV18y2teO3SczK1zO/8Y9B1XLGbGF rCzQ== X-Gm-Message-State: AO0yUKWgTWenbggMGxJYloqyAdtGSl9mKSKNls8yKShnYOvpGco2c4y5 MD6Mip906LsIgzJjX5F1/COhPLd9IyJeSuS73+E= X-Google-Smtp-Source: AK7set8gvISiiOTTPJ4FsvIvrGxVVNzLRLFPeDa83pmEq/bJ/SCEhOZTf9goHqBrAk+/3G58yDdC/DNhS0w5pPocHno= X-Received: by 2002:a4a:2cd7:0:b0:525:2a18:e6eb with SMTP id o206-20020a4a2cd7000000b005252a18e6ebmr344015ooo.1.1677181179130; Thu, 23 Feb 2023 11:39:39 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::c2a; envelope-from=joaotavora@gmail.com; helo=mail-oo1-xc2a.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:303716 Archived-At: On Thu, Feb 23, 2023 at 7:28 PM Stefan Monnier w= rote: > > > I'd love to switch over to the jit-lock implementation as it has > > potential to be much neater. But I can't seem to get it to not > > over-request stuff. I attach the patch I've been trying, and it's > > clearly got some thinkos when you test it. It doesn't help that > > `window-start` and `window-end` aren't -- apparently -- reliable > > when called from a jit-lock function. > > Sorry, I have not followed the discussion, so I don't know what are > "inlay hints" nor how to test them. What problem do you see what you > try your code? Hi Stefan. Inlay hints are described summarily in the very first message to this thread and in the commit implementing them. They're very many 0-length overlays, almost like tooltips, annotating type deductions and positional parameter names. The goal here is to request them at the correct time and balance multiple objectives: 1. minimize the number of requests 2. ensure the request covers all visible portions of the buffer across any windows showing it. 3. don't request for too large a region, else the amount of data can be prohibitive. The latest message I sent to Eli has my best shot at it. If you have a clangd executable somewhere, you can test this rather easily with the eglot.el in core and a cpp file such as void foo(int bar) {} int main() { foo(42); foo(42); ... very many lines of this ... foo(42); foo(42); foo(42); } You should see some intangible text appear in the buffer so that it will look like: void foo(int bar) {} int main() { foo( bar: 42); foo( bar: 42); ... very many lines of this ... foo( bar: 42); foo( bar: 42); foo( bar: 42); } Then scroll around in the buffer and check the traces of eglot--update-hints-1. Try to change that 'int bar' to 'int quux' and see if the system reacts correctly to the change updating the ' bar: ' hint to ' quux: '. See also my last message to Eli, which contains a horrible patch that nevertheless does more or less achieve those objectives. Jo=C3=A3o