Permalink
Browse files

Work around Codeplex WorkItem 6117 (syntax hilighting not working for…

… Operators) by making the DlrClassifier use 'script operator' instead of 'operator'
  • Loading branch information...
1 parent bcb3653 commit 4d8554cf2329ce5dba74e1e2c37e7e1019b7d285 @gglresearchanddevelopment committed May 29, 2011
@@ -59,22 +59,22 @@ public abstract class DlrClassifierProvider : IDlrClassifierProvider {
[Export]
[Name(DlrPredefinedClassificationTypeNames.OpenGrouping)]
- [BaseDefinition(PredefinedClassificationTypeNames.Operator)]
+ [BaseDefinition(DlrPredefinedClassificationTypeNames.ScriptOperator)]
internal static ClassificationTypeDefinition OpenGroupingClassificationDefinition = null; // Set via MEF
[Export]
[Name(DlrPredefinedClassificationTypeNames.CloseGrouping)]
- [BaseDefinition(PredefinedClassificationTypeNames.Operator)]
+ [BaseDefinition(DlrPredefinedClassificationTypeNames.ScriptOperator)]
internal static ClassificationTypeDefinition CloseGroupingClassificationDefinition = null; // Set via MEF
[Export]
[Name(DlrPredefinedClassificationTypeNames.Dot)]
- [BaseDefinition(PredefinedClassificationTypeNames.Operator)]
+ [BaseDefinition(DlrPredefinedClassificationTypeNames.ScriptOperator)]
internal static ClassificationTypeDefinition DotClassificationDefinition = null; // Set via MEF
[Export]
[Name(DlrPredefinedClassificationTypeNames.Comma)]
- [BaseDefinition(PredefinedClassificationTypeNames.Operator)]
+ [BaseDefinition(DlrPredefinedClassificationTypeNames.ScriptOperator)]
internal static ClassificationTypeDefinition CommaClassificationDefinition = null; // Set via MEF
#endregion
@@ -170,9 +170,9 @@ public abstract class DlrClassifierProvider : IDlrClassifierProvider {
categoryMap[TokenCategory.Keyword] = _keyword = registry.GetClassificationType(PredefinedClassificationTypeNames.Keyword);
categoryMap[TokenCategory.Directive] = registry.GetClassificationType(PredefinedClassificationTypeNames.Keyword);
categoryMap[TokenCategory.Identifier] = registry.GetClassificationType(PredefinedClassificationTypeNames.Identifier);
- categoryMap[TokenCategory.Operator] = _operator = registry.GetClassificationType(PredefinedClassificationTypeNames.Operator);
- categoryMap[TokenCategory.Delimiter] = registry.GetClassificationType(PredefinedClassificationTypeNames.Operator);
- categoryMap[TokenCategory.Grouping] = registry.GetClassificationType(PredefinedClassificationTypeNames.Operator);
+ categoryMap[TokenCategory.Operator] = _operator = registry.GetClassificationType(DlrPredefinedClassificationTypeNames.ScriptOperator);
+ categoryMap[TokenCategory.Delimiter] = _operator;
+ categoryMap[TokenCategory.Grouping] = _operator;
categoryMap[TokenCategory.WhiteSpace] = registry.GetClassificationType(PredefinedClassificationTypeNames.WhiteSpace);
categoryMap[TokenCategory.RegularExpressionLiteral] = registry.GetClassificationType(PredefinedClassificationTypeNames.Literal);
_openGroupingClassification = registry.GetClassificationType(DlrPredefinedClassificationTypeNames.OpenGrouping);
@@ -25,5 +25,11 @@ public static class DlrPredefinedClassificationTypeNames {
/// Classification used for . characters when used outside of a literal, comment, etc...
/// </summary>
public const string Dot = "dot";
+
+ /// <summary>
+ /// Instead of using PredefinedClassificationTypeNames.Operator for our operators, use "script operator" instead, as "operator" seems to
+ /// always come out as 0x008080
+ /// </summary>
+ public const string ScriptOperator = "script operator";
}
}

0 comments on commit 4d8554c

Please sign in to comment.