diff --git a/src/EditorFeatures/Core.Wpf/Classification/ClassificationTypeFormatDefinitions.cs b/src/EditorFeatures/Core.Wpf/Classification/ClassificationTypeFormatDefinitions.cs index c51a00ff4b19cc6ce835ac6c280d1f14adcbc185..7383a3db5f0c6083c45a3ede914af1dbd56c0063 100644 --- a/src/EditorFeatures/Core.Wpf/Classification/ClassificationTypeFormatDefinitions.cs +++ b/src/EditorFeatures/Core.Wpf/Classification/ClassificationTypeFormatDefinitions.cs @@ -356,38 +356,39 @@ private class RegexCommentFormatDefinition : ClassificationFormatDefinition private RegexCommentFormatDefinition() { this.DisplayName = EditorFeaturesWpfResources.Regex_Comment; - this.ForegroundColor = Color.FromRgb(87, 166, 74); + this.ForegroundColor = Color.FromRgb(0, 128, 0); } } + [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexText)] - [Name(ClassificationTypeNames.RegexText)] + [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexCharacterClass)] + [Name(ClassificationTypeNames.RegexCharacterClass)] [Order(After = ClassificationTypeNames.StringLiteral)] [Order(After = ClassificationTypeNames.VerbatimStringLiteral)] [UserVisible(true)] [ExcludeFromCodeCoverage] - private class RegexTextFormatDefinition : ClassificationFormatDefinition + private class RegexCharacterClassFormatDefinition : ClassificationFormatDefinition { - private RegexTextFormatDefinition() + private RegexCharacterClassFormatDefinition() { - this.DisplayName = EditorFeaturesWpfResources.Regex_Text; - this.ForegroundColor = Color.FromRgb(0, 0, 0); + this.DisplayName = EditorFeaturesWpfResources.Regex_Character_class; + this.ForegroundColor = Color.FromRgb(0x00, 0x73, 0xff); } } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexCharacterClass)] - [Name(ClassificationTypeNames.RegexCharacterClass)] + [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexAnchor)] + [Name(ClassificationTypeNames.RegexAnchor)] [Order(After = ClassificationTypeNames.StringLiteral)] [Order(After = ClassificationTypeNames.VerbatimStringLiteral)] [UserVisible(true)] [ExcludeFromCodeCoverage] - private class RegexCharacterClassFormatDefinition : ClassificationFormatDefinition + private class RegexAnchorFormatDefinition : ClassificationFormatDefinition { - private RegexCharacterClassFormatDefinition() + private RegexAnchorFormatDefinition() { - this.DisplayName = EditorFeaturesWpfResources.Regex_Character_class; - this.ForegroundColor = Color.FromRgb(0x07, 0xbf, 0xb6); + this.DisplayName = EditorFeaturesWpfResources.Regex_Anchor; + this.ForegroundColor = Color.FromRgb(0xff, 0x00, 0xc1); } } @@ -403,23 +404,23 @@ private class RegexQuantifierFormatDefinition : ClassificationFormatDefinition private RegexQuantifierFormatDefinition() { this.DisplayName = EditorFeaturesWpfResources.Regex_Quantifier; - this.ForegroundColor = Color.FromRgb(128, 0, 0); + this.ForegroundColor = Color.FromRgb(0xff, 0x00, 0xc1); } } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexAnchor)] - [Name(ClassificationTypeNames.RegexAnchor)] + [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexGrouping)] + [Name(ClassificationTypeNames.RegexGrouping)] [Order(After = ClassificationTypeNames.StringLiteral)] [Order(After = ClassificationTypeNames.VerbatimStringLiteral)] [UserVisible(true)] [ExcludeFromCodeCoverage] - private class RegexAnchorFormatDefinition : ClassificationFormatDefinition + private class RegexGroupingFormatDefinition : ClassificationFormatDefinition { - private RegexAnchorFormatDefinition() + private RegexGroupingFormatDefinition() { - this.DisplayName = EditorFeaturesWpfResources.Regex_Anchor; - this.ForegroundColor = Color.FromRgb(128, 0, 0); + this.DisplayName = EditorFeaturesWpfResources.Regex_Grouping; + this.ForegroundColor = Color.FromRgb(0x05, 0xc3, 0xba); } } @@ -435,39 +436,56 @@ private class RegexAlternationFormatDefinition : ClassificationFormatDefinition private RegexAlternationFormatDefinition() { this.DisplayName = EditorFeaturesWpfResources.Regex_Alternation; - this.ForegroundColor = Color.FromRgb(0xff, 0x78, 0x00); + this.ForegroundColor = Color.FromRgb(0x05, 0xc3, 0xba); } } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexGrouping)] - [Name(ClassificationTypeNames.RegexGrouping)] + [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexText)] + [Name(ClassificationTypeNames.RegexText)] [Order(After = ClassificationTypeNames.StringLiteral)] [Order(After = ClassificationTypeNames.VerbatimStringLiteral)] [UserVisible(true)] [ExcludeFromCodeCoverage] - private class RegexGroupingFormatDefinition : ClassificationFormatDefinition + private class RegexTextFormatDefinition : ClassificationFormatDefinition { - private RegexGroupingFormatDefinition() + private RegexTextFormatDefinition() { - this.DisplayName = EditorFeaturesWpfResources.Regex_Grouping; - this.ForegroundColor = Color.FromRgb(0xff, 0x78, 0x00); + this.DisplayName = EditorFeaturesWpfResources.Regex_Text; + this.ForegroundColor = Color.FromRgb(0x80, 0x00, 0x00); } } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexEscape)] - [Name(ClassificationTypeNames.RegexEscape)] + [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexSelfEscapedCharacter)] + [Name(ClassificationTypeNames.RegexSelfEscapedCharacter)] [Order(After = ClassificationTypeNames.StringLiteral)] [Order(After = ClassificationTypeNames.VerbatimStringLiteral)] [UserVisible(true)] [ExcludeFromCodeCoverage] - private class RegexEscapeFormatDefinition : ClassificationFormatDefinition + private class RegexSelfEscapedCharacterFormatDefinition : ClassificationFormatDefinition { - private RegexEscapeFormatDefinition() + private RegexSelfEscapedCharacterFormatDefinition() { - this.DisplayName = EditorFeaturesWpfResources.Regex_Escape; - this.ForegroundColor = Color.FromRgb(0x00, 0x73, 0xff); + this.DisplayName = EditorFeaturesWpfResources.Regex_SelfEscapedCharacter; + this.ForegroundColor = Color.FromRgb(0x80, 0x00, 0x00); + this.IsBold = true; + } + } + + [Export(typeof(EditorFormatDefinition))] + [ClassificationType(ClassificationTypeNames = ClassificationTypeNames.RegexOtherEscape)] + [Name(ClassificationTypeNames.RegexOtherEscape)] + [Order(After = ClassificationTypeNames.StringLiteral)] + [Order(After = ClassificationTypeNames.VerbatimStringLiteral)] + [UserVisible(true)] + [ExcludeFromCodeCoverage] + private class RegexOtherEscapeFormatDefinition : ClassificationFormatDefinition + { + private RegexOtherEscapeFormatDefinition() + { + this.DisplayName = EditorFeaturesWpfResources.Regex_OtherEscape; + this.ForegroundColor = Color.FromRgb(0x9e, 0x5b, 0x71); } } #endregion diff --git a/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.Designer.cs b/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.Designer.cs index c568c314e685c903b26c33433aca9368662192d4..56708378e6b523ce0fc700cb5263d3cb30a7c2c2 100644 --- a/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.Designer.cs +++ b/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.Designer.cs @@ -124,20 +124,20 @@ internal class EditorFeaturesWpfResources { } /// - /// Looks up a localized string similar to Regex - Escape. + /// Looks up a localized string similar to Regex - Grouping. /// - internal static string Regex_Escape { + internal static string Regex_Grouping { get { - return ResourceManager.GetString("Regex_Escape", resourceCulture); + return ResourceManager.GetString("Regex_Grouping", resourceCulture); } } /// - /// Looks up a localized string similar to Regex - Grouping. + /// Looks up a localized string similar to Regex - Other Escape. /// - internal static string Regex_Grouping { + internal static string Regex_OtherEscape { get { - return ResourceManager.GetString("Regex_Grouping", resourceCulture); + return ResourceManager.GetString("Regex_OtherEscape", resourceCulture); } } @@ -150,6 +150,15 @@ internal class EditorFeaturesWpfResources { } } + /// + /// Looks up a localized string similar to Regex - Self Escaped Character. + /// + internal static string Regex_SelfEscapedCharacter { + get { + return ResourceManager.GetString("Regex_SelfEscapedCharacter", resourceCulture); + } + } + /// /// Looks up a localized string similar to Regex - Text. /// diff --git a/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.resx b/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.resx index a6b34b776c045d8ae771682f7973cbd4f307fb14..b12e901c4fc2eee5e721407b8c47420f91ff7fe2 100644 --- a/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.resx +++ b/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.resx @@ -141,8 +141,8 @@ Regex - Quantifier - - Regex - Escape + + Regex - Self Escaped Character Regex - Grouping @@ -150,4 +150,7 @@ Regex - Text + + Regex - Other Escape + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.cs.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.cs.xlf index dfb30b39a8310b029d2669654e7ea1477f6f08af..7d126270882f3367dfd7270b4660fb0611b216b6 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.cs.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.cs.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.de.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.de.xlf index 3f4e185bb2fadb1e2ef7a2e367de4d7eef729ef2..b78e73c356dd7e290d37e71255356a4d18077025 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.de.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.de.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.es.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.es.xlf index f2256475634d65e84b58acfe244cca0d4b4be673..a02315e331e4b0711be9132afe3b003d4d726321 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.es.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.es.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.fr.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.fr.xlf index d04da22195cdfc289a798f995899c152578effd7..ae0897bf1ec4ce1657cd2bc99404f08287dcd2df 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.fr.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.fr.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.it.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.it.xlf index 5da82fac9e414c2e450647c1c551c90f86524122..db1e549f4320fd449ed60ed5bd91045ebca2adcd 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.it.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.it.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ja.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ja.xlf index 74306c14c0f4db13b90615130da8bf4548320338..ccfec53484fad89ec26293cf8bacc905b4ef1fea 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ja.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ja.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ko.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ko.xlf index af4494b5bdbae7b080840da3a8276467bb16eeb6..8e28c8c2cd153bd3320f8ea7e6b915834b8f3279 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ko.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ko.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pl.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pl.xlf index 028f2a5185712a942a4e92acccab88535025154d..a3ce36baeb8ee469ac573a08aef6db74ba1f00cc 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pl.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pl.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pt-BR.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pt-BR.xlf index 796248eb59d7e707d8e615ef8a3c255b57706cca..d7b983b06e536e758433e452981bbf0db84be23f 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pt-BR.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pt-BR.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ru.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ru.xlf index efa7748f234f6de676b23d39b68009bf4e2b2671..e4bd1916c9842feffec61b3ef1c7575d1111f771 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ru.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ru.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.tr.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.tr.xlf index 9f59c6ba2960f4facb0d1997ec28a6c06624cb3a..422b8e9f6505816784c0e15fdb9fad5f22a10a8d 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.tr.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.tr.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hans.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hans.xlf index 83cf5a18b61d3356726c065aa6d84bff92790b98..8f7b09219d447fecd69a21bfe41f2415d9da50c2 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hans.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hans.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hant.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hant.xlf index b528d66936fc3cf4002f9ddf6a8cf9f2069a0caa..dbfb554f123154254cb38eaeff195a3142864258 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hant.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hant.xlf @@ -47,16 +47,21 @@ Regex - Text - - Regex - Escape - Regex - Escape - - Regex - Grouping Regex - Grouping + + Regex - Self Escaped Character + Regex - Self Escaped Character + + + + Regex - Other Escape + Regex - Other Escape + + \ No newline at end of file diff --git a/src/EditorFeatures/Core/Implementation/Classification/ClassificationTypeDefinitions.cs b/src/EditorFeatures/Core/Implementation/Classification/ClassificationTypeDefinitions.cs index 80cae791b656bf4dffe4745f57a1213f30c67ef1..304c6f1fe755ad78cb1a5c295a0e84ced4fa7da0 100644 --- a/src/EditorFeatures/Core/Implementation/Classification/ClassificationTypeDefinitions.cs +++ b/src/EditorFeatures/Core/Implementation/Classification/ClassificationTypeDefinitions.cs @@ -166,9 +166,14 @@ internal sealed class ClassificationTypeDefinitions internal readonly ClassificationTypeDefinition RegexAlternationTypeDefinition; [Export] - [Name(ClassificationTypeNames.RegexEscape)] + [Name(ClassificationTypeNames.RegexOtherEscape)] [BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)] - internal readonly ClassificationTypeDefinition RegexEscapeTypeDefinition; + internal readonly ClassificationTypeDefinition RegexOtherEscapeTypeDefinition; + + [Export] + [Name(ClassificationTypeNames.RegexSelfEscapedCharacter)] + [BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)] + internal readonly ClassificationTypeDefinition RegexSelfEscapedCharacterTypeDefinition; [Export] [Name(ClassificationTypeNames.RegexGrouping)] diff --git a/src/EditorFeatures/TestUtilities/Classification/FormattedClassifications.RegexTypes.cs b/src/EditorFeatures/TestUtilities/Classification/FormattedClassifications.RegexTypes.cs index 5c6058a4535aa4174746b23c0feb16f8817ce854..654ee74bb162d572a660aca8b84c912c5cf7f61c 100644 --- a/src/EditorFeatures/TestUtilities/Classification/FormattedClassifications.RegexTypes.cs +++ b/src/EditorFeatures/TestUtilities/Classification/FormattedClassifications.RegexTypes.cs @@ -16,7 +16,10 @@ public static class Regex public static FormattedClassification Grouping(string value) => New(value, ClassificationTypeNames.RegexGrouping); [DebuggerStepThrough] - public static FormattedClassification Escape(string value) => New(value, ClassificationTypeNames.RegexEscape); + public static FormattedClassification OtherEscape(string value) => New(value, ClassificationTypeNames.RegexOtherEscape); + + [DebuggerStepThrough] + public static FormattedClassification SelfEscapedCharacter(string value) => New(value, ClassificationTypeNames.RegexSelfEscapedCharacter); [DebuggerStepThrough] public static FormattedClassification Alternation(string value) => New(value, ClassificationTypeNames.RegexAlternation); diff --git a/src/VisualStudio/Core/Def/HACK_ThemeColorFixer.cs b/src/VisualStudio/Core/Def/HACK_ThemeColorFixer.cs index 8f6ec6060807b87316dfc201bbc483a9f9991325..49e58e53dff56c3f713eb5219cdfe7943fc39a2b 100644 --- a/src/VisualStudio/Core/Def/HACK_ThemeColorFixer.cs +++ b/src/VisualStudio/Core/Def/HACK_ThemeColorFixer.cs @@ -81,8 +81,9 @@ public void RefreshThemeColors() UpdateForegroundColor(ClassificationTypeNames.RegexQuantifier, sourceFormatMap, targetFormatMap); UpdateForegroundColor(ClassificationTypeNames.RegexAnchor, sourceFormatMap, targetFormatMap); UpdateForegroundColor(ClassificationTypeNames.RegexAlternation, sourceFormatMap, targetFormatMap); - UpdateForegroundColor(ClassificationTypeNames.RegexEscape, sourceFormatMap, targetFormatMap); UpdateForegroundColor(ClassificationTypeNames.RegexGrouping, sourceFormatMap, targetFormatMap); + UpdateForegroundColor(ClassificationTypeNames.RegexOtherEscape, sourceFormatMap, targetFormatMap); + UpdateForegroundColor(ClassificationTypeNames.RegexSelfEscapedCharacter, sourceFormatMap, targetFormatMap); UpdateForegroundColor(ClassificationTypeNames.PreprocessorKeyword, sourceFormatMap, targetFormatMap); UpdateForegroundColor(ClassificationTypeNames.PreprocessorText, sourceFormatMap, targetFormatMap); diff --git a/src/Workspaces/Core/Portable/Classification/ClassificationTypeNames.cs b/src/Workspaces/Core/Portable/Classification/ClassificationTypeNames.cs index c649ba10e336df8d53c14ce12f5f5bca51ab2ed9..42b0701dabcbb0db40f484799c50ef8e95ca9f7d 100644 --- a/src/Workspaces/Core/Portable/Classification/ClassificationTypeNames.cs +++ b/src/Workspaces/Core/Portable/Classification/ClassificationTypeNames.cs @@ -61,12 +61,13 @@ public static class ClassificationTypeNames public const string XmlLiteralText = "xml literal - text"; internal const string RegexComment = "regex - comment"; - internal const string RegexText = "regex - text"; internal const string RegexCharacterClass = "regex - character class"; - internal const string RegexQuantifier = "regex - quantifier"; internal const string RegexAnchor = "regex - anchor"; - internal const string RegexAlternation = "regex - alternation"; - internal const string RegexEscape = "regex - escape"; + internal const string RegexQuantifier = "regex - quantifier"; internal const string RegexGrouping = "regex - grouping"; + internal const string RegexAlternation = "regex - alternation"; + internal const string RegexText = "regex - text"; + internal const string RegexSelfEscapedCharacter = "regex - self escaped character"; + internal const string RegexOtherEscape = "regex - other escape"; } } diff --git a/src/Workspaces/Core/Portable/Classification/SyntaxClassification/CommonRegexPatternTokenClassifier.cs b/src/Workspaces/Core/Portable/Classification/SyntaxClassification/CommonRegexPatternTokenClassifier.cs index ab8f0adb0a721867e8d994249abe8da85441f61f..df26eaced9f8d267c877ac09497371f263cd5def 100644 --- a/src/Workspaces/Core/Portable/Classification/SyntaxClassification/CommonRegexPatternTokenClassifier.cs +++ b/src/Workspaces/Core/Portable/Classification/SyntaxClassification/CommonRegexPatternTokenClassifier.cs @@ -263,25 +263,22 @@ private void ClassifyGrouping(RegexGroupingNode node) #endregion - #region Escapes + #region Other Escapes public void Visit(RegexControlEscapeNode node) - => ClassifyEscape(node); + => ClassifyOtherEscape(node); public void Visit(RegexHexEscapeNode node) - => ClassifyEscape(node); + => ClassifyOtherEscape(node); public void Visit(RegexUnicodeEscapeNode node) - => ClassifyEscape(node); + => ClassifyOtherEscape(node); public void Visit(RegexOctalEscapeNode node) - => ClassifyEscape(node); + => ClassifyOtherEscape(node); - public void Visit(RegexSimpleEscapeNode node) - => ClassifyEscape(node); - - public void ClassifyEscape(RegexNode node) - => ClassifyWholeNode(node, ClassificationTypeNames.RegexEscape); + public void ClassifyOtherEscape(RegexNode node) + => ClassifyWholeNode(node, ClassificationTypeNames.RegexOtherEscape); #endregion @@ -310,6 +307,9 @@ public void Visit(RegexPosixPropertyNode node) public void Visit(RegexAlternationNode node) => AddClassification(node.BarToken, ClassificationTypeNames.RegexAlternation); + + public void Visit(RegexSimpleEscapeNode node) + => ClassifyWholeNode(node, ClassificationTypeNames.RegexSelfEscapedCharacter); } } }