Skip to content

Support Go to definition in Hover when show substitution. #18799

Closed
@lh123

Description

@lh123
mod A {
    pub(crate) struct Test;
}

mod B {
    pub(crate) struct Test;
}


fn test_substitution_hover<T>(t: T) {
    
}

fn test() {
    let a = A::Test;
    let b = B::Test;
    test_substitution_hover(a); // hover on test_substitution_hover show T = Test
    test_substitution_hover(b); // hover on test_substitution_hover show T = Test
}

In this case, the hover shows T = Test, which indeed causes confusion because we cannot differentiate between A::Test and B::Test via hover.

Displaying T = Test with the ability to click on Test to jump to its definition would help resolve this issue, while also showing the full definition of Test when hovering over it.

Specifically, something like the following could help:
Image
Image
Image

Metadata

Metadata

Assignees

Labels

C-featureCategory: feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions