Skip to content

internal: Migrate generate_default_from_new assist to SyntaxEditor#21874

Open
Biruk-gebru wants to merge 1 commit intorust-lang:masterfrom
Biruk-gebru:migrate-generate-default-from-new-to-syntax-editor
Open

internal: Migrate generate_default_from_new assist to SyntaxEditor#21874
Biruk-gebru wants to merge 1 commit intorust-lang:masterfrom
Biruk-gebru:migrate-generate-default-from-new-to-syntax-editor

Conversation

@Biruk-gebru
Copy link

@Biruk-gebru Biruk-gebru commented Mar 25, 2026

Migrate generate_default_from_new from direct text insertion via builder.insert() to SyntaxEditor-based node insertion.

  • Replace string-building generate_trait_impl_text_from_impl() with make::impl_trait() AST construction
  • Use builder.make_editor() + editor.insert_all(Position::after(...)) for insertion
  • Fixes indentation of generated impl inside modules (previously unindented)

Part of #18285

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 25, 2026
@rustbot

This comment has been minimized.

Replace direct text insertion via `builder.insert()` with
`SyntaxEditor`-based node insertion. Build the Default impl as a
proper AST node using `make::impl_trait` instead of string
concatenation with `format_to!`.

Part of rust-lang#18285
@Biruk-gebru Biruk-gebru force-pushed the migrate-generate-default-from-new-to-syntax-editor branch from 3488a96 to a6b2fe8 Compare March 25, 2026 16:47
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.

2 participants