Skip to content

fix: deconflict for duplicate canonical names#365

Merged
Boshen merged 1 commit into
mainfrom
11-22-fix_deconflict_for_duplicate_canonical_names
Nov 27, 2023
Merged

fix: deconflict for duplicate canonical names#365
Boshen merged 1 commit into
mainfrom
11-22-fix_deconflict_for_duplicate_canonical_names

Conversation

@hyfdev

@hyfdev hyfdev commented Nov 22, 2023

Copy link
Copy Markdown
Member

Description

Fixes #364

Test Plan


};
while self.used_canonical_names.contains(&canonical_name) {
*count += 1;
canonical_name = Cow::Owned(format!("{}${}", original_name, *count).into());

@underfin underfin Nov 22, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Boshen commented Nov 27, 2023

Copy link
Copy Markdown
Member

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
@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