add base list before trailing trivia#2760
Merged
mattwar merged 3 commits intodotnet:masterfrom May 15, 2015
mattwar:Bug293
Merged
add base list before trailing trivia#2760mattwar merged 3 commits intodotnet:masterfrom mattwar:Bug293
mattwar merged 3 commits intodotnet:masterfrom
mattwar:Bug293
Conversation
Member
|
@dotnet-bot test this please |
Contributor
Author
Contributor
|
👍 |
mattwar
added a commit
that referenced
this pull request
May 15, 2015
add base list before trailing trivia
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.
Fixes #293
This turned out not to be a formatter problem specifically, but one of a class of problems that plague manipulation of existing trees. The formatter had no indentation rule for base lists, but the real problem was that the SyntaxGenerator did not take into account existing trivia before adding the base list. The typical case when adding base list to existing class declaration is to have at least EOL trivia after the identifier (if following the default formatter style), and that EOL still existed after adding the base list to the class declaration, forcing the base list down the next line.
The fix is to insert the base list before the trailing trivia on the line, and then let the formatter have it.
@Pilchie @srivatsn please review