Skip to content

Function request: adding Size Bound by default to generic virtual text #13245

Open
@QingyaoLin

Description

@QingyaoLin

Function request: adding Size Bound by default to generic virtual text

Why are we doing this?

In Rust we specified that the Size Trait bound constraint is implemented for all generic T's, so we should also display it on our own virtual text type prompt instead of popping a T and jumping the Size Trait.

Suppose we have the following generic signature:

impl<T> SomethingOrNothing<T> {}

At this stage

when the mouse moves over the generics, it looks like this:

T
Go to Size

I would like to be able to add a trait bound of T: SIze to the virtual text, as shown below:

T: Size
Go to Size

Similarly, when we hold down Ctrl to move to generic T, it looks like this:

T
Go to Size
T

After the change, as shown below:

T: Size
Go to Size
T: Size

More examples

impl<T: Clone> SomethingOrNothing<T> {}

Display of virtual text

T: Clone
Go to Clone | Size

After the change ===>

T: Clone + Size
Go to Clone | Size

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-hoverhover featureA-idegeneral IDE featuresC-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions