willumz/generic-pseudocode-vscode

Question: How to add '#' token to line comments syntax?

Closed this issue · 1 comments

I want to add the hash '#' to the type of in-line comments recognized by the extension.

I found this block, and I figured this is what I need to edit, but I have had no luck with the syntax.

Help me out?

"patterns": [
			{
				"name": "comment.line.double-slash.pseudocode",
				"match": "\\/\\/.*"
			},
			{
				"name": "comment.block.pseudocode",
				"begin": "/\\*",
				"end": "\\*/"
			}
		]

Hi, so the way this works is the match is a regex for what entails a comment. By default, it matches two slashes then any other character unlimited times (this is what .* means). To include # as well, you could change the first match to (\\/\\/|#).* which will match two slashes or a hashtag, then any string of characters. I recommend a site like regexr to play around with regular expressions if you're interested.