Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
- Added a separate solution/project classifier for .tsx and .jsx files.  These are also handled by the general tagger now in the editor to account for the mix of code and HTML.  Fixes #237.
- Added the Razor content type to the HTML tagger.  Fixes #251.
- Made several changes to the solution/project spell checking code to avoid responsiveness issues in Visual Studio caused by garbage collections triggered by the code in prior releases.  Fixes #244.  May also fix #236.
  • Loading branch information
EWSoftware committed Jan 3, 2022
1 parent 2072c6a commit 88a0fab
Show file tree
Hide file tree
Showing 20 changed files with 556 additions and 217 deletions.
7 changes: 7 additions & 0 deletions Docs/Content/ClassifierDefinition.aml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ Such undefined spans are removed from other classified spans to reduce the numbe
from the removed spans.</para>
</listItem>

<listItem>
<para><codeInline>ScriptWithHtmlClassifier</codeInline> - This classifier is similar to the
<codeInline>CodeClassifier</codeInline> described above but is specific to JavaScript and TypeScript files that
contain embedded HTML elements. It will parse the code and also the HTML elements to include the wanted HTML
element parts such as inner text and exclude the unwanted HTML elements parts such as ignored attribute values.</para>
</listItem>

<listItem>
<para><codeInline>RegexClassifier</codeInline> - This is a general classifier that uses a series of
regular expressions to classify file content as code comments or string literals. This is useful for non-code
Expand Down
22 changes: 12 additions & 10 deletions Docs/Content/CustomDictionaries.aml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<introduction>
<para>The package uses NHunspell to perform spell checking and comes with several dictionaries for various
languages. Since NHunspell makes use of Open Office dictionaries, you can download additional dictionaries for
other languages. To make them available to the spell checker, do the following:
other languages. Dictionaries for OpenOffice versions 2, 3, and 4 are supported. To make them available to the
spell checker, do the following:
</para>
</introduction>

Expand All @@ -17,18 +18,19 @@ other languages. To make them available to the spell checker, do the following:
<linkAlternateText>Search for OpenOffice dictionaries</linkAlternateText>
<linkUri>http://extensions.services.openoffice.org/dictionary</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink> and download the dictionaries for the languages you need. Dictionaries for OpenOffice versions
2, 3, and 4 are supported.</para>
</externalLink> and download the dictionaries for the languages you need. If the downloaded file has a
<localUri>.oxt</localUri> extension, rename it to have a <localUri>.zip</localUri> extension. Extract the
content of the file and locate the <localUri>.aff</localUri> and <localUri>.dic</localUri> dictionary files.</para>
</listItem>

<listItem>
<para>If the downloaded file has a <localUri>.oxt</localUri> extension, rename it to have a
<localUri>.zip</localUri> extension.</para>
</listItem>

<listItem>
<para>Extract the content of the file and locate the <localUri>.aff</localUri> and
<localUri>.dic</localUri> dictionary files.</para>
<para>Another source for Open Office dictionaries is the <externalLink>
<linkText>LibreOffice dictionary repository</linkText>
<linkAlternateText>LibreOffice dictionary repository</linkAlternateText>
<linkUri>http://extensions.services.openoffice.org/dictionary</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink>. Locate the language you want to use and download the <localUri>.aff</localUri> and
<localUri>.dic</localUri> dictionary files for it.</para>
</listItem>

<listItem>
Expand Down
6 changes: 5 additions & 1 deletion Docs/Content/Installation.aml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ them.</para>
<linkText>Visual Studio 2013/2015</linkText>
<linkUri>https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellChecker</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink> and
</externalLink>,
<externalLink>
<linkText>Visual Studio 2017/2019</linkText>
<linkUri>https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2017andLater</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink>, and <externalLink>
<linkText>Visual Studio 2022 and Later</linkText>
<linkUri>https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2022andLater</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink>) using the <ui>Tools | Extension and Updates</ui> option (Visual Studio 2017) or
<ui>Extensions | Manage Extensions</ui> option (Visual Studio 2019 or later). Select the online marketplace and
search for "Visual Studio Spell Checker". Include the quote marks for an exact match and find the one created by
Expand Down
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="e791c561-0d79-4476-b31a-1f337e295d63" />
</para>
</listItem>

