Skip to content

Commit cec7c1c

Browse files
authored
Add support for regex in tokenTypes (#304885)
1 parent 11f3c7f commit cec7c1c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate
181181
case 'comment':
182182
tokenTypes[scope] = StandardTokenType.Comment;
183183
break;
184+
case 'regex':
185+
tokenTypes[scope] = StandardTokenType.RegEx;
186+
break;
184187
}
185188
}
186189
}

src/vs/workbench/services/textMate/common/TMGrammars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const grammarsExtPoint: IExtensionPoint<ITMSyntaxExtensionPoint[]> = Exte
5757
description: nls.localize('vscode.extension.contributes.grammars.tokenTypes', 'A map of scope name to token types.'),
5858
type: 'object',
5959
additionalProperties: {
60-
enum: ['string', 'comment', 'other']
60+
enum: ['string', 'comment', 'other', 'regex']
6161
}
6262
},
6363
injectTo: {

0 commit comments

Comments
 (0)