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 instance creation expressions (constructor calls). #1307

Merged
merged 3 commits into from
Nov 2, 2023

Conversation

munificent
Copy link
Member

Simple constructor calls behave exactly like normal function calls and use the same formatting code for their argument list.

Prefixed and/or named constructor calls are formatted sort of like method/property chains where they may split at the ".". We don't have full support for method/property chains yet, but this starts sketching that out enough to get the instance creation expression tests passing.

Simple constructor calls behave exactly like normal function calls and
use the same formatting code for their argument list.

Prefixed and/or named constructor calls are formatted sort of like
method/property chains where they may split at the ".". We don't have
full support for method/property chains yet, but this starts sketching
that out enough to get the instance creation expression tests passing.
lib/src/front_end/ast_node_visitor.dart Outdated Show resolved Hide resolved
///
/// This piece handles splitting before the `.`.
class ChainPiece extends Piece {
/// The series of calls.
Copy link
Member

Choose a reason for hiding this comment

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

Similar here. A function tearoff isn't a "call" for instance.

lib/src/front_end/ast_node_visitor.dart Outdated Show resolved Hide resolved
@munificent munificent merged commit 03add6a into main Nov 2, 2023
6 checks passed
@munificent munificent deleted the format-instance-creation branch November 2, 2023 23:32
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