Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
- Added support for the content type used by the Markdown Editor v2 extension.  Fixes #268 .
- Added support for C# 11 raw string literals. Fixes #265.
  • Loading branch information
EWSoftware committed Dec 11, 2022
1 parent 1d9eb93 commit e52d8ed
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 18 deletions.
6 changes: 6 additions & 0 deletions Docs/Content/VersionHistory/VersionHistory.aml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ project. Select a version below to see a description of its changes.</para>
<section>
<content>
<list class="bullet">
<listItem>
<para>
<link xlink:href="c3044e18-d35c-445d-b24b-646f26056f82" />
</para>
</listItem>

<listItem>
<para>
<link xlink:href="d671e91a-9945-4d1f-9d5c-6035037990d8" />
Expand Down
29 changes: 29 additions & 0 deletions Docs/Content/VersionHistory/v2022.12.11.0.aml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<topic id="c3044e18-d35c-445d-b24b-646f26056f82" revisionNumber="1">
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>Changes in this release:</para>
</introduction>

<section>
<content>

<list class="bullet">
<listItem>
<para>Added support for the content type used by the Markdown Editor v2 extension.</para>
</listItem>

<listItem>
<para>Added support for C# 11 raw string literals.</para>
</listItem>
</list>

</content>
</section>

<relatedTopics>
<link xlink:href="548dc6d7-6d08-4006-82b3-d5830be96f04" />
</relatedTopics>

</developerConceptualDocument>
</topic>
2 changes: 1 addition & 1 deletion Docs/Content/VersionHistory/v2022.9.6.0.aml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<topic id="d671e91a-9945-4d1f-9d5c-6035037990d8" revisionNumber="1">
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>Changes in this release</para>
<para>Changes in this release:</para>
</introduction>

