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

fixed sort (use & mod) method in formatter #6438

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dean-starkware
Copy link
Collaborator

@dean-starkware dean-starkware commented Sep 30, 2024

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 0 of 11 files reviewed, 5 unresolved discussions (waiting on @Arcticae, @dean-starkware, @Draggu, @mkaput, and @piotmag769)


crates/cairo-lang-formatter/src/formatter_impl.rs line 828 at r1 (raw file):

    }

    fn sort_inner_use_paths_in_place(multi_path: &ast::UsePathMulti, db: &dyn SyntaxGroup) {

doc.


crates/cairo-lang-formatter/src/formatter_impl.rs line 863 at r1 (raw file):

    }

    fn sort_and_append_group<'b>(

doc


crates/cairo-lang-formatter/src/formatter_impl.rs line 914 at r1 (raw file):

        let allowed_empty_between = syntax_node.allowed_empty_between(self.db);
        let internal_break_line_points_positions =
            syntax_node.get_internal_break_line_point_properties(self.db);

if used only in branch - init in branch.

Code quote:

        let allowed_empty_between = syntax_node.allowed_empty_between(self.db);
        let internal_break_line_points_positions =
            syntax_node.get_internal_break_line_point_properties(self.db);

crates/cairo-lang-formatter/src/formatter_impl.rs line 918 at r1 (raw file):

        let n_children = children.len();
        if self.config.sort_module_level_items {
            let mut sorted_children = Vec::new();

extract to function.


crates/cairo-lang-formatter/src/formatter_impl.rs line 1038 at r1 (raw file):

            // Replace the children with the sorted result:
            // children = sorted_children.into_iter().cloned().collect();
            children.sort_by_key(|c| MovableNode::new(self.db, c));

?

Code quote:

            // Replace the children with the sorted result:
            // children = sorted_children.into_iter().cloned().collect();
            children.sort_by_key(|c| MovableNode::new(self.db, c));

Copy link
Collaborator Author

@dean-starkware dean-starkware left a comment

Choose a reason for hiding this comment

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

It's not ready for review yet.
This is why there isn't any reviewer...
It's for debugging purposes only.

Reviewable status: 0 of 11 files reviewed, 5 unresolved discussions (waiting on @Arcticae, @Draggu, @mkaput, and @piotmag769)

@dean-starkware dean-starkware reopened this Oct 2, 2024
@dean-starkware dean-starkware marked this pull request as draft October 2, 2024 06:28
@piotmag769 piotmag769 removed their request for review October 2, 2024 10:31
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.

2 participants