Skip to content

Fix formatting for multi-line patterns#46292

Merged
sharwell merged 4 commits intodotnet:masterfrom
sharwell:pattern-format
Jul 29, 2020
Merged

Fix formatting for multi-line patterns#46292
sharwell merged 4 commits intodotnet:masterfrom
sharwell:pattern-format

Conversation

@sharwell
Copy link
Contributor

Fixes #42861
Fixes #46284

@sharwell sharwell requested a review from a team as a code owner July 24, 2020 00:53
/// Mask for position options
/// </summary>
PositionMask = RelativeToFirstTokenOnBaseTokenLine | RelativePosition | AbsolutePosition
PositionMask = RelativeToFirstTokenOnBaseTokenLine | RelativePosition | AbsolutePosition,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should actually doc why this doesn't cover the item below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indirectly documented. Let me know if it works.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, not seeing it, even after rereviewing things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IndentIfConditionOfAnchorToken is not a primary behavior.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be documented. the problem with the code/comemtns as they exist today is that i cannot come back and determine if this is an intentional or accidental omission. i.e. the comment says "specifies one of the position options to indicate the primary behavior for the operation." First, i don't know what "primary behavior" means. Second, i have no way to tell if 'IndentIfConditionOfAnchorToken' is not primary, and thus is appropraite not in this list, or if it is primary, and this is just a mistake.

This is a prime example of why more is more when it comes to certain types of comments. Just being explicit about intentions here goes a long way for future maintainability.

@sharwell sharwell merged commit 729c5be into dotnet:master Jul 29, 2020
@ghost ghost added this to the Next milestone Jul 29, 2020
@sharwell sharwell deleted the pattern-format branch July 29, 2020 03:28
@RikkiGibson RikkiGibson modified the milestones: Next, 16.8.P2 Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad formatting for pattern block Forced formatting on property patterns makes them unsuitable in nested-expression locations.

4 participants