Go to parser.js for the extension (something like %USERPROFILE%\.vscode\extensions\aaron-bond.better-comments-3.0.2\out
, you might have to change the version number)
In parser.js
in the setDelimiter function, add this to the switch statement:
// parser.js
case 'svelte':
this.setCommentFormat('//|<!--|/* |// ', '/*|<!--', '*/|-->') // RegEx in order: script|markup|style
this.highlightJSDoc = true
break;
and also remove the pipe from the regex escaper
escapeRegExp(input) {
return input.replace(/[.*+?^${}()[\]\\]/g, '\\$&'); // $& means the whole matched string
}
From https://github.com/aaron-bond/better-comments/issues/174#issuecomment-916252020 but I changed the regex slightly to support a space between the slash and the keyword