-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comment on first constructor argument gets removed #1350
Comments
Hello @Evangelink, thanks for opening a new issue. Much appreciated. fantomas/src/Fantomas/CodePrinter.fs Line 1924 in d5f4d9f
and fantomas/src/Fantomas/CodePrinter.fs Line 1933 in d5f4d9f
genTriviaFor SynExpr_Tuple rangeOfTuple could print the trivia.
The fantomas/src/Fantomas/SourceParser.fs Line 734 in d5f4d9f
fantomas/src/Fantomas/SourceParser.fs Line 800 in d5f4d9f
Would you be interested in submitting a PR? |
Yes I am :) I will have a look at this during the week-end and might ping for some support if that's ok. |
Yeah sure, sounds good. |
@nojaf Apologies for the delay, I had a look yesterday and there is something I don't get.
What I understand is to change: | SynExpr.Tuple (false, exprs, _, _) -> Some exprs into: | SynExpr.Tuple (false, exprs, _, rangeOfTuple) -> Some(exprs, rangeOfTuple) and to make it surface on the But I don't get if I am supposed to add one more object to the return or if I am supposed to do some merge with some of the range. Current code: | App (e, [ (Paren (lpr, Tuple args, rpr)) ]) -> Some(e, lpr, args, rpr) New code: | App (e, [ (Paren (lpr, Tuple (args, rangeOfTuple), rpr)) ]) -> Some(e, lpr, args, rpr) // What to do with 'rangeOfTuple' |
Sorry just forgot to post progress, as you can see on the PR I have the start of something but I get the comment set twice before and after the syntax element. Not gonna lie, I haven't understood enough of the code to actually manage to see what's wrong or even how to see what's wrong... |
Issue created from fantomas-online
Code
Result
Problem description
Fantomas seems to remove comment placed on top of the first argument to a constructor call.
Extra information
Options
Fantomas Master at 01/05/2021 21:00:18 - d5f4d9f
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: