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

Fixed block comments #457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,18 @@ export class Parser {
}

// Combine custom delimiters and the rest of the comment block matcher
let commentMatchString = "(^)+([ \\t]*[ \\t]*)(";
let commentMatchString = "(^)([ \\t]*)("
commentMatchString += this.blockCommentStart;
commentMatchString += ")?([ \\t]*)(";
commentMatchString += characters.join("|");
commentMatchString += ")([ ]*|[:])+([^*/][^\\r\\n]*)";
commentMatchString += ")([^\\r\\n]*)(("
commentMatchString += this.blockCommentEnd
commentMatchString += ")|[\\n\\r])";

// Use start and end delimiters to find block comments
let regexString = "(^|[ \\t])(";
regexString += this.blockCommentStart;
regexString += "[\\s])+([\\s\\S]*?)(";
regexString += "[^*][\\s]?)([\\s\\S]*?)(";
regexString += this.blockCommentEnd;
regexString += ")";

Expand All @@ -151,7 +155,7 @@ export class Parser {
let range: vscode.DecorationOptions = { range: new vscode.Range(startPos, endPos) };

// Find which custom delimiter was used in order to add it to the collection
let matchString = line[3] as string;
let matchString = line[5] as string;
let matchTag = this.tags.find(item => item.tag.toLowerCase() === matchString.toLowerCase());

if (matchTag) {
Expand Down