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
If you send a textDocument/didSave event to the flow language server, you will get some diagnostic information revealing some type errors, like so:
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/w0rp/Downloads/ale-flow/demo.js","diagnostics":[{"range":{"start":{"line":3,"character":13},"end":{"line":3,"character":24}},"severity":1,"code":"InferError","source":"Flow","message":"Cannot assign object literal to `a` because property `a` is missing in object literal [1] but exists in `A` [2].","relatedInformation":[{"location":{"uri":"file:///home/w0rp/Downloads/ale-flow/demo.js","range":{"start":{"line":3,"character":13},"end":{"line":3,"character":24}}},"message":"[1] object literal"},{"location":{"uri":"file:///home/w0rp/Downloads/ale-flow/demo.js","range":{"start":{"line":3,"character":9},"end":{"line":3,"character":10}}},"message":"[2] `A`"}],"relatedLocations":[{"location":{"uri":"file:///home/w0rp/Downloads/ale-flow/demo.js","range":{"start":{"line":3,"character":13},"end":{"line":3,"character":24}}},"message":"[1] object literal"},{"location":{"uri":"file:///home/w0rp/Downloads/ale-flow/demo.js","range":{"start":{"line":3,"character":9},"end":{"line":3,"character":10}}},"message":"[2] `A`"}]}]}}
Sending a textDocument/didChange event with the contents of the entire file will cause flow to respond with no errors, like so.
This seems to be broken since 0.83.0. What flow should do instead is return the same error messages in both cases. If there are errors that can only be resolved after saving the file, those errors should be returned in response to the textDocument/didChange event until the next textDocument/didSave event is sent.
joeybaker, villesau, badeleux, agreene-coursera, LukeChannings and 5 more