<section>
Expand Down
9 changes: 7 additions & 2 deletions Docs/ContentLayout.content
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,17 @@
<HelpKeywords>
<HelpKeyword index="K" term="version, history" />
</HelpKeywords>
<Topic id="d671e91a-9945-4d1f-9d5c-6035037990d8" visible="True" title="Version 2022.9.6.0">
<Topic id="c3044e18-d35c-445d-b24b-646f26056f82" visible="True" title="Version 2022.12.11.0">
<HelpKeywords>
<HelpKeyword index="K" term="versions, 2022.12.11.0" />
</HelpKeywords>
</Topic>
<Topic id="d671e91a-9945-4d1f-9d5c-6035037990d8" visible="True" isSelected="true" title="Version 2022.9.6.0">
<HelpKeywords>
<HelpKeyword index="K" term="versions, 2022.9.6.0" />
</HelpKeywords>
</Topic>
<Topic id="e791c561-0d79-4476-b31a-1f337e295d63" visible="True" isSelected="true" title="Version 2022.1.3.0">
<Topic id="e791c561-0d79-4476-b31a-1f337e295d63" visible="True" title="Version 2022.1.3.0">
<HelpKeywords>
<HelpKeyword index="K" term="versions, 2022.1.3.0" />
</HelpKeywords>
Expand Down
3 changes: 2 additions & 1 deletion Docs/VSSpellCheckerDocs.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</NamespaceSummaries>
<ComponentConfigurations>
</ComponentConfigurations>
<HelpFileVersion>2022.1.3.0</HelpFileVersion>
<HelpFileVersion>2022.12.11.0</HelpFileVersion>
<SaveComponentCacheCapacity>0</SaveComponentCacheCapacity>
<SourceCodeBasePath>..\Source\</SourceCodeBasePath>
<WarnOnMissingSourceContext>True</WarnOnMissingSourceContext>
Expand Down Expand Up @@ -201,6 +201,7 @@
<None Include="Content\VersionHistory\v2021.1.23.0.aml" />
<None Include="Content\VersionHistory\v2021.3.1.0.aml" />
<None Include="Content\VersionHistory\v2022.1.3.0.aml" />
<None Include="Content\VersionHistory\v2022.12.11.0.aml" />
<None Include="Content\VersionHistory\v2022.9.6.0.aml" />
<None Include="Content\VersionHistory\VersionHistory.aml" />
<None Include="Content\VersionHistory\v2015.8.15.0.aml" />
Expand Down
2 changes: 1 addition & 1 deletion Source/VSSpellChecker2017And2019/Classifications.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<Match Expression="^\s*#include\s*&quot;.*?&quot;" Options="Multiline" Classification="Undefined" />
<Match Expression="\s*/\*.*?\*/" Options="Singleline" Classification="DelimitedComments" />
<Match Expression="\s*//.*?([\r\n]{1,2}|$)" Classification="SingleLineComment" />
<Match Expression="(&quot;&quot;)|((\$|@)?(@|R|\$)&quot;(.|[\r\n])*?&quot;|\$&quot;(.|[\r\n])*?&quot;|&quot;(.|\\&quot;|\\\r\n)*?((\\\\)+&quot;|[^\\]{1}&quot;))"
<Match Expression="(&quot;&quot;[^&quot;])|((\$|@)?(@|R|\$)&quot;{1,3}(.|[\r\n])*?&quot;{1,3}|\$&quot;{1,3}(.|[\r\n])*?&quot;{1,3}|&quot;{1,3}(.|\\&quot;|\\\r\n)*?((\\\\)+&quot;{1,3}|[^\\]{1}&quot;{1,3}))"
Classification="NormalStringLiteral" />
<Match Expression="(?&lt;=^\s*#(pragma )?region).*?[\r\n]{1,2}" Options="Multiline" Classification="RegionDirective" />
<Match Expression="(?&lt;=^\s*#endregion).*?[\r\n]{1,2}" Options="Multiline" Classification="RegionDirective" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="43EA967E-0DE2-4136-8E52-C6DCFB5C2748" Version="2022.9.6.0" Language="en-US" Publisher="EWSoftware" />
<Identity Id="43EA967E-0DE2-4136-8E52-C6DCFB5C2748" Version="2022.12.11.0" Language="en-US" Publisher="EWSoftware" />
<DisplayName>Visual Studio Spell Checker (VS2017 and VS2019)</DisplayName>
<Description xml:space="preserve">An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with a tool window. It can also spell check an entire solution, project, or selected items. Options are available to define multiple languages to spell check against, define ignored words, control how elements and attributes in XML and MAML files are spell checked, and much more.</Description>
<MoreInfo>https://ewsoftware.github.io/VSSpellChecker</MoreInfo>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="E1019027-EE37-4B1A-AD4C-25CAA92CA2D5" Version="2022.9.6.0" Language="en-US" Publisher="EWSoftware" />
<Identity Id="E1019027-EE37-4B1A-AD4C-25CAA92CA2D5" Version="2022.12.11.0" Language="en-US" Publisher="EWSoftware" />
<DisplayName>Visual Studio Spell Checker (VS2022 and Later)</DisplayName>
<Description xml:space="preserve">An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with a tool window. It can also spell check an entire solution, project, or selected items. Options are available to define multiple languages to spell check against, define ignored words, control how elements and attributes in XML and MAML files are spell checked, and much more.</Description>
<MoreInfo>https://ewsoftware.github.io/VSSpellChecker</MoreInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// System : Visual Studio Spell Checker
// File : AssemblyInfoShared.cs
// Author : Eric Woodruff ([email protected])
// Updated : 09/06/2022
// Updated : 12/11/2022
// Note : Copyright 2013-2022, Eric Woodruff, All rights reserved
//
// Visual Studio spell checker common assembly attributes
Expand Down Expand Up @@ -82,13 +82,13 @@ internal static partial class AssemblyInfo
//
// This is used to set the assembly file version. This will change with each new release. MSIs only
// support a Major value between 0 and 255 so we drop the century from the year on this one.
public const string FileVersion = "22.9.6.0";
public const string FileVersion = "22.12.11.0";

// Common product version
//
// This may contain additional text to indicate Alpha or Beta states. The version number will always match
// the file version above but includes the century on the year.
public const string ProductVersion = "2022.9.6.0";
public const string ProductVersion = "2022.12.11.0";

