onflow/cadence-tools

[Lint] Suggest Fix & Autofix

Closed this issue · 2 comments

Analyzers are amazing, it would be great if they also offer the fix.
For example: with LS and codelens, vs code can guide users to the fix within a click.

Something like: replace this document range with fix would be very valuable

Good idea. For the linter / the analyzers to be able to provide suggested fixes, we'll need to add support in Cadence to analysis.Diagnostic, similar to how diagnostics are defined in Go: https://pkg.go.dev/golang.org/x/tools/go/analysis#SuggestedFix

This has been added in onflow/cadence#2550