Zxynine / EvenBetterComments

My take on the better-comments extension which incorporates many pull requests and multi tag definitions
https://marketplace.visualstudio.com/items?itemName=Tion.evenbettercomments
MIT License
11 stars 1 forks source link

Option to style tag only instead of the whole line #1

Closed Fred-Vatin closed 1 year ago

Fred-Vatin commented 1 year ago

Hi,

I saw another extension TODO Highlight v2 has options to style tag only. It also add border color and border radius options. I would prefer this because colorful comments is distracting.

Your extension plans to use tokenization to get comments. It’s a better practice than parsing the whole file with a regex like many other extensions do. 👍

Zxynine commented 1 year ago

Ill see what I can do, shouldn't be too hard to add in. I only just finished moving to tokenization in combination with regex today so it may be a bit before anything gets published. Thanks for the recommendation.

In regards to your comment on tokenisation, it was the only way I could actually be sure what I am about to add a decoration to is a comment, its nearly impossibly to handle all edge cases when it comes to comments especially for all the languages so I had to figure out a way to tokenise everything. The main problem with it and why most addons avoid it is, tokenisation is far more intensive to compute on documents and needs to be done sparingly, I still use regex to find potential candidates, but I use tokens to ensure it is actually a comment. The only reason I could finally add it was I created a class which acts like a boolean array that I could do bitwise operations on and each bit in it represents if there is a comment on a line or not so I can parse the document multiple times and skip all of the lines that already have comments on them. It still needs a ton of work, but I also found out I was doing a number of things multiple times per document in the previous version so overall, the extension should actually be much faster despite the switch to tokens.

Fred-Vatin commented 1 year ago

Good job ! 👍

Zxynine commented 1 year ago

I have implemented a feature to let you only style the tag. Its a setting called "highlightTagOnly", there is also a small temp fix for border options you can use until I properly fully integrate the settings into the extension. It also includes some temp options for outline and for text decorations. For each tag decoration, you can specify the string options "CSSTextDecoration", "CSSOutlineDecoration", and "CSSBorderDecoration" which will let you have a majority of control over how you would like it to look. For TextDecoration, see this page For Outline, see this page For Border, see this page

Fred-Vatin commented 1 year ago

I will test it this morning.

Is there a reason why the extension icon is so dull ? It always have been and wondered why. image

Fred-Vatin commented 1 year ago

Everything seems to work. Thanks.

Fred-Vatin commented 1 year ago

One note : the border or outline is applied to the tag AND the space after it. It needs to be fixed IMO. It should be applied on the tag only. image

Another request to improve the tag only feature. It should not be a global setting but a tag property to allow fine-grain customization.

Could you add a property to custom border-radius ? 😅

Zxynine commented 1 year ago

One note : the border or outline is applied to the tag AND the space after it. It needs to be fixed IMO. It should be applied on the tag only. image

Another request to improve the tag only feature. It should not be a global setting but a tag property to allow fine-grain customization.

Could you add a property to custom border-radius ? 😅

The problem with the space being highlighted is one would expect the colon to be highlighted as well in “todo:” so I will need to check what characters come after the tad and this can cause some problems if /when I let users set their own tag separators. It’s a weird problem.

As for the border radius, it’s weird that you cannot set that with the css border options, I’ve always hated css with a passion. I’m currently working on a way to let users specify every css option without me specifically adding support for each one.

lastly on the icon, purple is my favourite colour so when I was quickly making the icon that’s why I made it purple, I also am a fan of dark themes so I tried to get it to work nice, but it is a bit too dim for my liking too. Another reason is I have an OLED monitor so editing bright images and not moving it much can cause ghosting and reduce the life of that specific part of the screen so I try to avoid anything too bright, I have dark mode for just about everything I use.

Zxynine commented 1 year ago

Opened two separate issues to discuss further #7 and #8 , the main topic of this issue has been solved. Closing.