Skip to content

Triggering "Add reference here" code action adds an ampersand in the wrong location. #12721

@abusch

Description

@abusch

This is basically the exact same symptom as #12717 except it happens when executing the "Add reference here" code action instead of using completion.

The same example as in #12717 can be used to reproduce it. If you type show_value(request.query_id) in the test function at the bottom of the file, then select "Add reference here", the ampersand character is added on line 6 instead of the correct line.

Interestingly, the "consider borrowing here" code action works fine.

rust-analyzer version: rust-analyzer 0.0.0 (75b2232 2022-07-03)

rustc version: rustc 1.62.0 (a8314ef7d 2022-06-27)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-assistsC-bugCategory: bugE-has-instructionsIssue has some instructions and pointers to code to get started

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions