From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nikola Pajkovsky Newsgroups: gmane.emacs.devel Subject: Re: Eglot "inlay hints" landed Date: Fri, 24 Feb 2023 12:03:06 +0100 Message-ID: <87edqf2umt.fsf@pajkovsky.cz> References: <83edqqaf8c.fsf@gnu.org> <2B284D77-97DF-4B3E-89FB-13F0CA93D240@gmail.com> <87356xv65z.fsf_-_@gmail.com> <87zg94kvoq.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="4437"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Chinmay Dalal , Nikola Pajkovsky , emacs-devel@gnu.org, Dimitri Belopopsky , Po Lu , Eli Zaretskii To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 24 12:20:05 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 1pVW7R-0000xD-Kf for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Feb 2023 12:20:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVW6z-0005rH-JD; Fri, 24 Feb 2023 06:19:38 -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 1pVVr5-0007eL-6V for emacs-devel@gnu.org; Fri, 24 Feb 2023 06:03:11 -0500 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVVr3-0000zR-Eo; Fri, 24 Feb 2023 06:03:10 -0500 Original-Received: by mail-wm1-x32b.google.com with SMTP id ay29-20020a05600c1e1d00b003e9f4c2b623so1850229wmb.3; Fri, 24 Feb 2023 03:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PK9+5vleheExlQCAmC2kLDDO/yX2onNvBJlNm4HOJII=; b=K2JRFac+WWuPiaqMEm3Et6oAFnGEOGbCiflGOOffLn25L+FLYy51osjMFfvLmEGBIk icYmAUQeJ0B6JCX89HxCCiiS7Jhy7AqWVBoWZyyBPK6fe7PWvxR4hjhrw7qSUpBUHMWR 2CfVL2Gubjil3SfHI06U93JT48PjKZbGGyHv3VIXtPoRxP5vPDpgOvuDtTG6RoJUWavX EoWYdDOoTlJ7fALTOfYZ72JbVcSg2wA7Ue4eRoN1MICHtUyVEB6orGYg9RRPbHTwVPzM BwuL9EjUsx+hAak9e1En3uCvhdTy+3moCOZFIo/dwZjSAUVBlibeueKB0C8fWhzKK1dN ssPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PK9+5vleheExlQCAmC2kLDDO/yX2onNvBJlNm4HOJII=; b=QQZyxdsoIWZB0v9gc7HmuF7g4MhghtB2irYXfBH1M5SDyuN7hpDJggYX1YJPgSSLTo vYTx/cx+DLhuKiP7NA4BUJTNkgnhTgttA0PpuZgUxKBd9I/VoP0738hh8aKCHLuX8E+g 4VBM5+qyXUYyPI37JLEFrCUYJ+2ib+T+hJLWZ520nBt5Qh30CwNc2cFwcg6ismfatq9g VNbntWCsAfjHzzFmZEFXMlEA5eVa8+tyLNwsucmav9sflGQZBPtFSTwpbQgI0eYx7Ksw /8r+PTPAfAIzPcK1EiQ60b6HXt2LwIIk41SzePKQkRV8tb4r2hD5jMzv6xlRCOcFbqYG droA== X-Gm-Message-State: AO0yUKWJv4Ot/tudP3Deswjn2PfANBQbhXD4D8zKx1vwjgCXI0W8Ns2m Y/blYiD/NEwo65I51YLIWK8= X-Google-Smtp-Source: AK7set83DLaKnU7Gf/qxN6CIlBRzJhZTmYWpYU1qfGu37KURezmjnNmw6d7aJFiC6VOCBVhk4JUGDA== X-Received: by 2002:a05:600c:30d3:b0:3df:f7e7:5f01 with SMTP id h19-20020a05600c30d300b003dff7e75f01mr6390785wmn.15.1677236587182; Fri, 24 Feb 2023 03:03:07 -0800 (PST) Original-Received: from localhost ([2a01:4f8:151:3141::2]) by smtp.gmail.com with ESMTPSA id q9-20020a1ce909000000b003dff870ce0esm2461842wmc.2.2023.02.24.03.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 03:03:06 -0800 (PST) X-Google-Original-From: Nikola Pajkovsky In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Fri, 24 Feb 2023 09:59:29 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=n.pajkovsky@gmail.com; helo=mail-wm1-x32b.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-Mailman-Approved-At: Fri, 24 Feb 2023 06:19:34 -0500 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:303746 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > On Fri, Feb 24, 2023 at 4:30 AM Chinmay Dalal > wrote: > >> You can look at the end of any long rust function with hl-line-mode on: >> there's an empty overlay but it's supposed to have a link to the >> beginning of the function. Screenshot attached. >> >> I think the bug is in eglot--update-hints-1: >> >> (if (stringp label) label (plist-get label :value)) >> >> It should instead be the value of :value from the _first element_ of >> label, as the spec says a label is a string or a _list of_ `InlayHintLab= elPart`s: > > Nice catch! Indeed I missed that. > >> Of course, this is not ideal when there are multiple elements in the >> label list (but not strictly wrong either). > > Yeah, for now let's stick to the first. I don't know how to interpret > "multiple hints" for the same "language element", in Emacs at least. > What do other editors do? What I have done for lsp-mode is that I have joined all labels from `InlayHintsLabelPart`, and printed out the result. That works like a charm but probably not the best solution. >> Also, can the clickable link be actually implemented using the `keymap` >> property of overlays: >> https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Proper= ties.html#index-keymap-of-character >> instead of just displaying the text? > > Probably yes. > > Jo=C3=A3o