From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#61412: Inlay hints implementation Date: Tue, 21 Feb 2023 21:26:21 +0000 Message-ID: References: <83edqqaf8c.fsf@gnu.org> <2B284D77-97DF-4B3E-89FB-13F0CA93D240@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="39028"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , Chinmay Dalal , Eli Zaretskii , 61412@debbugs.gnu.org To: Dimitri Belopopsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 21 22:27:20 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 1pUaAS-0009vr-JL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Feb 2023 22:27:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUaAD-0001N0-BB; Tue, 21 Feb 2023 16:27:05 -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 1pUaAA-0001MY-FN for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 16:27:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUaAA-0002Lh-6Y for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 16:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUaA9-0006GA-Mm for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 16:27:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2023 21:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61412 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61412-submit@debbugs.gnu.org id=B61412.167701480224035 (code B ref 61412); Tue, 21 Feb 2023 21:27:01 +0000 Original-Received: (at 61412) by debbugs.gnu.org; 21 Feb 2023 21:26:42 +0000 Original-Received: from localhost ([127.0.0.1]:57366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUa9p-0006Fb-Ty for submit@debbugs.gnu.org; Tue, 21 Feb 2023 16:26:42 -0500 Original-Received: from mail-oa1-f47.google.com ([209.85.160.47]:40959) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUa9m-0006FK-Aj for 61412@debbugs.gnu.org; Tue, 21 Feb 2023 16:26:40 -0500 Original-Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-17235c8dab9so3349535fac.7 for <61412@debbugs.gnu.org>; Tue, 21 Feb 2023 13:26:38 -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=BYQJ1NTTWQ1GF6+PvdbUBhrgg3N+54uSqA89DniMUBo=; b=fVdvEHtxyx/MsFiF333aUhhQlfBvbiw65vomJNldQDVByLN1pG/GfGg2+MN2UP1Zbq 6yrEGCL712oizkMlQ9HYIHkd2hVoDy8s3FwNq1sJncKrI1JXD4cJLm4Gh07j6fXjW7sI xgxTQC/wiCmPN/yWiyQqrtRgPKKe3ISZG8C+M3fPcKXcA6y2Dg+bigrfmd9h4MyTin8i kywwuYfNjZ/fzYvVU5LQ2l7e327Zogt2xc41dMrdtzLbLKjvIXw8q1q6c/vNhNgmSX01 qSpD8FQBdMUoURyAIMA0s5zw5Qh+4ASckJ3ZVjLMA8aXTi2Za2NXijEZaPXf91bbdSZn Qc1Q== 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=BYQJ1NTTWQ1GF6+PvdbUBhrgg3N+54uSqA89DniMUBo=; b=PcLJwffcppknbbShJRxeBvJK9ysluGfBgeXW7AZx28YOYIhQ0BBe8ivx+3MTW0YIy7 z6QjfsZPagWVNVBQ8XlJtNs9tNy2Qs65PexnBsa7XPKm5AEsphvV1bCqrxSNB/ByJ1bx ExUp1/hdfqyM46svewNoQ5BfPkVprs68X5eAeVROog5nlo+ej8CmL0BJ66fQn2KQk/qt Zh7dnJBiZPQbqmCy4UCp0p2gK+ZOL76+lwd7SMk0KekHwEoeEgy25Ppee/zUotSy9oul 43CSS41/1AytdzbCuH/JjpGkenKVW77LVLl8Emu4Z/hdtjWppV88Wo5brBQigeXc1YIm mfqg== X-Gm-Message-State: AO0yUKUveSeWX6WGEObqz7xbWGqR1Wfto2a7s2Kya4jQseBfrAZpk6pk R3Pb65XQ99mrUzY0aCHTm6KpLWqcxWQufJ3n878= X-Google-Smtp-Source: AK7set9k7tUcINYEi3SOAFjTLSTdtxVQ0X7B4oOdAX4aSeBLhSLTpAHvB4119kndYduYLbv5dsec+KlbJhnZgV7ZdOE= X-Received: by 2002:a05:6870:7027:b0:163:cd38:813e with SMTP id u39-20020a056870702700b00163cd38813emr1566008oae.215.1677014792477; Tue, 21 Feb 2023 13:26:32 -0800 (PST) In-Reply-To: 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:256312 Archived-At: Ok, thanks. While I'm sure Flymake can be used for this, I'm not sure it should. The reason is that inlay hints are, in principle, much more numerous than diagnostics. Collecting all of them could be wasteful when the user is only looking at a section of the file. Flymake doesn't have very good mechanisms to work with this scenario. Anyway, your patch has a very large number of unrelated whitespace changes, making it almost impossible to read. Please make one with only the essential changes. Jo=C3=A3o On Tue, Feb 21, 2023 at 6:42 PM Dimitri Belopopsky wrote: > > Hello, > > I thought the point was not to create overlays directly? > I'm sharing what I currently have, using the flymake diagnostics directly= . > Maybe something can be salvaged? > > In the meantime I'll try out your patches. > > On Tue, 21 Feb 2023 at 16:14, Jo=C3=A3o T=C3=A1vora wrote: >> >> [Eli, I just noticed that this bug should be merged with 61066, >> but I don't know how to do that] >> >> Hello, >> >> Attached is my implementation of inlay hints for Eglot. >> Two patches are provided, where the first just lays some >> basic groundwork to make the actual inlay hint implementation >> simpler. >> >> Regarding copyright stuff, I did look at Chinmay's patch, >> but I re-started from scratch. While it was a very good >> effort, there were too many idiomatic Elisp and Eglot things >> to change. I did take Chinmay's face definitions, though. >> Not sure how to proceed here and if this counts as "derived >> work" and if we should wait for Chinmay's copyright assignment. >> >> I gave it some light testing and I kind of like it. Quite >> helpful for C++ with clangd (the only server I tested it with). >> You can bind `eglot-inlay-hint-mode` to some keybinding probably. > > > It's even more helpful in languages like Rust, that rely on type deductio= n a lot more. > Clangd has an extension for designator hints that looks interesting too. > >> >> Documentation in the manual is still missing, but shouldn't >> be very hard to do. >> >> Anyway, this is likely not the end of the inlay hint story >> because, as the second patch documents, this is likely a >> very naive implementation that always requests inlay hints >> for the entire buffer even if just a fraction of it is visible. > > >> >> A better implementation would probably leverage >> window-scroll-functions along with the Eglot-specific >> idle timer. That is probably much, much more tricky to get >> right, but is also more than likely the way to go. >> >> In the meantime, I'd like your opinion on this patch and >> the above topics first. >> >> Jo=C3=A3o >> >> I hope gmail doesn't mess up my attachments... --=20 Jo=C3=A3o T=C3=A1vora