Skip to content

fix: Fix ref_match position when keyword prefix#21999

Merged
A4-Tacks merged 1 commit intorust-lang:masterfrom
A4-Tacks:refmatch-kwdprefix-quickfix
Apr 13, 2026
Merged

fix: Fix ref_match position when keyword prefix#21999
A4-Tacks merged 1 commit intorust-lang:masterfrom
A4-Tacks:refmatch-kwdprefix-quickfix

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

@A4-Tacks A4-Tacks commented Apr 9, 2026

This is a quick fix, please review if there is a regression

Fixes #15139
Fixes #18572

Example

fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(in$0)
}

Before this PR

fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(in&dent)
}
source_range: 65..67,
delete: 65..67,
ref_match: "&@67",
..

After this PR

fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(&indent)
}
source_range: 65..67,
delete: 65..67,
ref_match: "&@65",
..

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 9, 2026
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 13, 2026
This is a quick fix, please review if there is a regression

Example
---
```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(in$0)
}
```

**Before this PR**

```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(in&dent)
}
```

```rust
source_range: 65..67,
delete: 65..67,
ref_match: "&@67",
..
```

**After this PR**

```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(&indent)
}
```

```rust
source_range: 65..67,
delete: 65..67,
ref_match: "&@65",
..
```
@A4-Tacks A4-Tacks force-pushed the refmatch-kwdprefix-quickfix branch from 0f98d95 to 950895b Compare April 13, 2026 18:52
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 13, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@A4-Tacks A4-Tacks enabled auto-merge April 13, 2026 18:52
@A4-Tacks A4-Tacks added this pull request to the merge queue Apr 13, 2026
Merged via the queue into rust-lang:master with commit 8b96128 Apr 13, 2026
18 checks passed
@A4-Tacks A4-Tacks deleted the refmatch-kwdprefix-quickfix branch April 13, 2026 19:12
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ref completions break when the prefix is a keyword (e.g. mod) The position of the completed reference is splited by keywords

3 participants