Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Aug 1, 2025

Adding a partial of the selected field can also generate getter for it

This makes the selection more convenient

Example

struct Context {
    data$0: Data,
    count$0: usize,
    other: usize,
}

Before this PR

Assist not applicable

After this PR

struct Context {
    data: Data,
    count: usize,
    other: usize,
}

impl Context {
    fn data(&self) -> &Data {
        &self.data
    }

    fn $0count(&self) -> &usize {
        &self.count
    }
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 1, 2025
@A4-Tacks A4-Tacks mentioned this pull request Nov 19, 2025
41 tasks
Example
---
```rust
struct Context {
    data$0: Data,
    count$0: usize,
    other: usize,
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
struct Context {
    data: Data,
    count: usize,
    other: usize,
}

impl Context {
    fn data(&self) -> &Data {
        &self.data
    }

    fn $0count(&self) -> &usize {
        &self.count
    }
}
```
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