Skip to content

Add CodeAction to simplify fully-qualified Component  #4522

@ryanbrandenburg

Description

@ryanbrandenburg

Summarization

There should be a CodeAction available to simplify the Component name for a fully qualified component tag, either when there is already an @using directive in the file, or if there isn't the code action should insert one.

eg given:

<Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView />

There should be a code action to "Simplify component tag" which results in the following document:

@using Microsoft.AspNetCore.Components.Authorization
<AuthorizeRouteView />

If the using already exists, it should be left alone. eg given:

@using Microsoft.AspNetCore.Components.Authorization
<Microsoft.AspNetCore.Components.Authorization.AuthorizeRouteView />

Then the "Simplify component tag" code action should result in the following document:

@using Microsoft.AspNetCore.Components.Authorization
<AuthorizeRouteView />

If there are any diagnostics present on the start tag then we shouldn't offer.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions