As you might use Flow to monitor your files using command _flow status_, I was wondering why not to add an interactive option to Flow which might propose a fix on the fly to a given issue using available options defined in source code already. Flow's Getting Started guide uses the example of a function called square. This function has two issues around the function parameter and returned value.
The interactive mode might propose to
See above.
This is Quick Fix code actions in LSP?
This is Quick Fix code actions in LSP?
yes, and we have experimental support for it coming soon!
@mroch would there be more than one action?
yep! if you return multiple codeActions, VSCode presents you a list. it's a bit tough because you don't get much space in the UI to explain the difference, but doable.
cc @akuhlens, who worked on this stuff as an intern this summer!
I mean more like what kind of fixes Flow would have
hopefully tons of them. they'd depend on the error. for bad addition, it could suggest explicit casting. for missing properties, it could suggest adding the property to the literal, or making it optional in the type, etc. for missing annotations, it should suggest one. for unused suppressions, it should let you remove the comment. for any error, it should suggest a suppression (as a last resort). the last two would replace ./tool add-comment.
Most helpful comment
hopefully tons of them. they'd depend on the error. for bad addition, it could suggest explicit casting. for missing properties, it could suggest adding the property to the literal, or making it optional in the type, etc. for missing annotations, it should suggest one. for unused suppressions, it should let you remove the comment. for any error, it should suggest a suppression (as a last resort). the last two would replace
./tool add-comment.