<listItem>
<para>
<link xlink:href="e1588046-393b-4864-a3c1-6771b73bf124" />
Expand Down
48 changes: 48 additions & 0 deletions Docs/Content/VersionHistory/v2022.1.3.0.aml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<topic id="e791c561-0d79-4476-b31a-1f337e295d63" 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 Visual Studio 2022 in July 2021. Since it was the only change, no
help update was published for that release.</para>
</listItem>

<listItem>
<para>Added <localUri>.tsx</localUri> as a recognized file extension for solution/project spell
checking. Both it and <localUri>.jsx</localUri> files are now handled by their own parser that takes into
account HTML elements that may be embedded in the code for spell checking. Because of the mix of code an HTML,
those two file types are now handled by the general tagger in the editor rather than the C# tagger. As such, the
C-style configuration options are not applied to those file types anymore.</para>
</listItem>

<listItem>
<para>Added a case to the general tagger to ignore the <codeInline>text</codeInline> classification
for Python files when the Python workload is installed. When it is, the classifier for Python files flags many
elements as text even when they are not (variables etc.)</para>
</listItem>

<listItem>
<para>Updated the HTML tagger so that it is used for Razor file content.</para>
</listItem>

<listItem>
<para>Made several changes to the solution/project spell checking code to avoid responsiveness issues
in Visual Studio caused by garbage collections triggered by the code in prior releases.</para>
</listItem>
</list>

</content>
</section>

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

</developerConceptualDocument>
</topic>
7 changes: 6 additions & 1 deletion 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="e791c561-0d79-4476-b31a-1f337e295d63" visible="True" isSelected="true" title="Version 2022.1.3.0">
<HelpKeywords>
<HelpKeyword index="K" term="versions, 2022.1.3.0" />
</HelpKeywords>
</Topic>
<Topic id="e1588046-393b-4864-a3c1-6771b73bf124" visible="True" title="Version 2021.3.1.0">
<HelpKeywords>
<HelpKeyword index="K" term="versions, 2021.3.1.0" />
</HelpKeywords>
</Topic>
<Topic id="bb88f7d5-2491-457e-9ba3-8d7d0bbc8615" visible="True" isSelected="true" title="Version 2021.1.23.0">
<Topic id="bb88f7d5-2491-457e-9ba3-8d7d0bbc8615" visible="True" title="Version 2021.1.23.0">
<HelpKeywords>
<HelpKeyword index="K" term="versions, 2021.1.23.0" />
</HelpKeywords>
Expand Down
7 changes: 4 additions & 3 deletions Docs/VSSpellCheckerDocs.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
<NamingMethod>Guid</NamingMethod>
<HelpTitle>Visual Studio Spell Checker Documentation</HelpTitle>
<FeedbackEMailAddress>Eric%40EWoodruff.us</FeedbackEMailAddress>
<CopyrightText>Copyright \xA9 2013-2021, Eric Woodruff, All rights reserved</CopyrightText>
<CopyrightText>Copyright \xA9 2013-2022, Eric Woodruff, All rights reserved</CopyrightText>
<CopyrightHref>https://GitHub.com/EWSoftware/VSSpellChecker</CopyrightHref>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<NamespaceSummaries>
<NamespaceSummaryItem name="VisualStudio.SpellChecker.Definitions" isDocumented="True" xmlns="">This namespace contains classes used to create new tagger providers for third-party content types so that they can make use of the spell checker.</NamespaceSummaryItem>
</NamespaceSummaries>
<ComponentConfigurations>
</ComponentConfigurations>
<HelpFileVersion>2021.3.1.0</HelpFileVersion>
<HelpFileVersion>2022.1.3.0</HelpFileVersion>
<SaveComponentCacheCapacity>0</SaveComponentCacheCapacity>
<SourceCodeBasePath>..\Source\</SourceCodeBasePath>
<WarnOnMissingSourceContext>True</WarnOnMissingSourceContext>
Expand Down Expand Up @@ -184,6 +184,7 @@
<None Include="Content\VersionHistory\v2020.8.24.0.aml" />
<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\VersionHistory.aml" />
<None Include="Content\VersionHistory\v2015.8.15.0.aml" />
<None Include="Content\VersionHistory\v2015.9.19.0.aml" />
Expand Down Expand Up @@ -217,4 +218,4 @@
</ItemGroup>
<!-- Import the SHFB build targets -->
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
</Project>
</Project>
8 changes: 4 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ Copyright Notices
-----------------
The core Visual Studio package code related to the spell checker implementation
was originally written by Noah Richards, Roman Golovin, and Michael Lehenbauer
and is Copyright (c) 2010-2021 Microsoft Corporation, All Rights Reserved.
and is Copyright (c) 2010-2022 Microsoft Corporation, All Rights Reserved.

