ormolu
ormolu copied to clipboard
Provide a way to determine which version of ormolu is formatting a document?
Is your feature request related to a problem? Please describe.
It can be difficult to get all developers on a single release of Ormolu (e.g., users of VSCode apparently have no idea what version they’re using, and no way to change it).
When running ormolu from the command line, I can run ormolu --version to find out what version I'm using. But if I just have the ormolu library, built into HLS, managed by a VSCode extension, I don't know how to find out what version of ormolu my document is being formatted with.
Describe the solution you'd like
Add another magic comment: {- ORMOLU_VERSION -} be replaced by the version string in some capacity
e.g. {- ORMOLU_VERSION -} becomes {- ORMOLU_VERSION 0.7.6.0 -}
or something like that.
Describe alternatives you've considered
Not sure if {- ORMOLU_VERSION 0.7.6.0 -} should be changed, if it's being formatted by a different version of ormolu, or not.
Additional context
Also see https://github.com/tweag/ormolu/issues/1126#issuecomment-2204522326 which might address the underlying problem that the "integrated" HLS Ormolu support is not optimal.