Open nobodywasishere opened 9 hours ago
Alternatively if generating the correction takes too long, may be more worth it just to include whether it's correctable via a bool and have a different way of getting / generating the correction after the user has said they want it.
That's an interesting use-case, I reckon we could think of sth along these lines. Do you know how other tools (in Ruby or JS for instance) are handling this?
Having language servers that implement this functionality, as far as I know (see lsp spec).
The full correction could be excluded by default but put behind a flag --include-corrections
. Then when the user clicks "Correct issue" or similar code action on hovering over ameba lint, ameba would be run again (just for this file) with that flag set, and the code action would be executed w/ the results from that.
It would be really useful for the VS Code extension to be able to correct issues within editor directly instead of needing to go to the terminal to invoke ameba. Depending on how much additional time it takes to compute, it may be worth doing. Something like:
Which would work perfectly to create a WorkspaceEdit with the replace method.