You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let inline(~%%)id = int id
letf a b = a + b
letfoo()= f %%"17"%%"42"
Result
let inline(~%%)id = int id
letf a b = a + b
letfoo()= f %%"17"%%"42"
Problem description
Fantomas adds a space between the prefix operator and the string. Note that this only happens when the string is specified after the operator. If a value is used, then formatting does not add a space.
This works correctly:
let inline(~%%)id = int id
letf a b = a + b
letv=17letw=42letfoo()= f %%v %%w
The current workaround is to add ( ) around the operator and value.
We use this in our tests to setup data; that's why we use strings there, not values containing strings.
It would also be more consistent never to add a space (as far as I understand it, a space is only added when the prefix operator is followed by a string definition)
Extra information
The formatted result breaks my code.
The formatted result gives compiler warnings.
I or my company would be willing to help fix this.
Options
Fantomas v5.2 branch at 1/1/1990
Default Fantomas configuration
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?
The text was updated successfully, but these errors were encountered:
as far as I understand it, a space is only added when the prefix operator is followed by a string definition
That faintly rings a bell, I believe we at some point added this because of the operator we use in Fantomas. let (!-) (s: string) = ... where !- "foo" was preferred over !-"foo".
Short term, I would accept a fix that takes the % character into account when dealing with a prefix operator. Long term, there should be guidance from the style guide for this matter.
Issue created from fantomas-online
Code
Result
Problem description
Fantomas adds a space between the prefix operator and the string. Note that this only happens when the string is specified after the operator. If a value is used, then formatting does not add a space.
This works correctly:
The current workaround is to add ( ) around the operator and value.
We use this in our tests to setup data; that's why we use strings there, not values containing strings.
It would also be more consistent never to add a space (as far as I understand it, a space is only added when the prefix operator is followed by a string definition)
Extra information
Options
Fantomas v5.2 branch at 1/1/1990
Default Fantomas configuration
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?
The text was updated successfully, but these errors were encountered: