fix test URIs on windows (#8139)
commit85e071e1fcc4673b044af2d1f76f5ac01d8b1dca
authorMarshall Roch <mroch@fb.com>
Fri, 18 Oct 2019 19:17:50 +0000 (18 12:17 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 18 Oct 2019 19:20:13 +0000 (18 12:20 -0700)
tree854e1854abe21d5158ec4469791796b4471e2bcf
parentc282b7946be2d3b1a40e720f339d4c0eafc1510a
fix test URIs on windows (#8139)

Summary:
Pull Request resolved: https://github.com/facebook/flow/pull/8139

the tests were sending invalid URIs on Windows:

`C:\foo\bar` should become `file:///C%3A/foo/bar`, but was `file:///C:\foo\bar`. when decoded, the backslashes are escaped so this becomes a file named "C:\foo\bar" in the root directory.

since URIs always use forward slashes, `<PLACEHOLDER_PROJECT_URL_SLASH>` is redundant with `<PLACEHOLDER_PROJECT_URL>/`, so I replaced it.

node 10.12 added `url.pathToFileURL` which should do what we want here, but to avoid bumping the required node version, I went with `vscode-uri` instead.

Reviewed By: gabelevi, samwgoldman

Differential Revision: D18001370

fbshipit-source-id: 15f1cf19c164578ae4747c9c97dc911baeb80bf9
hphp/hack/src/utils/file_url/file_url.ml