fsprojects / fantomas

FSharp source code formatter
https://fsprojects.github.io/fantomas
Other
770 stars 191 forks source link

Format on Save Not Working - As of April 2022, VS Code no longer has the "editor.formatOnSaveTimeout" json setting #2268

Closed ed3899 closed 2 years ago

ed3899 commented 2 years ago

1- Install the VS Code Ionide Plugins image

2 - Install the VS Code Fantomas extension globally 3 - Create an Fsharp file 4 - Try saving

image

Settings.json

image

VS CODE VERSION April 2022 (version 1.67)

nojaf commented 2 years ago

Hello,

Please don't report issues about Ionide in this repository. If there is a problem with the integration you can always open an issue over at https://github.com/ionide/ionide-vscode-fsharp.

Fantomas needs a valid F# file to be able to format. This looks very suspicious image Your match appears to have an extra space.

Please use our online tool to report actual Fantomas problems.

ed3899 commented 2 years ago

Hello,

Please don't report issues about Ionide in this repository. If there is a problem with the integration you can always open an issue over at https://github.com/ionide/ionide-vscode-fsharp.

Fantomas needs a valid F# file to be able to format. This looks very suspicious image Your match appears to have an extra space.

Please use our online tool to report actual Fantomas problems.

You're right,I did that on purpose hoping for fantomas to adequately format it but it didn't

nojaf commented 2 years ago

This is an established limitation of Fantomas: you need a valid syntax tree before it can be formatted.

ed3899 commented 2 years ago

This is an established limitation of Fantomas: you need a valid syntax tree before it can be formatted.

I tried running it again , no success yet.

image

And if I try that on the Fantomas online tool: https://fsprojects.github.io/fantomas-tools/#/fantomas/preview?data=N4KABGBEDGD2AmBTSAuKAbRAXMXYAUBLAcwBkBDLQgOwAoB3WAJ3hQGcsmbiBKMAXjAAdJkOoQImHITYA1WPUTpa0FNAAW5Jn34ixEg2AC2lDWGhh6hLOr3jDEAD5gA5ORdhnLxB6%2BFfLrABAK4udg5OrgCCvq4AorEuAJKJAPKJAKoeALQAfLhMwYjhEY4A%2BmB5YABm5OhsxaL2EITVYDLyiuiWzPAAdADaAAwAurjqiNQlDowsYADUwpAAnuTLQpDTYEoNWwaz-QMAjH19Y4scXNTEDL2Do3yLG2sbkAA04FANWFTXbKhgAafCCgByQAAkWGWAAdkGhIDQsO9gRIIQA3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9KdpxnMhYErKtMGrGta9FusM-l8ZGybhBm4g3u%2Bzbdul9LXrlYS1fLOnmdYO7Pd9wPlB%2B3FAep0HTAhxDmrt4XncWiXq29fBBjaoNhIfbI7pTjQ8DcNngu3ppecSNdrXte2xex4f8fHxI2qbefRUJZ9piSptfEkd8t4P1zjvPKi0DYH1NM9X%2BEBtRvUAQqA6sAsAAHFsAkzJogCmVN76ASvM-ZkBc4GIwNkVEeDtDDakxufD2vcVRTm8tAAA1lONeXDsBsFSNQcky5eIpmVtTXEUlLovyoW1IutDur0PRl6dmhIqw1nYdgRQkxbawiOrjag1gqZRBJIZRurcpF%2BVgfIvey0npH2zNqWWE9azEGoMA6goD-yUncZQYImFvqwGJKSLAlAqZmWahHN%2BCjjxKO-mXL0ztXGjWoOEtEqp-zEHMSZJgBiaDGOEpEiydMrId3gXE8KCTR6MKTiwnugYKDGXgOQPisBKbXA0X3YpMjKFlN3hUuyK0kGONxDmWKhICFrhOpMMJ6AADSiBEDQhCbM4kvDyBeOgVYqJpT5rlJoZU4ZsZkHZhzOPCIkAOGbK4YGNgO09okirBwRA8A56e3tAQ8mlMim3lmns%2BGBz9ZHIcT-M5Z9LlTi0FVRAB0ZDQC4BNNJKV4AZCMf%2BI60B%2BKpz-JIiI0ibHvyUl1KpIywVjIAZcqZiLZl1EdLtYIIloSOmWM6JqJT879OocC-eX8yWJMMDmdBlzFnLI%2Bg3XJNprnUFuSqSxkohgULAK-UW0dxZ0OqQwgwOZmGXPpXVWeCAgw7I5bIw0nwRh0gRGwEslMAQEtZEAA

It worked:

image Any idea of what's going on with the Vs code extension?

nojaf commented 2 years ago

No, I don't and please open an issue at https://github.com/ionide/ionide-vscode-fsharp for this.