Etsi0 / class-collapse

This powerful extension lets you collapse any code segment using custom regex patterns. Simplify your coding view, enhancing readability and focus.
https://marketplace.visualstudio.com/items?itemName=Etsi0.class-collapse
MIT License
10 stars 0 forks source link

Feature request: Show first or n classes #10

Closed TPJelf closed 5 months ago

TPJelf commented 5 months ago

Hi, I'm loving your extension but I find myself sometimes lost in nested divs, would It be possible to allow for 1 or n classes to be visible and hide the rest to ease glance readability? I tried using regex but failed miserably.

Thanks and regards

Etsi0 commented 5 months ago

is this what you are looking for? if yes, i will push it up to main.

["body", "red", "grid"]

image image

TPJelf commented 5 months ago

This is looking great! Maybe the partial hits like body for text-body can be specified with asterisks? (*body for text-body for example)

Also would it be possible to remove the leading "..." in full hits on first classes like grid in your screenshots?

I'm sorry if I'm too nit-picky! Thanks again!

Etsi0 commented 5 months ago

Hi again,

I made it so it shows the hold thing instead of just the word. for example, if you want to see "body" you see text-body

The ... indicates collapsed content (the default value for class-collapse.collapsedText). You can change this setting, but it will affect all instances.

image

TPJelf commented 5 months ago

Not having exact matches makes it a bit noisy. Partial matches are great, but being able to support both would allow for a cleaner interface. What do you think?

Thanks again!

TPJelf commented 4 months ago

Thanks for the release!