Add tests for indentation around C# 9 patterns.#43606
Merged
1 commit merged intodotnet:features/patterns3from Apr 27, 2020
Merged
Add tests for indentation around C# 9 patterns.#436061 commit merged intodotnet:features/patterns3from
1 commit merged intodotnet:features/patterns3from
Conversation
dpoeschl
commented
Apr 23, 2020
| var y = x switch | ||
| {{ | ||
| {line1} | ||
| {line2} => true, |
Contributor
Author
There was a problem hiding this comment.
I'm not sure whether straight alignment (12, the actual value) is expected or one more indented (16) would be better. The current behavior (12) matches what happens in switches for regular boolean expressions, so having these similar patterns behave the same way seems fine for now to me.
Contributor
There was a problem hiding this comment.
one more woudl be preferred. but if you're matching boolean exprs that's ok.
| [InlineData("x is < 7 and (>= 3 or > 50) or not", "<= 0;", 12)] | ||
| [InlineData("x is < 7 and (>= 3 or > 50) or not <=", "0;", 12)] | ||
| [InlineData("x is < 7 and (>= 3 or > 50) or not <= 0", ";", 12)] | ||
| public async Task IndentPatternsInLocalDeclarationCSharp9(string line1, string line2, int expectedIndentation) |
Contributor
There was a problem hiding this comment.
since the indentation is always the same, might want to take that out of hte inline data and make it more clearly part of the expected result.
29 tasks
CyrusNajmabadi
approved these changes
Apr 27, 2020
This pull request was closed.
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.
No description provided.