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

Setting to change what comment tag to detect? (instead of //) #9

Closed
Mayron opened this issue Aug 6, 2017 · 9 comments
Closed

Setting to change what comment tag to detect? (instead of //) #9

Mayron opened this issue Aug 6, 2017 · 9 comments

Comments

@Mayron
Copy link

Mayron commented Aug 6, 2017

Would it be possible to simply add the ability for us to tell Better Comments which comment tag to search for? This would allow us to configure the extension to work with many other languages such as Python or Lua.

I want to change it from registering // as a comment, to -- to work with SQL and Lua Scripts.
So that I can do: -- TODO: This needs completing!

I'm currently using Visual Studio Code and no option like this exists (you can only change colours).

Thanks for the great extension. I've recommended it to every developer I work with and they love it too!

@aaron-bond
Copy link
Owner

I'm working on a fix at the minute to pick up on # for Python comments (#8). Once I've got the structure in place it will be trivial for me to add other languages. I expect to to have that in place in the next week or so.

@Mayron
Copy link
Author

Mayron commented Aug 6, 2017

Thank you for the quick reply!

@aaron-bond
Copy link
Owner

Hi @Mayron , I'm finishing up on this addition - just wanted to get a bit of background: does Lua work with -- and // style comments?

@Mayron
Copy link
Author

Mayron commented Sep 16, 2017

@aaron-bond Sorry for not replying in a long time. Lua works with -- but not //

@Mayron
Copy link
Author

Mayron commented Sep 16, 2017

The notification went to my junk box...

@mpearon
Copy link

mpearon commented Nov 20, 2017

I want to start by saying that this is a very neat idea implemented by @aaron-bond !
I would love to use this for making annotations stand out in my PowerShell scripts.
Single-line comments are denoted with pound #
Multi-line comment blocks begin with a <# and end with #>

The common PowerShell extensions to be included would be .ps1, .psm1 and .psd1

# Work-around for current PowerShell users:
I was able to temporarily get this to work by making a few changes to .vscode\extensions\aaron-bond.better-comments-0.1.3\out\extention.js:
Change line 22 in from
const regEx = /(\/\/)+( )?(\!|\?|\/\/|\*|(todo))+(.*)+/ig;
to
const regEx = /(\#|\/\/)+( )?(\!|\?|\/\/|\*|(todo))+(.*)+/ig;
That should match either single-line qualifier.

Change line 50 from
const regEx = /(^|[ \t])(\/\*)+([\s\S]*?)(\*\/)/gm;
to
const regEx = /(^|[ \t])(\<\#|\/\*)+([\s\S]*?)(\#\>|\*\/)/gm;
That should match either multi-line qualifier.

You'll need to add "onLanguage:powershell" to the list of activationEvents of .vscode\extensions\aaron-bond.better-comments-0.1.3\package.json

@aaron-bond
Copy link
Owner

Hey, sorry for the lack of updates on this one. New job has kept me away from side projects for a bit. I have a fairly substantial update for the plugin sitting ready to go but have a bug which is kicking my ass. I'll release it as soon as I can figure out what I've broken :)

@aaron-bond
Copy link
Owner

Hey @mpearon, my last couple of checkins added a lot of new stuff. I've added support for powershell scripts on single lines, but not multiline yet (only supporting jsdoc style multiline atm).
I'll push an update to the market tomorrow, but in the meantime could you raise a separate FR for the multiline Powershell comments?

@aaron-bond
Copy link
Owner

New changes for v1.0.0 added support for comment styles: [//, #, --], so closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants