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
Typically comments at the end of file stay there after formatting (see test), but if the comment is a multi line one ((* . . . *) block) and the the previous line is a function application, the comment is moved between function call and parameters.
Code
printfn "Hello World"(* This is a comment. *)
Result
printfn
(* This is a comment. *)"Hello World"
Expected Result
printfn "Hello World"(* This is a comment. *)
Note that with a single line comment (//) it works properly.
Options
Fantomas Next - 4.0.0-alpha-001-1/1/1990
Name
Value
IndentSpaceNum
4
PageWidth
120
SemicolonAtEndOfLine
false
SpaceBeforeParameter
true
SpaceBeforeLowercaseInvocation
true
SpaceBeforeUppercaseInvocation
false
SpaceBeforeClassConstructor
false
SpaceBeforeMember
false
SpaceBeforeColon
false
SpaceAfterComma
true
SpaceBeforeSemicolon
false
SpaceAfterSemicolon
true
IndentOnTryWith
false
SpaceAroundDelimiter
true
MaxIfThenElseShortWidth
40
MaxInfixOperatorExpression
50
MaxRecordWidth
40
MaxArrayOrListWidth
40
MaxLetBindingWidth
40
MultilineBlockBracketsOnSameColumn
false
NewlineBetweenTypeDefinitionAndMembers
false
StrictMode
false
The text was updated successfully, but these errors were encountered:
Hello, this is a trivia bug. The block comment is now being assigned to the printfn Ident instead of the SynConst.String.
The problem occurs when the trivia is being assigned to a trivia node.
I think the addTriviaToTriviaNode case should be extended to support scenarios where the comment is the last line of the file.
Maybe it automatically should be assigned to the SynModule.
Issue created from fantomas-online
Typically comments at the end of file stay there after formatting (see test), but if the comment is a multi line one (
(* . . . *)
block) and the the previous line is a function application, the comment is moved between function call and parameters.Code
Result
Expected Result
Note that with a single line comment (
//
) it works properly.Options
Fantomas Next - 4.0.0-alpha-001-1/1/1990
IndentSpaceNum
4
PageWidth
120
SemicolonAtEndOfLine
false
SpaceBeforeParameter
true
SpaceBeforeLowercaseInvocation
true
SpaceBeforeUppercaseInvocation
false
SpaceBeforeClassConstructor
false
SpaceBeforeMember
false
SpaceBeforeColon
false
SpaceAfterComma
true
SpaceBeforeSemicolon
false
SpaceAfterSemicolon
true
IndentOnTryWith
false
SpaceAroundDelimiter
true
MaxIfThenElseShortWidth
40
MaxInfixOperatorExpression
50
MaxRecordWidth
40
MaxArrayOrListWidth
40
MaxLetBindingWidth
40
MultilineBlockBracketsOnSameColumn
false
NewlineBetweenTypeDefinitionAndMembers
false
StrictMode
false
The text was updated successfully, but these errors were encountered: