Fixed lineBreak for arrowFunction#336
Closed
AndreasHoffmann2 wants to merge 1 commit into
Closed
Conversation
trullock
reviewed
Aug 19, 2022
Comment on lines
+3988
to
+3995
| if (node.FunctionType == FunctionType.ArrowFunction) | ||
| { | ||
| Output(')'); | ||
| } | ||
| else | ||
| { | ||
| OutputPossibleLineBreak(')'); | ||
| } |
Author
There was a problem hiding this comment.
Very sure: If you generate the code without this, you will get a compile-error for the generated code.
But I don't like the lack of elegance in this change either. I thought about creating a new overload for Output: Output(char, bool allowLineBreak). But I did not want to be too intrusive and had no better idea.
In fact, I was unable to reach the code in line 4003 below with the unit-tests. But I left the change there anyway, since it seems to be the better choice.
Author
|
We found several other issues with the line-breaks and are currently working on a generic test and the necessary fixes. Please do not merge this one for the moment. |
Author
|
Closed since we have a better test now: #338 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We ran into a syntax-error when using an arrow-function:

The line-break before "=>" should not be there.
Created a unit-test and fixed the issue.