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

fix: deconflict for duplicate canonical names #365

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

hyf0
Copy link
Member

@hyf0 hyf0 commented Nov 22, 2023

Description

Fixes #364

Test Plan


@hyf0 hyf0 mentioned this pull request Nov 22, 2023
} else {
Cow::Owned(format!("{}${}", original_name, *count).into())
};
while self.used_canonical_names.contains(&canonical_name) {
*count += 1;
canonical_name = Cow::Owned(format!("{}${}", original_name, *count).into());
Copy link
Contributor

@underfin underfin Nov 22, 2023

Choose a reason for hiding this comment

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

The fix can be work, but it isn't efficient at some cases. If the scope has a/a$1/a$2 symbols declared. The fix will caused a/a$1/a$2 every symbol need rename. Please read the esbuild implementiontion, it will only rename once a -> a$3.

Copy link
Member Author

Choose a reason for hiding this comment

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

From my point of view, it's efficient enough. Feel free to open a team meeting for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I remember we need to follow esbuild implementation, it will reduce our different ideas.

Copy link
Contributor

Choose a reason for hiding this comment

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

Here has lots of issue need to merge, I just approved it. I open a new issue to track this #389.

Copy link
Member

Boshen commented Nov 27, 2023

Merge activity

  • Nov 26, 10:26 PM: @Boshen started a stack merge that includes this pull request via Graphite.
  • Nov 26, 10:26 PM: @Boshen merged this pull request with Graphite.

@Boshen Boshen merged commit eebea46 into main Nov 27, 2023
6 checks passed
@Boshen Boshen deleted the 11-22-fix_deconflict_for_duplicate_canonical_names branch November 27, 2023 03:26
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.

Bug: should generate conflict-less name for duplicated generated names
3 participants