Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No longer error when formatting invalid syntax
Summary: If LSP issues a formatting request at a given line+char, but we can't calculate a better format for the file at this time due to syntax errors in it, what should we do? Previously we returned an error response to the request because the code wasn't syntactically valid (which happens an awful lot of the time while you're typing!) I reckon we should instead return "success and there are no edits to apply". That feels more in keeping with the LSP attitude of not caring at all about the meaning of the language. It's also nice because it means our logs will no longer be dominated by failed-to-parse errors. (Syntax errors are properly reported to the user via publishDiagnostics. I don't think they should also be reported to the formatting routines within VSCode/Atom). Reviewed By: arxanas Differential Revision: D7686887 fbshipit-source-id: e7f2bb72d0777e85dab0e10ed9998366fe086470
- Loading branch information