From d756186448314960e29301ab13623c2a19aeeb78 Mon Sep 17 00:00:00 2001 From: Mads Kristensen Date: Sat, 8 Jan 2022 13:37:14 -0800 Subject: [PATCH] Renamed class --- ...icationTypes.cs => ClassificationTypes.cs} | 34 +++++++++---------- src/Language/EditorFeatures.cs | 18 +++++----- src/Language/TokenTagger.cs | 18 +++++----- src/MarkdownEditor2022.csproj | 2 +- 4 files changed, 36 insertions(+), 36 deletions(-) rename src/Language/{MarkdownClassificationTypes.cs => ClassificationTypes.cs} (80%) diff --git a/src/Language/MarkdownClassificationTypes.cs b/src/Language/ClassificationTypes.cs similarity index 80% rename from src/Language/MarkdownClassificationTypes.cs rename to src/Language/ClassificationTypes.cs index 5530688..4d0f22b 100644 --- a/src/Language/MarkdownClassificationTypes.cs +++ b/src/Language/ClassificationTypes.cs @@ -7,7 +7,7 @@ namespace MarkdownEditor2022 { - internal static class MarkdownClassificationTypes + internal static class ClassificationTypes { public const string MarkdownBold = "md_bold"; public const string MarkdownItalic = "md_italic"; @@ -53,8 +53,8 @@ internal static class MarkdownClassificationTypes } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = MarkdownClassificationTypes.MarkdownBold)] - [Name(MarkdownClassificationTypes.MarkdownBold)] + [ClassificationType(ClassificationTypeNames = ClassificationTypes.MarkdownBold)] + [Name(ClassificationTypes.MarkdownBold)] internal sealed class MarkdownBoldFormatDefinition : ClassificationFormatDefinition { public MarkdownBoldFormatDefinition() @@ -65,8 +65,8 @@ public MarkdownBoldFormatDefinition() } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = MarkdownClassificationTypes.MarkdownItalic)] - [Name(MarkdownClassificationTypes.MarkdownItalic)] + [ClassificationType(ClassificationTypeNames = ClassificationTypes.MarkdownItalic)] + [Name(ClassificationTypes.MarkdownItalic)] internal sealed class MarkdownItalicFormatDefinition : ClassificationFormatDefinition { public MarkdownItalicFormatDefinition() @@ -77,8 +77,8 @@ public MarkdownItalicFormatDefinition() } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = MarkdownClassificationTypes.MarkdownStrikethrough)] - [Name(MarkdownClassificationTypes.MarkdownStrikethrough)] + [ClassificationType(ClassificationTypeNames = ClassificationTypes.MarkdownStrikethrough)] + [Name(ClassificationTypes.MarkdownStrikethrough)] internal sealed class MarkdownStrikethroughFormatDefinition : ClassificationFormatDefinition { public MarkdownStrikethroughFormatDefinition() @@ -92,8 +92,8 @@ public MarkdownStrikethroughFormatDefinition() } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = MarkdownClassificationTypes.MarkdownHeader)] - [Name(MarkdownClassificationTypes.MarkdownHeader)] + [ClassificationType(ClassificationTypeNames = ClassificationTypes.MarkdownHeader)] + [Name(ClassificationTypes.MarkdownHeader)] [UserVisible(true)] internal sealed class MarkdownHeaderFormatDefinition : ClassificationFormatDefinition { @@ -105,8 +105,8 @@ public MarkdownHeaderFormatDefinition() } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = MarkdownClassificationTypes.MarkdownCode)] - [Name(MarkdownClassificationTypes.MarkdownCode)] + [ClassificationType(ClassificationTypeNames = ClassificationTypes.MarkdownCode)] + [Name(ClassificationTypes.MarkdownCode)] [UserVisible(true)] internal sealed class MarkdownCodeFormatDefinition : ClassificationFormatDefinition { @@ -118,8 +118,8 @@ public MarkdownCodeFormatDefinition() } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = MarkdownClassificationTypes.MarkdownQuote)] - [Name(MarkdownClassificationTypes.MarkdownQuote)] + [ClassificationType(ClassificationTypeNames = ClassificationTypes.MarkdownQuote)] + [Name(ClassificationTypes.MarkdownQuote)] [UserVisible(true)] internal sealed class MarkdownQuoteFormatDefinition : ClassificationFormatDefinition { @@ -132,8 +132,8 @@ public MarkdownQuoteFormatDefinition() } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = MarkdownClassificationTypes.MarkdownHtml)] - [Name(MarkdownClassificationTypes.MarkdownHtml)] + [ClassificationType(ClassificationTypeNames = ClassificationTypes.MarkdownHtml)] + [Name(ClassificationTypes.MarkdownHtml)] [UserVisible(true)] internal sealed class MarkdownHtmlFormatDefinition : ClassificationFormatDefinition { @@ -144,8 +144,8 @@ public MarkdownHtmlFormatDefinition() } [Export(typeof(EditorFormatDefinition))] - [ClassificationType(ClassificationTypeNames = MarkdownClassificationTypes.MarkdownLink)] - [Name(MarkdownClassificationTypes.MarkdownLink)] + [ClassificationType(ClassificationTypeNames = ClassificationTypes.MarkdownLink)] + [Name(ClassificationTypes.MarkdownLink)] [UserVisible(true)] [Order(After = Priority.High)] internal sealed class MarkdownLinkFormatDefinition : ClassificationFormatDefinition diff --git a/src/Language/EditorFeatures.cs b/src/Language/EditorFeatures.cs index e51e89a..9094e4b 100644 --- a/src/Language/EditorFeatures.cs +++ b/src/Language/EditorFeatures.cs @@ -23,15 +23,15 @@ public class SyntaxHighligting : TokenClassificationTaggerBase { public override Dictionary ClassificationMap { get; } = new() { - { MarkdownClassificationTypes.MarkdownHeader, MarkdownClassificationTypes.MarkdownHeader }, - { MarkdownClassificationTypes.MarkdownCode, MarkdownClassificationTypes.MarkdownCode }, - { MarkdownClassificationTypes.MarkdownHtml, MarkdownClassificationTypes.MarkdownHtml }, - { MarkdownClassificationTypes.MarkdownComment, MarkdownClassificationTypes.MarkdownComment }, - { MarkdownClassificationTypes.MarkdownLink, MarkdownClassificationTypes.MarkdownLink }, - { MarkdownClassificationTypes.MarkdownItalic, MarkdownClassificationTypes.MarkdownItalic }, - { MarkdownClassificationTypes.MarkdownStrikethrough, MarkdownClassificationTypes.MarkdownStrikethrough }, - { MarkdownClassificationTypes.MarkdownBold, MarkdownClassificationTypes.MarkdownBold }, - { MarkdownClassificationTypes.MarkdownQuote, MarkdownClassificationTypes.MarkdownQuote }, + { ClassificationTypes.MarkdownHeader, ClassificationTypes.MarkdownHeader }, + { ClassificationTypes.MarkdownCode, ClassificationTypes.MarkdownCode }, + { ClassificationTypes.MarkdownHtml, ClassificationTypes.MarkdownHtml }, + { ClassificationTypes.MarkdownComment, ClassificationTypes.MarkdownComment }, + { ClassificationTypes.MarkdownLink, ClassificationTypes.MarkdownLink }, + { ClassificationTypes.MarkdownItalic, ClassificationTypes.MarkdownItalic }, + { ClassificationTypes.MarkdownStrikethrough, ClassificationTypes.MarkdownStrikethrough }, + { ClassificationTypes.MarkdownBold, ClassificationTypes.MarkdownBold }, + { ClassificationTypes.MarkdownQuote, ClassificationTypes.MarkdownQuote }, }; } diff --git a/src/Language/TokenTagger.cs b/src/Language/TokenTagger.cs index e790674..cb82761 100644 --- a/src/Language/TokenTagger.cs +++ b/src/Language/TokenTagger.cs @@ -143,15 +143,15 @@ private static string GetItemType(MarkdownObject mdobj) { return mdobj switch { - HeadingBlock => MarkdownClassificationTypes.MarkdownHeader, - CodeBlock or CodeInline => MarkdownClassificationTypes.MarkdownCode, - QuoteBlock => MarkdownClassificationTypes.MarkdownQuote, - LinkInline => MarkdownClassificationTypes.MarkdownLink, - EmphasisInline ei when ei.DelimiterCount == 2 && ei.DelimiterChar == '~' => MarkdownClassificationTypes.MarkdownStrikethrough, - EmphasisInline ei when ei.DelimiterCount == 1 => MarkdownClassificationTypes.MarkdownItalic, - EmphasisInline ei when ei.DelimiterCount == 2 => MarkdownClassificationTypes.MarkdownBold, - HtmlBlock html when html.Type == HtmlBlockType.Comment => MarkdownClassificationTypes.MarkdownComment, - HtmlBlock or HtmlInline or HtmlEntityInline => MarkdownClassificationTypes.MarkdownHtml, + HeadingBlock => ClassificationTypes.MarkdownHeader, + CodeBlock or CodeInline => ClassificationTypes.MarkdownCode, + QuoteBlock => ClassificationTypes.MarkdownQuote, + LinkInline => ClassificationTypes.MarkdownLink, + EmphasisInline ei when ei.DelimiterCount == 2 && ei.DelimiterChar == '~' => ClassificationTypes.MarkdownStrikethrough, + EmphasisInline ei when ei.DelimiterCount == 1 => ClassificationTypes.MarkdownItalic, + EmphasisInline ei when ei.DelimiterCount == 2 => ClassificationTypes.MarkdownBold, + HtmlBlock html when html.Type == HtmlBlockType.Comment => ClassificationTypes.MarkdownComment, + HtmlBlock or HtmlInline or HtmlEntityInline => ClassificationTypes.MarkdownHtml, _ => null, }; } diff --git a/src/MarkdownEditor2022.csproj b/src/MarkdownEditor2022.csproj index d948345..31c45ec 100644 --- a/src/MarkdownEditor2022.csproj +++ b/src/MarkdownEditor2022.csproj @@ -64,7 +64,7 @@ - +