-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
While working on the assist migration tracking issue #18285, I attempted
to migrate move_bounds.rs and remove_unused_imports.rs to use the
SyntaxEditor API. Both migrations are currently blocked because
SyntaxFactory is missing several constructors and methods that are
still only available in the old edit_in_place / make API.
Missing Methods
move_bounds.rs blocker
where_pred()— constructs aWherePrednode from a target
(Either<Lifetime, Type>) and an iterator ofTypeBoundget_or_create_where_clause()— finds or inserts aWhereClause
on AST nodes likeFn,Trait,Impl,Enum,Struct,TypeAlias
remove_unused_imports.rs blocker
UseTree::remove_recursive()— removes aUseTreenode and cleans
up parent braces, trailing commas, and empty use statements
split_import.rs blocker
UseTree::split_prefix()— splits a use path at a given prefix
into a braced subtree
Proposed Fix
Implement these in:
crates/syntax/src/ast/syntax_factory/constructors.rs
and the relevant SyntaxEditor extension traits.
Before proceeding — is this the right approach, or are these
intentionally deferred? Happy to take this on if it looks good.
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels