This repository has been archived by the owner on Jul 16, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a few things needed for windows support. Flow is pretty strict about what it expect to work, ideally this would also be fixed in Flow but for now we can workaround those things here.
For some reason vscode-uri normalizes drive letter to lowercase here https://github.com/Microsoft/vscode-uri/blob/master/lib/index.ts#L131 and this causes issues because Flow uses case sensitive paths even on Windows where it is not. As a workaround I implemented a super simple file uri parsing function that works for our use case and handles windows paths without lowercasing drive letter. Ideally this could be fixed upstream in vscode-uri but there might be a reason why they do this and will be a breaking change so doing this is a lot easier and less disruptive.
The flow binary under
node_modules/.bin
is actually flow.cmd and now flow.exeThe project root returned by the language server spec has a trailing slash and flow trips on it on Windows.
path.resolve
gets rid of it.Tested that the ide-flowtype extension using this patched version of flow-language-server works on windows and mac os (don't have linux setup but it should be different than mac os).