Implement module formatting using JoinNodesBuilder#4808
Merged
Conversation
Member
Author
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Contributor
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinuxWindows |
MichaReiser
reviewed
Jun 2, 2023
Comment on lines
+13
to
+15
| f.join_nodes(NodeLevel::TopLevel) | ||
| .nodes(&item.body) | ||
| .finish()?; |
Member
There was a problem hiding this comment.
Should this use item.body.format().with_options(SuiteLevel::TopLevel) (The Suite formatting) so that it inserts the right amount of new lines before and after classes and functions?
The JoinNodesBuilder only maintains the same number of empty lines (up to 1 or 2) as in the source. The Vec<Stmt> formatting ensures that each function and class has an empty line before and after
f5521f0 to
d113ea6
Compare
This was referenced Jun 2, 2023
Merged
Merged
Merged
d113ea6 to
530cb36
Compare
MichaReiser
approved these changes
Jun 5, 2023
This uses JoinNodesBuilder to implement module formatting for #4800 See the snapshots for the changed behaviour. See one PR up for a CLI that i used to verify the trailing new line behaviour
konstin
added a commit
that referenced
this pull request
Jun 13, 2023
* Implement module formatting using JoinNodesBuilder This uses JoinNodesBuilder to implement module formatting for #4800 See the snapshots for the changed behaviour. See one PR up for a CLI that i used to verify the trailing new line behaviour
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.

This uses JoinNodesBuilder to implement module formatting for #4800
See the snapshots for the changed behaviour. See one PR up for a CLI that i used to verify the trailing new line behaviour