vscode-css-navigation icon indicating copy to clipboard operation
vscode-css-navigation copied to clipboard

[Feature Request] Match Entire Selector in "Find All References"

Open kdumontnu opened this issue 4 years ago • 3 comments

The concept for this extension is great, but I'm really hoping that the tool can match an entire CSS selector when I select "Find All References"

For instance:

.ui.secondary.pointing.menu .item {
  // properties
}

In this case, I'd like the filter to find any elements matching the exact selector. I can achieve this by building regex searches: ^.*<.*class=(?=.*ui)(?=.*secondary)(?=.*menu)(?=.*pointing).*>(.|\n)*<.*(?=.*item) ^ Note: this regex probably needs some work.

Of course, it will take a lot of work to get 100% coverage for all CSS selector properties, but even basic selectors like above would provide a lot of value for me understanding if a CSS change will affect other areas of my code.

Happy to help or provide additional details.

kdumontnu avatar Feb 10 '21 22:02 kdumontnu

Thanks for your suggestion, kdumontnu, you are right, what you are thinking about is a very helpful and even exciting work.

In fact I've considered much about this, for finding definitions and references to make it match all nested selectors.

My answer is I can make this done, but it will cost me much time (may be a whole week or even two, not long, but I have a daily work), and it may also affect searching performance (may be not, searching is super fast right now).

I'v received another two issues having the same suggestion, so I guess I should consider more about this.

pucelle avatar Feb 10 '21 23:02 pucelle

@pucelle Thanks for the reply. I'm happy to help out. Yes, to have 100% coverage would take a LOT of work, but I believe the task can easily be broken up into a roadmap you can share with users. Once the initial architecture is set up I'm sure you can get people to help contribute.

kdumontnu avatar Feb 11 '21 01:02 kdumontnu

Thanks, @kdumontnu, I will add this feature to my to-do list. Otherwise, any suggestion would be welcome.

pucelle avatar Feb 11 '21 06:02 pucelle