Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format class declarations. #1309

Merged
merged 5 commits into from
Nov 3, 2023
Merged

Format class declarations. #1309

merged 5 commits into from
Nov 3, 2023

Conversation

munificent
Copy link
Member

This handles all of the stuff that can appear outside of the braces in a class declaration:

  • The class keyword and any class modifiers.
  • The name.
  • Type parameters, if any.
  • The extends, with, and/or implements clauses.
  • The native clause.

It doesn't handle members yet.

It also handles ensuring there is a blank line before and after class declarations. In the process of doing that, I also migrated over similar code for function declarations where we ensure there is a blank line after non-empty functions.

For imports and exports, there is logic around how to split and format
the "show" and "hide" combinators. I plan to use the same logic for
"extends", "implements", and "with" clauses in classes so this
generalizes that code to not be specific to imports.

It's also a little simpler and cleaner now.
This handles all of the stuff that can appear outside of the braces in
a class declaration:

- The `class` keyword and any class modifiers.
- The name.
- Type parameters, if any.
- The `extends`, `with`, and/or `implements` clauses.
- The `native` clause.

It doesn't handle members yet.

It also handles ensuring there is a blank line before and after class
declarations. In the process of doing that, I also migrated over similar
code for function declarations where we ensure there is a blank line
after non-empty functions.
Base automatically changed from generalize-clauses to main November 2, 2023 23:56
# Conflicts:
#	lib/src/piece/clause.dart
lib/src/front_end/ast_node_visitor.dart Outdated Show resolved Hide resolved
lib/src/piece/type.dart Show resolved Hide resolved
@munificent munificent merged commit d55da0b into main Nov 3, 2023
7 checks passed
@munificent munificent deleted the format-classes branch November 3, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants