-
-
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
Refactor preserve eol with trivia #434
Conversation
@jindraivanek I've encountered something tricky while inserting newlines that have been found. F.ex type C () =
let rec g x = h x
and h x = g x
member x.P = g 3 We print this in CodePrinter with 2 newlines after the However, those newlines are also found in the tokens. So the test fails like:
This all makes sense but how will be ignore found newlines in the trivia when we are already printing them? |
@nojaf I think we need to change |
Yeah thought of that as well. However, that could lead to a tricky situation where you have a mix of newlines and comments. Worth investigating though. |
Fix test: "multiple let in lines, should remove in, block comment"
When merging only split on valid hash directives.
… them to tokenize function.
… and add them to tokenize function." This reverts commit 88ffab0.
This reverts commit 459c1e5.
This reverts commit 72b0d0a.
…e line above. Else find the last (smallest) node from the end of the line above.
Skipping trailing newlines from trivia.
# Conflicts: # src/Fantomas/Context.fs
Suggestion to tackle #390
In essence, we collect information from the F# tokens that are not present in the AST (comments, newlines, keywords, ...) and we use to information in CodePrinter to restore the original behaviour.