EngstromJimmy / Blazm.Extension

A Visual Studio Extension that solves some of the pain points when working with Blazor
MIT License
70 stars 7 forks source link

Find component usages limitations #14

Open biegehydra opened 9 months ago

biegehydra commented 9 months ago

The find component usages features fails to detect components under certain scenarios.

  1. The component has angle brackets in between open and closing tags
    • Ex 1: <Foo T="List<string>" />
    • Ex 2: <Foo SomeStringParam="@("<TEST>")" />
    • Ex 3: <Foo SomeListOfStringParam="new List<string>()" ></Foo>
  2. Multiline components. As in, components that span multiple lines
    <Foo T="string" Param1="Test"
                ...
                ParamN="Test" /> // Closing bracket on a different line 
biegehydra commented 4 months ago

I have since realized that this is easily fixable by just putting the restriction that the user must click on the name of the component, e.g. with the cursor on "Foo" in \<Foo T="List" />.

Then the algorithm is just move left to find beginning of tag, then move right to find a '/' , '>', space, or newline while capturing the component name.