-
Notifications
You must be signed in to change notification settings - Fork 112
Flow code actions blocking save with prettier fixups #375
Comments
If you're overburdened but amenable to a pull request, I can put together something extension-side that would accomplish either workaround. If this should go into Flow's language server itself... I'm not terribly familiar with OCaml, but I could try to muddle my way through adding an option to Flow. The downside of fixing the issue in Flow is that we would have to upgrade to whichever version of Flow ships with the new option. |
The VS Code folks says this is something the flow extension needs to fix. microsoft/vscode#89745 (comment)
|
facebook/flow#8277 describes the solution. You may close this once you've acknowledged this bug, as it'll impact ~most VS Code users of Flow. |
@jvilk-stripe Are you using flow codeActions ( |
@Mayank1791989 Thanks for the response. We are already working on upgrading flow to at least v0.111 internally so we can do just that. A true fix, though, is for Flow's language server to only advertise the code actions it supports during initialization. If it doesn't support the |
You can close this issue if you're now properly aware of the problem. Since ESLint + Flow seems like it would be a common combination in the VS Code Flow community, it seemed prudent to let the VS Code maintainer(s) of the Flow extension know about this unexpected performance problem so that they could advocate for their users and push for a fix on the language server side of development. :) |
@jvilk-stripe Let's keep this issue open for now. I will put a conditional fix (based on flow version) in the plugin to prevent the issue for developers using flow version |
@Mayank1791989 that would be awesome. There's a blocker internally to rolling out Flow v0.111 everywhere within Stripe, so that would let us re-enable ESLint auto-fixups without waiting for the upgrade. :D |
btw, the fix should block Flow's language server from advertising code action support when
...is set. We don't have I think you understand the situation, but I wanted to make the problem more explicit in case there was a misunderstanding. |
See the issue I opened here on VS Code:
microsoft/vscode#89745
I believe that, with ESLint now using code actions to implement ESLint fixups with the following option:
(I think this means automatically apply all fixups for errors with source eslint...)
...that VS Code waits for Flow to respond to a code action request before applying ESLint and prettier fixes.
I say "I believe that" because individual extension logs heavily suggest that this is happening. When the slowdown occurs:
eslint
diagnostics in thecontext
.Also, disabling Flow fixes the issue, which is further evidence that this is happening. With that said, I have not found any VS Code logs that contain information concerning what it is waiting on when the user hits 'save', so I have not explicitly confirmed that my mental model of the issue is correct.
Since the Flow LSP can get backed up typechecking changes and takes 1-2 seconds to respond on large projects, users experience a noticeable delay between hitting save and seeing the final, Prettier-formatted file.
I don't yet know what VS Code's response to my issue will be, or when/if it will be addressed. One workaround that you could provide for Stripe that would be nice:
source
field on Diagnostics that you can use for this purpose.Regardless of your thoughts on the matter, I thought that this project might want to be made aware of this issue.
The text was updated successfully, but these errors were encountered: