Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it work with Better Comments extension? #14

Open
SanjayVyas opened this issue Oct 25, 2021 · 3 comments
Open

Does it work with Better Comments extension? #14

SanjayVyas opened this issue Oct 25, 2021 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@SanjayVyas
Copy link

This extension seems to work with comments like
// This is a comment

I also use an extension called Better Comments, where comments can be colours by adding extra characters
//! This will be in red
//* This will be in green

However, this extension doesnt hide comment if the first character after // is not a letter

@estruyf estruyf added enhancement New feature or request help wanted Extra attention is needed labels Nov 3, 2021
@estruyf
Copy link
Owner

estruyf commented Nov 3, 2021

Probably it doesn't, as it is an extension that adds its own syntax, but we could take a look into adding support.

@Zxynine
Copy link

Zxynine commented Jul 16, 2022

Probably it doesn't, as it is an extension that adds its own syntax, but we could take a look into adding support.

That would be great to have, if you could, adding some code comments would help someone like me or its creator to more easily implement support and submit a pull request as well, right now im still trying to get used to vscode extension programming so a lot of it is unfamiliar to me.

@yuanyang11510
Copy link

You could make use of the regex feature of this extension to this end. For example,

{
"hideComments.regex": [
{
"regex": "console\.log\(([^)]+)\).*",
"flags": "igm"
}
]
}

is the example proposed by the developper and it suffices to replace the long complex part after "regex":, i.d. "console\\.log\\(([^)]+)\\).*", with, let's say, "%! .*" so that you could hide all the comments beginning with %! by means of a new star icon slashed beside the default eye icon. I take this as an example because I just figured out how to use it to hide my "better-comments" used in LaTeX. I'm not sure how to express what you need to hide with regex but I think it is not difficult to find a solution.
However, it still leaves me a little question about the part "flags": "igm" and I wonder what this serves for. At first I thought this was just like a label to distinguish between different regex but when I changed it, this feature failed to work. Hopefully the developper could see this question and make it more clear.

P.S. I am not sure if you had already found the same solution as me, since this issue has been proposed for around 3 years but, if anyone had the same question, maybe this expedient would give a little help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants