Skip to content

Commit

Permalink
Renamed class
Browse files Browse the repository at this point in the history
  • Loading branch information
madskristensen committed Jan 8, 2022
1 parent 29df68d commit d756186
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions src/Language/EditorFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public class SyntaxHighligting : TokenClassificationTaggerBase
{
public override Dictionary<object, string> 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 },
};
}

Expand Down
18 changes: 9 additions & 9 deletions src/Language/TokenTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/MarkdownEditor2022.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<Compile Include="ExtensionMethods.cs" />
<Compile Include="Language\EditorFeatures.cs" />
<Compile Include="Language\MarkdownEditor.cs" />
<Compile Include="Language\MarkdownClassificationTypes.cs" />
<Compile Include="Language\ClassificationTypes.cs" />
<Compile Include="Language\DropdownBars.cs" />
<Compile Include="Language\TokenTagger.cs" />
<Compile Include="Margin\Browser.cs" />
Expand Down

0 comments on commit d756186

Please sign in to comment.