-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't run flow in cmd when VS Code is open in Windows #6592
Comments
After some quick skimming I didn't find where the uppercase flow/src/server/commandHandler.ml Line 29 in 347281f
I guess the paths could be normalized to lowercase before comparing on windows? Not 100% sure it wouldn't have negative effects, but feel free to PR and ping me. For reference this PR does a check to discern platform: #6573 |
Has a solution/workaround been discovered for this issue? |
Any news on this? |
that should be fine since on Windows paths aren't case sensitive, as it happens to be on Linux. |
You can also run |
Same issue here - windows 10. |
Any chances to give that issue priority? That would so much improve dev experience on Windows. The fix should be quite straightforward, as Windows paths are case insensitive, which means that on win platform all paths can be simply lowercased before comparison. It's just the OCaml thing that stops from making a PR... Too stupid, sorry 😥 |
@ArmorDarks did you try running |
@edele Yeap, |
@ArmorDarks which issue? IIRC, the issue with running So which issue are you talking about? 🙂 |
@edele you really force me to link you to your own comment, which exactly describes the issue #6592 (comment) |
Some may find this helpful https://gist.github.com/edele/540b2ccb2e773e18e19a3e489336126b You close VS Code, run |
Same issue at our place too, and using either https://github.com/jstwister/vscode-flow-ide or https://github.com/flowtype/flow-for-vscode both have this issue. It's highly annoying for wanting to run flow from any command line as an Literally the only difference between |
As a workaround, one could just pass |
Summary: Windows file systems are case-insensitive (technically, case-preserving). VS Code sends all requests with a lowercase drive letter, like `file://c%3B/Users/...`, which gets decoded into `c:\Users\...`, but we normalize everything through `Path.make` which calls `Sys_utils.realpath` which (on Windows) calls `_fullpath`, which returns an uppercase drive letter. we use filenames as keys all over, and obviously strings are case sensitive, so `c:\Users\...` and `C:\Users\...` end up being different internally. so, to make sure everyone agrees, we'll uppercase the drive letter when we decode LSP URIs, and lowercase it when we generate URIs. Fixes #6592 Pull Request resolved: #8531 Reviewed By: nmote Differential Revision: D24893421 (cb32f21) fbshipit-source-id: 39b1f34298bc719ddf80ee774338e492814e7b3d
The only difference is
C
andc
drive letters:But I think paths are the same because Windows paths are case-insensitive.
server_root
was created by Flow Language Support for VS Code. And the error is thrown whenever I runyarn run flow
in cmd.exe to see full list of errors in a project.Looks like the issue originates in vscode.TextDocument.uri.fsPath which "normalizes" drive letter to lowercase according to documentation: https://code.visualstudio.com/docs/extensionAPI/vscode-api#Uri
Still thinking on a possible solution.
server_root
andclient_root
are the same just for Windows?BTW. Just look at Microsoft nowadays. It's modern vibe feels so good. We have to consider Windows as a viable platform now.
The text was updated successfully, but these errors were encountered: