From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Krzysztof Klimonda" Newsgroups: gmane.emacs.bugs Subject: bug#64101: 29.0.91; Eglot inlay hints rendered out of order Date: Sat, 17 Jun 2023 14:26:49 +0200 Message-ID: References: <83r0qar07l.fsf@gnu.org> <877cs28m23.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="17531"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.9.0-alpha0-496-g8c46984af0-fm-20230615.001-g8c46984a Cc: 64101@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , "Eli Zaretskii" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 17 14:28:33 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 1qAV2c-0004Kf-Ea for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Jun 2023 14:28:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAV2F-0003kT-Lx; Sat, 17 Jun 2023 08:28:07 -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 1qAV2A-0003k7-L3 for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 08:28:03 -0400 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 1qAV2A-0000PS-C8 for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 08:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAV2A-0001JZ-7B for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 08:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Krzysztof Klimonda" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Jun 2023 12:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64101 X-GNU-PR-Package: emacs Original-Received: via spool by 64101-submit@debbugs.gnu.org id=B64101.16870048394990 (code B ref 64101); Sat, 17 Jun 2023 12:28:02 +0000 Original-Received: (at 64101) by debbugs.gnu.org; 17 Jun 2023 12:27:19 +0000 Original-Received: from localhost ([127.0.0.1]:51005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAV1S-0001IQ-MK for submit@debbugs.gnu.org; Sat, 17 Jun 2023 08:27:19 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAV1Q-0001IA-5z for 64101@debbugs.gnu.org; Sat, 17 Jun 2023 08:27:17 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 23C385C0186; Sat, 17 Jun 2023 08:27:11 -0400 (EDT) Original-Received: from imap44 ([10.202.2.94]) by compute1.internal (MEProxy); Sat, 17 Jun 2023 08:27:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= syntaxhighlighted.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1687004831; x=1687091231; bh=jK sHJVRQQBgtbzJShyLrMta5laXyvHpPw7lL9CVNIAw=; b=Qks/EUKtk9Ck87b2gS L67wi+egSMGMS0hLpMIEi80RESMD7BdqlmcokHyqpJq6ylIE8HMAai50pjP/htfb eAXyREn14uljugqEu+1DgsF/bVKhfCmpOjnb8DUKMx2SCyjVTfozCM/gx2/0ALik eKyV4gol1Rq/hRHdhbzg60KfTCBaeSi+BYdjHc4tWXpiWE0v/MYaTmQb7e4qIHlG R9Pnjn1wra/2yrxorZfNJF1L2Lo6CW/KhSNE0A/wwK/tPD4clEVXph7Qe8uqVCzn Ezj4BlaOtCeMkTdY1H77sWpMyt2MAI9h8TuhxPc8YJuMagzxJD3qmbSrtaKtxon8 rsYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1687004831; x=1687091231; bh=jKsHJVRQQBgtbzJShyLrMta5laXyvHpPw7l L9CVNIAw=; b=h5/jCr/NOONrna0oG2FVJiMF5JPSW0QoLWn9an1fHROiOI0rNMO gM6Sh5MG02hNRd+TvJ9B7IScCotq8LmrlhxJx6hQxPV7wa5tcAO5f4AQ8kdVLVdn pQ9pu+07OrgJ++7nmfTvXV4re3M8TzpYks5k9C423nHKxkKKvkCQhLhDwIqcBnVi PR4KjhsxUWOZqg3tnY8ZRykdJF7nKVlsQEvEY6ypttQf1S0au7xBH9FHruSnWhZw gwkVOEuLZbgjoug2aKMzWRCT9CMmKhVFcyKTEsAVeQbA/6bzOYLtYD0JiFBdkekl JQel2UNfxQPrhNY7mMQACrCxZnTVsvP4xzA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedvjedgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdfm rhiihihsiihtohhfucfmlhhimhhonhgurgdfuceokhhklhhimhhonhgurgesshihnhhtrg ighhhighhhlhhighhhthgvugdrtghomheqnecuggftrfgrthhtvghrnhepvdeiteeiuedv uedthedtgfdvffehheejvdeuvdfhtdeguedvtdffffegleethfffnecuffhomhgrihhnpe hgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehkkhhlihhmohhnuggrsehshihnthgrgihhihhghhhlihhghhhtvggurd gtohhm X-ME-Proxy: Feedback-ID: i3888429f:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id AD91336A0075; Sat, 17 Jun 2023 08:27:10 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <877cs28m23.fsf@gmail.com> 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:263531 Archived-At: Hi Joao, The attached patch has indeed fixed the issue. Additionally, I've tested the behaviour on emacs 28.2 and the bug persis= ts, so it seems to be unrelated to any overlay changes. On Sat, Jun 17, 2023, at 11:39, Jo=C3=A3o T=C3=A1vora wrote: > Eli Zaretskii writes: > >> Jo=C3=A3o, are you looking into this? =20 > > I looked at a very similar issue:=20 > https://github.com/joaotavora/eglot/discussions/1239 > > There, Milan Jovanovic , reports something very similar, > if not completely identical, for Emacs 29. I asked > Milan to send mail here. Maybe Krzystof and Milan are > related, or this is just a coincidence? > > Anyway, I tried to reproduce the problem on both Emacs 29 > and 30 and couldn't. > > The problem also doesn't happen on Emacs 28. So I don't know what is = up > and the "recent overlay rewrite" (when?) doesn't seem to have an effec= t. > I don't have a Mac OS machine to test. > >> Should the overlays created for the >> inlay hints be forced to be sorted in some particular order? > > Maybe, and there is definitely an order they should be sorted. > But as far as I can personally observe, there is no problem yet, > so it would be best to first understand the problem. > > But maybe Milan/Krzystof can try this patch: > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index a65795f1dfc..0c000f72ec7 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -3755,8 +3755,9 @@ eglot--update-hints-1 > (if peg-after-p > (make-overlay (point) (1+ (point)) nil t) > (make-overlay (1- (point)) (point) nil nil=20 > nil))) > - (do-it (label lpad rpad firstp) > - (let* ((tweak-cursor-p (and firstp peg-after-p)) > + (do-it (label lpad rpad i) > + (let* ((firstp (zerop i)) > + (tweak-cursor-p (and firstp peg-after-p)) > (ov (make-ov)) > (text (concat lpad label rpad))) > (when tweak-cursor-p (put-text-property 0 1=20 > 'cursor 1 text)) > @@ -3767,17 +3768,18 @@ eglot--update-hints-1 > (1 'eglot-type-hint-face) > (2=20 > 'eglot-parameter-hint-face) > (_=20 > 'eglot-inlay-hint-face)))) > + (overlay-put ov 'priority i) > (overlay-put ov 'eglot--inlay-hint t) > (overlay-put ov 'evaporate t) > (overlay-put ov 'eglot--overlay t)))) > - (if (stringp label) (do-it label left-pad right-pad t) > + (if (stringp label) (do-it label left-pad right-pad 0) > (cl-loop > for i from 0 for ldetail across label > do (eglot--dbind ((InlayHintLabelPart) value)=20 > ldetail > (do-it value > (and (zerop i) left-pad) > (and (=3D i (1- (length label)))=20 > right-pad) > - (zerop i)))))))))) > + i))))))))) > (jsonrpc-async-request > (eglot--current-server-or-lose) > :textDocument/inlayHint --=20 Krzysztof Klimonda kklimonda@syntaxhighlighted.com