// Assembly copyright information
public const string Copyright = "Copyright \xA9 2013-2022, Eric Woodruff, All Rights Reserved.\r\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// System : Visual Studio Spell Checker Package
// File : CSharpCommentTextTagger.cs
// Authors : Noah Richards, Roman Golovin, Michael Lehenbauer, Eric Woodruff
// Updated : 07/24/2020
// Note : Copyright 2010-2020, Microsoft Corporation, All rights reserved
// Portions Copyright 2013-2020, Eric Woodruff, All rights reserved
// Updated : 11/23/2022
// Note : Copyright 2010-2022, Microsoft Corporation, All rights reserved
// Portions Copyright 2013-2022, Eric Woodruff, All rights reserved
//
// This file contains a class used to provide tags for C# code
//
Expand Down Expand Up @@ -50,6 +50,8 @@ internal class CSharpCommentTextTagger : ITagger<NaturalTextTag>, IDisposable
private readonly ITextBuffer buffer;
private ITextSnapshot lineCacheSnapshot;
private readonly List<State> lineCache;
private string endQuotes;
private int quoteSize;

#endregion

Expand Down Expand Up @@ -384,9 +386,12 @@ private void ScanDefault(LineProgress p)
}
else if(((p.Char() == '@' || p.Char() == 'R') && p.NextChar() == '"') ||
(p.Char() == '$' && p.NextChar() == '@' && p.NextNextChar() == '"') ||
(p.Char() == '@' && p.NextChar() == '$' && p.NextNextChar() == '"')) // Verbatim, raw, or interpolated verbatim string
(p.Char() == '@' && p.NextChar() == '$' && p.NextNextChar() == '"') ||
(p.Char() == '"' && p.NextSegment(3) == "\"\"\"") ||
(p.Char() == '$' && p.NextSegment(4) == "$\"\"\"")) // Verbatim, raw, or interpolated verbatim string
{
// Keep the leading text so that we can handle escape sequences properly
quoteSize = 0;
p.State = State.MultiLineString;
ScanMultiLineString(p, true);
}
Expand Down Expand Up @@ -635,11 +640,47 @@ private void ScanMultiLineString(LineProgress p, bool isVerbatimString)
// For verbatim/raw/interpolated strings, skip the leading format identifier. We keep it so that we
// can skip escape sequence checking and properties in them.
if(isVerbatimString)
p.Advance((p.NextChar() == '$' || p.NextChar() == '@') ? 3 : 2);
{
if(p.NextSegment(3) == "\"\"\"")
{
while(!p.EndOfLine && p.Char() == '"')
{
quoteSize++;
p.Advance();
}

endQuotes = new String('"', quoteSize);
}
else if(p.NextSegment(4) == "$\"\"\"")
{
p.Advance();

while(!p.EndOfLine && p.Char() == '"')
{
quoteSize++;
p.Advance();
}

endQuotes = new String('"', quoteSize);
}
else
p.Advance((p.NextChar() == '$' || p.NextChar() == '@') ? 3 : 2);
}

while(!p.EndOfLine)
{
if(p.Char() == '"' && p.NextChar() == '"') // "" is allowed within multi-line string.
if(quoteSize != 0 && p.NextSegment(quoteSize) == endQuotes)
{
// End raw string literal
if(markText)
p.EndNaturalText();

p.Advance(quoteSize);
p.State = State.Default;
quoteSize = 0;
return;
}
else if(p.Char() == '"' && p.NextChar() == '"') // "" is allowed within multi-line string.
{
p.Advance(2);
}
Expand Down
4 changes: 2 additions & 2 deletions Source/VSSpellCheckerShared/Tagging/CommentTextTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// System : Visual Studio Spell Checker Package
// File : CommentTextTagger.cs
// Authors : Noah Richards, Roman Golovin, Michael Lehenbauer, Eric Woodruff
// Updated : 01/03/2022
// Updated : 11/23/2022
// Note : Copyright 2010-2022, Microsoft Corporation, All rights reserved
// Portions Copyright 2013-2022, Eric Woodruff, All rights reserved
//
Expand Down Expand Up @@ -90,7 +90,7 @@ public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
return null;

// Markdown has its own tagger
if(buffer.ContentType.IsOfType("Markdown"))
if(buffer.ContentType.IsOfType("Markdown") || buffer.ContentType.IsOfType("code++.Markdown"))
return new MarkdownTextTagger(buffer, classifierAggregatorService.GetClassifier(buffer),
config.IgnoredClassificationsFor(buffer.ContentType.TypeName)) as ITagger<T>;

Expand Down

0 comments on commit e52d8ed

Please sign in to comment.