You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flow advertises true or false, telling VS Code that it may support all code actions.
As a result, VS Code believes the Flow extension supports "source.fixAll" code actions, which is a non-standard code action that can block formatters like Prettier from running:
Since Flow can be slow to respond to code action requests when typechecking edits, users can see a multi-second wait before Prettier runs in VS Code.
This is only an issue if the user configures VS Code to apply "fixall" code actions before save. Unfortunately for Flow, the VS Code ESLint extension now uses source.fixAll code actions to surface ESLint fixups, and encourages users to configure VS Code to apply all ESLint fixups on save:
This setting tells VS Code "apply all fixups for the range covered by a diagnostic with source eslint". Thus, VS Code queries all code action providers for JavaScript that support source.fixAll code actions to see if they have fixes for diagnostics with "source" set to "eslint" -- including flow. These requests block prettier from running.
A workaround is to disable code actions entirely in Flow.
Link to Try-Flow or Github repo:
The text was updated successfully, but these errors were encountered:
Summary:
Telling the LSP client that we're a codeActionProvider means that it'll ask us for codeActions when the user hovers over errors. This'll let us provide quickfixes corresponding to type errors; specifically, the "Did you mean?" type error.
The codeActions we'll provide (both the existing "autofix exports" actions and the "did you mean?" actions being added in D20003667) will be quickfix CodeAction literals, so we initialize as a provider of quickfixes iff the client supports quickfix CodeAction literals.
Fixes#8277
Reviewed By: nmote
Differential Revision: D19919160
fbshipit-source-id: 32aa3dbcaa7d083fe5141557892fb8d8912d6ffe
See microsoft/vscode#89745 and flow/flow-for-vscode#375
Flow version: 0.107.0 (although it's the same in new versions)
Expected behavior
Flow advertises which
CodeActionKind
s it supports during initialization:https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction
Actual behavior
Flow advertises
true
orfalse
, telling VS Code that it may support all code actions.As a result, VS Code believes the Flow extension supports "source.fixAll" code actions, which is a non-standard code action that can block formatters like Prettier from running:
https://code.visualstudio.com/api/references/vscode-api#CodeActionKind
Since Flow can be slow to respond to code action requests when typechecking edits, users can see a multi-second wait before Prettier runs in VS Code.
This is only an issue if the user configures VS Code to apply "fixall" code actions before save. Unfortunately for Flow, the VS Code ESLint extension now uses
source.fixAll
code actions to surface ESLint fixups, and encourages users to configure VS Code to apply all ESLint fixups on save:https://github.com/Microsoft/vscode-eslint#release-notes
This setting tells VS Code "apply all fixups for the range covered by a diagnostic with source eslint". Thus, VS Code queries all code action providers for JavaScript that support
source.fixAll
code actions to see if they have fixes for diagnostics with "source" set to "eslint" -- including flow. These requests block prettier from running.A workaround is to disable code actions entirely in Flow.
The text was updated successfully, but these errors were encountered: