Skip to content

Switch to in-place indenting #9903

@matklad

Description

@matklad

the

https://github.com/rust-analyzer/rust-analyzer/blob/182a2b8e72eee2faaef0ef17330937bd0edaa4b6/crates/syntax/src/ast/edit.rs#L185-L203

api exist to change indent level on syntax nodes. It works by returning a copy of the node with indentation applied.

Long after the introduction of that API, we've switched to mutable API for editing syntax nodes, so now the preference is to modify data in-place. We should introduce new trait for in-place indentation changes, and then update all the usages of the old trait, one by one (no need to do everything in one go).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions