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

Init Find Component References features #5

Closed biegehydra closed 1 year ago

biegehydra commented 1 year ago

The feature could definitely use some optimizing and tweaking before shipping but I created a good starting point for find component references. I have only tested it on a boilerplate project and not a large project.

What it does?

Feature Opportunities (Not Implemented)

Note: It will also work for normal html tags due to them matching the regex I use

Also, syntax highlighting for the preview was something I considered but was too hard for me to do.

Table Menu

biegehydra commented 1 year ago

I added a regex to search for usages. When looking through the file line by line it checks that anywhere on the line there is "<{ComponentName}" followed by anything other than alphabetical character. That's the simplest way I could think of to check for a component. Without accidentally getting other components.

EngstromJimmy commented 1 year ago

This looks really awesome! Thank you!

biegehydra commented 1 year ago

Just gave it a test on a large project. Search algorithm needs optimized. And it would be best to display results as they are found instead of after they have all been found.

biegehydra commented 1 year ago

I believe my most recent commit may fix #2 I was having trouble debugging getting this to work in a large project and it was because the razor file search algorithm was looking over solution item folders and sub projects. Others probably have the same issue. I think the algorithm is better now but I can't say it handles every case.