Open Minnozz opened 8 months ago
This looks like you are using an older (globally installed?) version of the formatter. I don't have this behavior.
Seems like it should not be possible to use a globally installed formatter: https://github.com/rescript-lang/rescript-vscode/blob/51b6c46abe283f7adad606e2bd43ca46210c85e9/server/src/utils.ts#L91-L92
It shouldn't look outside of the project root for the bsc
binary:
https://github.com/rescript-lang/rescript-vscode/blob/51b6c46abe283f7adad606e2bd43ca46210c85e9/server/src/server.ts#L775-L776
I've manually run the commands that the extension runs:
node_modules/.bin/bsc -color never -format Foo.res
formats correctlychenglou92.rescript-vscode/server/analysis_binaries/linux/rescript-editor-analysis.exe format Foo.res
breaks the codeSo for some reason, in my setup (which is unconventional due to NixOS), bsc
can't be found and the shipped rescript-editor-analysis.exe
binary is used for formatting, which has different semantics than bsc
.
Not 100 % sure, but I heard the parser itself still defaults to curried output. @cknitt may know more.
Also, did you try one of these?
// Path to the directory where cross-platform ReScript binaries are. You can use it if you haven't or don't want to use the installed ReScript from node_modules in your project.
"rescript.settings.binaryPath": null
// Path to the directory where platform-specific ReScript binaries are. You can use it if you haven't or don't want to use the installed ReScript from node_modules in your project.
"rescript.settings.platformPath": null
When I compile this code with rescript v11.0.1, it works fine.
npx rescript format -all
does not change it:When I use the
Format document
action in VSCode with thev1.38.0
version of the extension, it is changed to this:This does not compile: