all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eshel Yaron <me@eshelyaron.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: Spencer Baugh <sbaugh@janestreet.com>,  emacs-devel@gnu.org
Subject: Re: Adding fix suggestions to Flymake diagnostics
Date: Sun, 26 May 2024 17:56:16 +0200	[thread overview]
Message-ID: <m1v830y3bz.fsf@dazzs-mbp.kpn> (raw)
In-Reply-To: <CALDnm50GrQr_xw3KWD1qn=AGW7eq_gq50RFV8mrNZNXZfbkzDA@mail.gmail.com> ("João Távora"'s message of "Sun, 26 May 2024 15:38:57 +0100")

João Távora <joaotavora@gmail.com> writes:

> I think this is the wrong way to approach it.  Refactorings can be, but are not
> necessarily, associated with diagnostics.

Right, but this proposal is not about refactoring, rather it's about fix
suggestions for diagnosed issues :)

> [...]
> I just note that Flymake as a library is already flexible enough to
> make these context menu

Yes, Flymake lets backends associate arbitrary overlay properties with
diagnostics, but that requires backends to worry about UI stuff.  My
suggestion is to give backends a standard way to provide the relevant
data, and deal with the UI separately and consistently across backends.

> and I don't immediately see the need to bring new concepts such as
> "code edits" of a specific format into Flymake's API.  Just seems to
> increase coupling and brittleness.

That's a valid concern.  It would be nice to use a generic "code edit"
object/format that's not specific to Flymake.  Maybe we already have
something like that somewhere else in Emacs?

> [...]
> Maybe your refactor.el is promising (I had some unfinished version left around
> somewhere, too), but I don't see eglot.el requiring refactor.el, or expressing
> eglot-rename or eglot-code-actions in terms of refactor-rename or
> refactor-code-actions.

I only mentioned my refactor.el because I had refactor-apply-edits at
hand and it made it easier to demonstrate how fix suggestions can work,
I'm not suggesting to change anything about eglot-rename and friends.
FWIW, I use this refactor-rename both with (a modified) Eglot as the
backend instead of eglot-rename, as well as with other backends in modes
that don't have LSP support.  Similarly, with this fix suggestions
proposal, what I'd like to have is a consistent way of saying "fix this"
when presented with a diagnostic, regardless of whether I'm using LSP.


Best,

Eshel



  reply	other threads:[~2024-05-26 15:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26 13:37 Adding fix suggestions to Flymake diagnostics Eshel Yaron
2024-05-26 14:38 ` João Távora
2024-05-26 15:56   ` Eshel Yaron [this message]
2024-05-26 20:24     ` João Távora
2024-05-27 12:15       ` Eshel Yaron
2024-05-27 14:02         ` João Távora
2024-05-27 17:40           ` Eshel Yaron
2024-05-27 22:03             ` João Távora
2024-05-31  7:15               ` Eshel Yaron
2024-05-31  8:55                 ` João Távora
2024-06-03 18:10                   ` Eshel Yaron

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1v830y3bz.fsf@dazzs-mbp.kpn \
    --to=me@eshelyaron.com \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=sbaugh@janestreet.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.