From: Dmitry Gutov <dmitry@gutov.dev>
To: "Eli Zaretskii" <eliz@gnu.org>, "João Távora" <joaotavora@gmail.com>
Cc: 73452@debbugs.gnu.org, federico.beffa@fbengineering.ch
Subject: bug#73452: Code lens support in eglot
Date: Fri, 27 Sep 2024 03:20:35 +0300 [thread overview]
Message-ID: <d0d685c6-c9a4-41ad-acc5-99827f470b6d@gutov.dev> (raw)
In-Reply-To: <86ikukc6lz.fsf@gnu.org>
On 25/09/2024 14:31, Eli Zaretskii wrote:
>> Read the last parts of the discussion I linked to if you're
>> interested.
> I did, but couldn't answer my questions, because the discussion relies
> heavily on VSCode features with which I'm not familiar and whose
> descriptions I saw didn't clarify the issue.
It seems to me that a brief description would be "buttons that do
things", but unlike Code Actions - already available in Eglot - those
things don't typically alter the text that they act on.
A LSP-generic mechanism to position those buttons at places in code
which are recognized by the LSP server. For the LSP spec:
/**
* A code lens represents a command that should be shown along with
* source text, like the number of references, a way to run tests, etc.
* ...
Running tests is the #1 use I found for them when writing some Go
recently. Eglot doesn't have a built-in test launcher of any sort, so
that feels like an omission.
There are other lenses for Go (enumerated here:
https://go.googlesource.com/tools/+/master/gopls/doc/codelenses.md), and
they do sound useful, but less essential in comparison.
And I would probably agree that the examples from the original PR are
not that impressive (we already know how to search for references, and
we know that that action works with every symbol - more or less, and we
know how to access VC information - or in any case this would be the
same across languages, or without LSP).
It seems the strongest point of code lenses is advertising actions
specific to language and/or to a context within the source code file
(such as, again, launching tests). So the user is made aware of the
capability.
Admittedly, this seems more useful with some servers than others: gopls,
rust-analyzer and ruby-lsp have test runner (and debugger) lenses,
whereas clangd and typescript-language-server only have the "references"
thing - I guess the usages count is nice, but it's much less essential.
next prev parent reply other threads:[~2024-09-27 0:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 14:02 bug#73452: Code lens support in eglot Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-24 14:26 ` João Távora
2024-09-24 15:48 ` Eli Zaretskii
2024-09-24 21:01 ` João Távora
2024-09-25 11:31 ` Eli Zaretskii
2024-09-26 8:09 ` João Távora
2024-09-26 15:35 ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-26 17:12 ` João Távora
2024-09-26 19:07 ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-26 23:47 ` Dmitry Gutov
2024-09-27 5:55 ` Eli Zaretskii
2024-09-27 0:20 ` Dmitry Gutov [this message]
2024-09-27 6:53 ` Eli Zaretskii
2024-09-27 19:27 ` Dmitry Gutov
2024-10-02 11:57 ` Felician Nemeth
2024-10-02 23:26 ` Dmitry Gutov
2024-10-03 22:43 ` João Távora
2024-10-07 23:33 ` Dmitry Gutov
2024-09-25 7:04 ` Federico Beffa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-25 7:50 ` João Távora
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d0d685c6-c9a4-41ad-acc5-99827f470b6d@gutov.dev \
--to=dmitry@gutov.dev \
--cc=73452@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=federico.beffa@fbengineering.ch \
--cc=joaotavora@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).