From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61066: [PATCH] Add inlay hint support to eglot Date: Thu, 26 Jan 2023 08:29:02 +0200 Message-ID: <83a625g66p.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15658"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61066@debbugs.gnu.org To: Dimitri Belopopsky , =?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 Thu Jan 26 07:29:30 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 1pKvlJ-0003tF-EN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Jan 2023 07:29:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKvl5-0005iy-QW; Thu, 26 Jan 2023 01:29:15 -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 1pKvl4-0005iQ-4b for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 01:29:14 -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 1pKvks-0007cS-Nf for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 01:29:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pKvks-0003PL-Ht for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 01:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Jan 2023 06:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61066-submit@debbugs.gnu.org id=B61066.167471453613086 (code B ref 61066); Thu, 26 Jan 2023 06:29:02 +0000 Original-Received: (at 61066) by debbugs.gnu.org; 26 Jan 2023 06:28:56 +0000 Original-Received: from localhost ([127.0.0.1]:60415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKvkm-0003Oy-7d for submit@debbugs.gnu.org; Thu, 26 Jan 2023 01:28:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKvkk-0003Oj-JL for 61066@debbugs.gnu.org; Thu, 26 Jan 2023 01:28:55 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKvke-0007OZ-0Z; Thu, 26 Jan 2023 01:28:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=VW1E+xQfxPP/57/qxySfPfIPQQ2ObVv8PqX8iRN9foQ=; b=fQrxumrFB40LTghp6Q6k xV/nayS82gxtn3U8S+037SiGCsNzqeaiSrqvtjWnfG91XgnxFsJDAtZaDbfisMKw+1Y/dSZ6NyNbP XpzHhoyPM15aPV0aELq/VB1odxZoKrt76vbHA82aa+JVG1beQxPBf6IMh8025t5TyRCds/v2h+FJS IOlvMMzuTYkUztr74v0lrCOsKoTnpyobdqQIAtsaHWjHqRMcQV8mn+QS/bChX3XwqVXQXfJW1EJxt yJT+rzQmMCVW8WuK2Sa08NVJtTrXTtXBDDWl2L1+jse23XQrd77GjCBymrJB7uggE5682dS/YCwyk c9azGGkiSckkUQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKvkd-0002QB-AL; Thu, 26 Jan 2023 01:28:47 -0500 In-Reply-To: (message from Dimitri Belopopsky on Wed, 25 Jan 2023 23:34:02 +0100) 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:254170 Archived-At: > From: Dimitri Belopopsky > Date: Wed, 25 Jan 2023 23:34:02 +0100 > > I've been working on adding support for inlay hints inside eglot using overlays. > Here is a working patch, but I'm still missing a few things: > > - I can't figure out a way to show the hints on a document without causing lags or timeouts from the lsp > server > - I'm currently updating the hints by sending the whole file each time (to make sure all hints get updated > correctly). I'm not sure on how to make this more efficient (or if it even necessary). > > On the implementation side: > - implemented with overlays as a minor model, enabled by default > - shows all hints supported by the protocol > - there is a customisation to disable the minor mode if the user doesn't want the feature > > I'd love to get a few points to finish this patch, and of course any ideas and feedbacks are welcome! Thank you for working on this important feature. AFAIU, inlay hints provide information of the same kind as ElDoc and in similar manner from the display and UX POV. So I think this feature should work via ElDoc, not as a separate from-the-scratch implementation. ElDoc is already capable of using Eglot-supplied information, so perhaps the only feature we need to add is the capability of ElDoc to (optionally) display the information in overlays near point. (I thought we already had such a capability in eldoc.el, but it looks like I was dreaming, because I cannot find it there.) The advantage of basing this on ElDoc is that then we will be able to provide similar features from information sources other than Eglot. João, WDYT?