[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.
0001-Add-fix-suggestions-to-Flymake-diagnostics.patch
Description: Text Data
refactor.el
Description: application/emacs-lisp
- Adding fix suggestions to Flymake diagnostics,
Eshel Yaron <=
- Re: Adding fix suggestions to Flymake diagnostics, João Távora, 2024/05/26
- Re: Adding fix suggestions to Flymake diagnostics, Eshel Yaron, 2024/05/26
- Re: Adding fix suggestions to Flymake diagnostics, João Távora, 2024/05/26
- Re: Adding fix suggestions to Flymake diagnostics, Eshel Yaron, 2024/05/27
- Re: Adding fix suggestions to Flymake diagnostics, João Távora, 2024/05/27
- Re: Adding fix suggestions to Flymake diagnostics, Eshel Yaron, 2024/05/27
- Re: Adding fix suggestions to Flymake diagnostics, João Távora, 2024/05/27
- Re: Adding fix suggestions to Flymake diagnostics, Eshel Yaron, 2024/05/31
- Re: Adding fix suggestions to Flymake diagnostics, João Távora, 2024/05/31