-
Notifications
You must be signed in to change notification settings - Fork 767
Open
Labels
P-mediumWe may work on this issue if we find the timeWe may work on this issue if we find the timeRFCRequest for commentsRequest for comments
Description
Proposal
It should be possible for linters to use Meta.Tactic.TryThis.addSuggestion and friends to add "Try this:" suggestions
Often, a linter can not only identify the problem, but also suggest a fix.
It would be very convenient in these cases to apply the fix with a single click, and not have to write a separate code action.
Some examples include
- Deprecations: the suggestion can substitute the new function
- Unused arguments: the suggestion can delete the argument
- Syntax transformations to remove antipatterns.
Currently, when addSuggestion is used, the suggestion appears in the info view, but only as a log message and not as a widget.
An outline of how this might look:
runLintersshould preserveinfoState(andtraceStatefor good measure?)ContextInfo.runMetaMshould do the same (as linters may need this to run elaborators from the info tree)- A top level info tree node needs to be created for linters, to avoid a panic from
Lean.Elab.InfoTree.visitM; or linters need to be very conservative about accidentally creating other infotree nodes.
Community Feedback
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P-mediumWe may work on this issue if we find the timeWe may work on this issue if we find the timeRFCRequest for commentsRequest for comments