Zulip Chat Archive
Stream: general
Topic: unused simp argument linter feedback
Yaël Dillies (Jul 12 2025 at 10:39):
@Joachim Breitner, I have some feedback about the new unused simp linter:
- It is truly amazing :heart:
- When there are several unused simp lemma in the same simp call/same proof/neighboring proofs, fixing linter warnings starts feeling like a game of memory: As soon as you perform one suggested edit, all linter warnings disappear and you either have to wait a minute for the declaration to reload (yes, my proofs are a bit eh... :grimacing:) or you start editing blindly with what you remember.
- There seems to be one
Try thissuggestion per extraneous lemma in a simp call, instead of one suggestion per simp call. This exacerbates the previous point.
Ruben Van de Velde (Jul 12 2025 at 12:21):
For 2 with proofs of different theorems: always work up from the last warning in the file
Joachim Breitner (Jul 12 2025 at 12:43):
Can I just stop reading after 1? :-)
Joachim Breitner (Jul 12 2025 at 12:44):
I chose to display a separate warning for each unused argument. This means that the user has to click multiple times to remove all of them (and wait for re-elaboration in between). But this just means multiple endorphine kicks, and the main benefit over a single warning that would have to span the whole argument list is that already the squigglies tell the users about unused arguments.
Joachim Breitner (Jul 12 2025 at 12:45):
I guess one could have multiple diagnosis, one per unused simp argument, and all of them offer the same all-removing hint? But that looks odd in the InfoView as well
Malvin Gattinger (Jul 12 2025 at 13:10):
When I had a lot of unused simps in slow proofs I changed the setting of vs code to be slower in updating the UI - not sure if it was the default LSP UI or the "ErrorLens" extension, but eventually I managed to edit fast enough to still see a few squiggly lines before they would have to be re-generated.
And I have a related but more general question: Is there a "accept all linter hints in this file" function or how hard would it be to make that?
Joachim Breitner (Jul 12 2025 at 13:23):
We don't have that yet, and I also hope we get it eventually. Ideally not only in VSCode but also in batch mode (so that you can update many files in one go)
Yaël Dillies (Jul 12 2025 at 14:00):
Joachim Breitner said:
the main benefit over a single warning that would have to span the whole argument list is that already the squigglies tell the users about unused arguments
Aha, so a single warning has to correspond to a single contiguous squiggle? That's a bit unfortunate here
Joachim Breitner (Jul 12 2025 at 15:14):
I could also try to add a second hint labeled “remove all unused simp arguments” if there is more than one. Probably this hint wouldn't show the diff (to be considerate of the screen space).
Eric Wieser (Jul 12 2025 at 15:42):
Are non-contiguous squiggles under consideration?
Eric Wieser (Jul 12 2025 at 15:43):
I had previously thought you could get them by attaching your message to mkNullNode #[part1, part2]
Joachim Breitner (Jul 12 2025 at 15:57):
Hmm, maybe I simply didn't know about that trick.
Joachim Breitner (Jul 12 2025 at 16:00):
But in LSP a diagnostic has a range, not a list of ranges, so I'm not too hopeful:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnostic
Eric Wieser (Jul 12 2025 at 22:37):
I guess the diagnostic could be duplicated for lsp, but maybe working around the protocol is unwise
Last updated: Dec 20 2025 at 21:32 UTC