Skip to content

Conversation

@A4-Tacks
Copy link
Member

Editor adds the current indentation to the content of the code snippet

This PR dedentation is used to offset the editor snippet indentation

Example

fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        x
            .and(y)
            .map(|it| it+2)
            .$0
    };
}

Before this PR

fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        let $0 = x
                        .and(y)
                        .map(|it| it+2);
    };
}

After this PR

fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        let $0 = x
            .and(y)
            .map(|it| it+2);
    };
}

Editor adds the current indentation to the content of the code snippet

This PR dedentation is used to offset the editor snippet indentation

Example
---
```rust
fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        x
            .and(y)
            .map(|it| it+2)
            .$0
    };
}
```

**Before this PR**

```rust
fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        let $0 = x
                        .and(y)
                        .map(|it| it+2);
    };
}
```

**After this PR**

```rust
fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        let $0 = x
            .and(y)
            .map(|it| it+2);
    };
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 23, 2025
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