Tags: opt9/flow
Tags
[spreads][rfc] Unify OpenTs in widen_type Summary: Creating all of these new OpenTs can pose a performance problem. The added test case takes ~20 seconds without unification here, but is almost instant when there is unification. The final type-at-pos result is still just quadratic in both cases. I've observed the slowdown to occur during the OpenT ~> OpenT flow. I think so many OpenTs are created that even just forwarding the flows takes a long time without unification. If it's not safe to unify here in general, I made a special reason desc for OpenTs created during widening and only Flow/Unify to the OpenTs in widening if that tvar was created by the widening process. Otherwise, we create a new OpenT with the special reason desc and use that type. Note that the overall perf impact here is neutral, even though it speeds up this specific case. Reviewed By: avikchaudhuri Differential Revision: D17798281 fbshipit-source-id: 4223ce891ceab44dbab72da10cce0caf27c2c4e1
[hack] fix File_url slashes on Windows Summary: Pull Request resolved: facebook#8142 previously, `File_url.parse "file:///c%3A/foo/bar"` returned `"c:/foo/bar"` instead of `"c:\foo\bar"`, because `/` and `\` are (generally) interchangeable on Windows. however, `Sys_utils.realpath` does convert them to `\` (only if the file exists, otherwise it leaves it alone!), which makes it more difficult to compare two paths. so, we now match `realpath`'s behavior, converting `/` to `\` on Windows. also, `File_url.create "c:\foo\bar"` returns `"file:///c%3A/foo/bar"` on Windows, but on Linux, `\` is a valid path character and should be escaped, like `"file:///c%3A%5Cfoo%5Cbar"`. Reviewed By: gabelevi, samwgoldman Differential Revision: D18024985 fbshipit-source-id: 2f09b7f3587a0b01a3ee9ab935ed67cc0d308164
Fix source of flakiness for lsp/completion test
Summary:
I noticed that {D17584973} failed this test. I think it was a source of flakiness. Most of the test cases look like
1. Add `jsx.js` (which has syntax errors)
2. Start the lsp server and server
3. Send a completion request
4. Assert the response matches.
When the lsp starts up, it will see the syntax errors and send the `textDocument/publishDiagnostics` message to the client. Usually this happens between steps 2 and 3. But if it happens after 3 then the step 4 assertion would fail like this:
```
+ textDocument/publishDiagnostics,textDocument/completion{"isIncomplete":false,"items":[{"label":"a","kind":6,"detail":"number","inlineDetail":"number","insertTextFormat":1}]}
- textDocument/completion{"isIncomplete":false,"items":[{"label":"a","kind":6,"detail":"number","inlineDetail":"number","insertTextFormat":1}]}
```
(Full logs: P113545680)
Easy fix. Just ignore those messages
Reviewed By: nmote
Differential Revision: D17602294
fbshipit-source-id: 7c6f2a7ae84f5d3caffae90fdaacc0e57ea46775
PreviousNext