Skip to content

Commit 48f1178

Browse files
committed
Fix missing ClassificationType.regularExpressionLiteral cases in classifier - Add missing case for ClassificationType.regularExpressionLiteral in convertClassification function - Add missing case for ClassificationType.regularExpressionLiteral in getClassificationTypeName function - Maps regularExpressionLiteral to stringLiteral classification to match existing behavior - Fixes compilation errors and makes switch statements exhaustive
1 parent b504a1e commit 48f1178

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/services/classifier.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ function convertClassification(type: ClassificationType): TokenClass {
394394
case ClassificationType.text:
395395
case ClassificationType.parameterName:
396396
return TokenClass.Identifier;
397+
case ClassificationType.regularExpressionLiteral:
398+
return TokenClass.StringLiteral;
397399
default:
398400
return undefined!; // TODO: GH#18217 Debug.assertNever(type);
399401
}
@@ -692,6 +694,8 @@ function getClassificationTypeName(type: ClassificationType): ClassificationType
692694
return ClassificationTypeNames.jsxText;
693695
case ClassificationType.jsxAttributeStringLiteralValue:
694696
return ClassificationTypeNames.jsxAttributeStringLiteralValue;
697+
case ClassificationType.regularExpressionLiteral:
698+
return ClassificationTypeNames.stringLiteral;
695699
default:
696700
return undefined!; // TODO: GH#18217 Debug.assertNever(type);
697701
}

0 commit comments

Comments
 (0)