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 11:23:40 +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> 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="2685"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Chinmay Dalal , emacs-devel@gnu.org, dimitri@belopopsky.com, luangruo@yahoo.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 23 12:24:40 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 1pV9iK-0000YV-PS for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Feb 2023 12:24:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pV9hg-0003Yr-AL; Thu, 23 Feb 2023 06:24:00 -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 1pV9ha-0003Rt-TT for emacs-devel@gnu.org; Thu, 23 Feb 2023 06:23:55 -0500 Original-Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pV9hZ-0005Eh-By; Thu, 23 Feb 2023 06:23:54 -0500 Original-Received: by mail-oi1-x22d.google.com with SMTP id bl7so12308030oib.0; Thu, 23 Feb 2023 03:23:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=LTbWJ/bsgQUgP2lN7ppRh21AMj13Vkf2aUS0bJ059E4=; b=N/TbQn5pkw9UlImYcsiObAUlqFhfNDx4wJWJzc7nUtz6cY2RpTXO7p7vHeUprSK08k j093WF6PD9HtLBxnZkfvQnE0r/eB68Ukrt9b2nAjAChMDYwAw/118idOWrqdTQSM+JEK tWPGDc66IQF0C+uo6/K+vHXY8OYwucmZMPsNSMTfVy4ESxCFvhDVSIsVMhheaA01PmKb OhApw3lS+D1+eMpy/JZA7l4OeHBSPzgcwcXmwdNeaePrnDW/egk7CrlEYyB9TdbV7Jum ntGsA2qB7Obu3YeJPfju0R80h+CoY4LyztTeI0CVdNBpNFYxV78Dtfn0h3VDCs+f5QCg mlhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LTbWJ/bsgQUgP2lN7ppRh21AMj13Vkf2aUS0bJ059E4=; b=reZVJqOJFs1beSaVG2WLoGMosqzV73029y9iw2ADCJSjuS/n9RB6X3IQuv2P99pJMo mVQ6DEQXKU9mY7kv+jYT7lO5SXoC1d10RdgIaKllhudmfWZH0ruUvwieCpNMrJS1YLtZ frvRMF4eRcp7ZWctQfBrQArcKF2c9GV1rAHPfyDZMOFil4B47Ma8XPLiX7NRjvWc3qg9 tgkL0FWhFpoPqGTygPN1XrxuEywgHSVWNlgOyEinwivuiDmKqN+hfrpcJfbXrOTKCoF9 p2SEmQdIQRxke8HV072WXg4AvusnRQfc3+vAptnFbsgjg7crzUGIotuZOKumhfXAKLlP PFnw== X-Gm-Message-State: AO0yUKXOGFHmwn7tUdRZfJzo2J0XuliJePoUs9++HAZvgCiwjxtL0j3y LV35gaLLazYehuHNdxajmfGCqeZIAOYedSnfDeiIfwC3 X-Google-Smtp-Source: AK7set+nyPjt4Yq3J055gh4hsyz8tskwpu0J4JIqMqCYrqRYb1nI9Ss36zcRVVUO5MAM2/Daupd4mIiE9PDhkwZUGuk= X-Received: by 2002:a05:6808:13c9:b0:37f:84bc:b095 with SMTP id d9-20020a05680813c900b0037f84bcb095mr666069oiw.215.1677151431314; Thu, 23 Feb 2023 03:23:51 -0800 (PST) In-Reply-To: <835ybsr6aa.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=joaotavora@gmail.com; helo=mail-oi1-x22d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:303700 Archived-At: On Thu, Feb 23, 2023 at 11:05 AM Eli Zaretskii wrote: > > > From: Chinmay Dalal > > Cc: joaotavora@gmail.com, emacs-devel@gnu.org, dimitri@belopopsky.com, > > luangruo@yahoo.com > > Date: Thu, 23 Feb 2023 15:25:21 +0530 > > > > > > Eli Zaretskii writes: > > > > >> Can it be instead done in such a way that initially (when loading a = new > > >> file) they are requested for the whole buffer, then on subsequent > > >> changes they are only requested for the visible regions. > > > > > > Why would we want that? > > > > It will solve this problem: > > > > >> > When > > >> > scrolling a window, it may take a short amount of time for inlay h= ints > > >> > to "pop in". > > So would using jit-lock-register, which was proposed here. The "pop-in" delay is just a function of the intentional bandwidth-conserving timer delay + the normal LSP interprocess communication delay. Any jit/lazy Emacs-side solution is going to have to deal at least with the second addend of that sum. jit-lock-register was unknown to me. It seems to rely on some heuristic to know what regions need to be "refontified". I wonder if the heuristic will be accurate for inlay hints, since changing void foo(int bar){...} to void foo(int baz){...} in one part of the buffer doesn't usually change the fontification of the rest of the buffer. But it might very well invalidate the inlay hints everywhere. In fact the invalidation impact is not just in the same buffer, but potentially all other buffers (all the ones where a call to 'foo' is found). Eglot's inlay hints implementation doesn't handle this edge case. Though I don't think it would be extremely hard to, it doesn't seem extremely relevant for what is usually a "best effort" helper feature from the LSP side. Jo=C3=A3o