emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding fix suggestions to Flymake diagnostics


From: Eshel Yaron
Subject: Adding fix suggestions to Flymake diagnostics
Date: Sun, 26 May 2024 15:37:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Spencer, João, and all,

I've been playing around a bit with adding fix suggestions to Flymake.
The idea is to provide backends with a standard API for associating fix
suggestions with diagnostics, and to provide users with a consistent UI
for applying such suggestions.

Some backends already use various tricks to suggest fixes in one way or
another.  For example, Eglot associates LSP "quickfix" actions with some
diagnostics.  What do you think about standardizing this concept?

I'm attaching a patch with an initial implementation that extends the
Flymake API and adapts Eglot to provide fix suggestions in this manner.
This lets you apply fix suggestions via context-menu-mode right-click
menus, and via a new command flymake-fix that looks for a fix for the
diagnostic at point.  So far I tested it with clangd and gopls.

Note that this patch uses the function refactor-apply-edits from my
refactor.el library (attached as well) in order to apply the fix
suggestions, so you'll need that too if you want to give it a spin.

Attachment: 0001-Add-fix-suggestions-to-Flymake-diagnostics.patch
Description: Text Data

Attachment: refactor.el
Description: application/emacs-lisp


reply via email to

[Prev in Thread] Current Thread [Next in Thread]