The NHunspell library is Copyright (c) 2009-2021 Maierhofer Software,
The NHunspell library is Copyright (c) 2009-2022 Maierhofer Software,
All Rights Reserved.

The HTML Agility Pack is Copyright (c) 2006-2021 Simon Mourier, All Rights
The HTML Agility Pack is Copyright (c) 2006-2022 Simon Mourier, All Rights
Reserved.

All other code is Copyright (c) 2013-2021 Eric Woodruff, All Rights Reserved.
All other code is Copyright (c) 2013-2022 Eric Woodruff, All Rights Reserved.

All dictionaries supplied with the package are property of their respective
copyright holders. See the README files in the dictionary folder at the project
Expand Down
17 changes: 15 additions & 2 deletions Source/VSSpellChecker2017And2019/Classifications.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@
<Match Expression="(?&lt;=^\s*#region).*?[\r\n]{1,2}" Options="Multiline" Classification="RegionDirective" />
</Classifier>

<!-- Like CStyleScript but for JavaScript/TypeScript mixed with HTML. We can't reliably handle both in the
general code classifier. The classifier will do it's best to classify the code and HTML content but the
C-style options will not be applied. -->
<Classifier Id="ScriptWithHtml" Type="ScriptWithHtmlClassifier" XmlDocCommentDelimiter="///" QuadSlashDelimiter="////">
<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;))"
Classification="NormalStringLiteral" />
<Match Expression="'(.|\\'|\\\r\n)*?((\\\\)+'|[^\\]{1}')" Classification="NormalStringLiteral" />
<Match Expression="(?&lt;=^\s*#region).*?[\r\n]{1,2}" Options="Multiline" Classification="RegionDirective" />
</Classifier>

<!-- This should work for pretty much all VB-style languages: VB, VB.NET, VBScripts, etc. -->
<Classifier Id="VBStyle" Type="CodeClassifier" XmlDocCommentDelimiter="'''" QuadSlashDelimiter="''''">
<Match Expression="\s*('.*?|Rem(\t| ).*?|Rem)([\r\n]{1,2}|$)" Options="IgnoreCase" Classification="SingleLineComment" />
Expand Down Expand Up @@ -211,9 +223,10 @@
<Extension Value="rc" Classifier="CStyle" />
<Extension Value="xpp" Classifier="CStyle" />
<Extension Value="js" Classifier="CStyleScript" />
<Extension Value="jsx" Classifier="CStyleScript" />
<Extension Value="ts" Classifier="CStyleScript" />
<Extension Value="tsx" Classifier="CStyleScript" />

<Extension Value="jsx" Classifier="ScriptWithHtml" />
<Extension Value="tsx" Classifier="ScriptWithHtml" />

<Extension Value="bas" Classifier="VBStyle" />
<Extension Value="vb" Classifier="VBStyle" />
Expand Down
Loading

0 comments on commit 88a0fab

Please sign in to comment.