Skip to content

Commit

Permalink
Bug fix for issue 1042 - Gauge comment syntax highlighter conflicted …
Browse files Browse the repository at this point in the history
…with default comment highlighter for other langauges. (#1044)

Signed-off-by: Jens Johansson <[email protected]>
  • Loading branch information
jensakejohansson authored Feb 11, 2025
1 parent 7009fae commit 2437aa1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "Gauge support for VScode.",
"author": "ThoughtWorks",
"license": "MIT",
"version": "0.1.8",
"version": "0.1.9",
"publisher": "getgauge",
"engines": {
"vscode": "^1.71.0"
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"tagValue": { "foreground": colors.tagValue },
"specification": { "foreground": colors.specification },
"scenario": { "foreground": colors.scenario },
"comment": { "foreground": colors.comment },
"gaugeComment": { "foreground": colors.comment },
"disabledStep": { "foreground": colors.disabledStep }
};

Expand Down
4 changes: 2 additions & 2 deletions src/semanticTokensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const tokenTypes = [
'tagKeyword', // For the literal "tags:" at the beginning of a tag line
'tagValue', // For the remainder of a tag line after "tags:"
'disabledStep', // For lines starting with "//" (used to disable a step)
'comment' // For lines that do not match any of the above (fallback comment lines)
'gaugeComment' // For lines that do not match any of the above (fallback comment lines)
];
const tokenModifiers: string[] = [];
export const legend = new vscode.SemanticTokensLegend(tokenTypes, tokenModifiers);
Expand Down Expand Up @@ -175,7 +175,7 @@ export class GaugeSemanticTokensProvider implements vscode.DocumentSemanticToken
else {
// For any other non-empty line, mark it as a comment.
if (trimmedLine.length > 0) {
builder.push(i, 0, line.length, tokenTypes.indexOf('comment'), 0);
builder.push(i, 0, line.length, tokenTypes.indexOf('gaugeComment'), 0);
}
i++;
}
Expand Down

0 comments on commit 2437aa1

Please sign in to comment.