-
Notifications
You must be signed in to change notification settings - Fork 111
flow suggest
support?
#151
Comments
At this point the future of this extension is really inside the language server plugin ( see #150 ) - so making sure that the things you want to see are added at that level in flow, then exposed for consumers to use 👍 |
Yeah this would be so cool! We'll need to implement this in I wonder which LSP API this could use. How do you imagine surfacing this in the UI? Personally I think this would be awesome as a series of lint diagnostics of Hint (or maybe Info) severity, along with autofixes to implement annotating the suggestion with the strongest confidence. It might also work as a CodeLens, but to me diagnostics makes more sense. Once it gets implemented in What do you think? cc @ljw1004 |
This is very similar to in Visual Studio/C# with its automatic type inference, similar to the
There are differences in opinion about which is best. Visual Studio addresses this with refactorings a.k.a. code-fixes: you right-click on a specifier (be it Visual Studio has a nuanced take on how to indicate code-fixes visually to the user...
VSCode doesn't let you color the code text in a slightly faded-out way. But it does let you have code-fixes in any arbitrary location, including locations that aren't associated with errors/warnings. The way it does this is by sending the "get-available-codefixes" whenever the user moves their caret. (it's up to the language service to cache its computation so it can serve this quickly). Personally, I'd love to see these as code-fixes, but I wouldn't like to see this as diagnostics. One of the files I'm working on has 71 flow suggestions, and none of them are ones that would be good to adopt, e.g.
I don't know if VSCode displays Info diagnostics by default in its error pane. I know that Atom does. All of these examples I think would be too much to show by default in the error pane. A separate but related question is how to show the results of type-coverage |
@richardgirges Partial support of this is added in flow v0.106 via codelens. |
First off, thanks for all the stellar work on this plugin! This package has singlehandedly convinced me to switch to VSCode full-time.
I apologize if a ticket already exists with this request, but I couldn't find one.
The
flow suggest
command is my go-to command for type annotation suggestions. Would love to see those suggestions pop up in the VSCode editor in-line. I also think it'll lend to the overall IDE-like feel of this plugin.Any chance this enhancement could be made in the future?
Cheers
The text was updated successfully, but these errors were encountered: