Skip to content

Conversation

@Young-Flash
Copy link
Member

@Young-Flash Young-Flash commented Dec 3, 2025

The changes for this migration are a bit more extensive than before, as some method calls indirectly use ted::* api

part of #18285

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 3, 2025
@Young-Flash Young-Flash marked this pull request as draft December 3, 2025 12:20
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 3, 2025
@Young-Flash Young-Flash force-pushed the migrate_generate_delegate_trait branch from 5e796b9 to d10843a Compare December 3, 2025 15:53
@Young-Flash Young-Flash force-pushed the migrate_generate_delegate_trait branch from d10843a to 1a5d1bf Compare December 4, 2025 15:30
@Young-Flash Young-Flash marked this pull request as ready for review December 4, 2025 15:42
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 4, 2025
@@ -254,51 +256,47 @@ fn generate_impl(
delegee: &Delegee,
edition: Edition,
) -> Option<ast::Impl> {
let make = SyntaxFactory::without_mappings();
Copy link
Member

Choose a reason for hiding this comment

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

Don't we need mapping here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This assist generates entirely new code (a new impl block) rather than editing existing syntax. Mappings are needed when using SourceChangeBuilder::make_editor() to edit existing syntax trees, where we need to track the relationship between original and new nodes for features like snippet placeholders. Since we're doing pure code generation, the mapping overhead is unnecessary.

Here is my understanding, is that right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants