Skip to content

Interacting with component attribute prefixes and suffixes could be better #8536

@davidwengier

Description

@davidwengier

Component attributes can have prefixes and suffixes, such as <Component @bind-Prop:get="Goo" />. This is actually <prefix>Prop<suffix>, where Prop is the attribute name itself.

With #8512 we are fixing codegen so that interacting with the attribute name works well, but interacting with the prefix and suffix can be hit and miss. We should update some of our featuers (Hover, Go to Definition, Go to Implementation, Find All References, etc.) to do a better job in these scenarios.

For example, if we get a hover for ($$ denotes the position of the request) @bi$$nd-Prop:get we should detect that we're in an attribute prefix, and delegate to Roslyn as though we got the request for @bind-$$Prop:get. Doing the same for the suffix will mean no matter where in the attribute the user clicks or hovers, it will have the effect of interacting with the attribute name itself, which is the part that the user cares about.

The work for this would go in our endpoints (eg, HoverEndpoint) but we probably want a single helper method somewhere that can be used so multiple endpoints can have this same functionality. Something like TryAdjustPositionToAttributeName

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions