Skip to content

LSP: Support references when triggered from alias #5542

@gavinmorrow

Description

@gavinmorrow

For example, in the program

import option.{map as m}
//             ^^^ A  ^ B

fn main() {
  let _ = option.map(option.Some(Nil), fn(_) { todo })
  //             ^^^ C
  let _ = m(option.Some(Nil), fn(_) { todo })
  //      ^ D
}

Moving the cursor over position C and triggering go to references will show positions A, C, and D. However, doing the same over position D will fail. At the very least, it should have the same behavior as triggering over position C. In my opinion, it would make sense for triggering over either to highlight all of A through D, although I can see either way.

Interestingly, this seems to work fine for types and type variants, although not for functions or constants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedContributions encouraged

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions