diff --git a/Docs/Content/Installation.aml b/Docs/Content/Installation.aml
index 2e0a379..dbb6b84 100644
--- a/Docs/Content/Installation.aml
+++ b/Docs/Content/Installation.aml
@@ -41,15 +41,16 @@ them.
Visual Studio 2017 or laterhttps://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2017andLater_blank
-) using the Tools | Extension and Updates option. Select the online marketplace and
+) using the Tools | Extension and Updates option (Visual Studio 2017) or
+Extensions | Manage Extensions 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
EWSoftware. Once found, you can click the Download button to download and
install it.
Once installed, you will find a new Spell Checker option on the Tools menu.
-Unless other packages have been installed that alter its position, it will be the fourth option from the bottom
-between the External Tools and the Import and Export Settings options. Its submenu contains
-following options:
+Unless other packages have been installed that alter its position, it will be the fourth or fifth option from the
+bottom between the External Tools and the Import and Export Settings options. Its submenu
+contains following options:
@@ -65,6 +66,17 @@ way to find and resolve spelling issues without using the interactive spell chec
topic for more information.
+
+ Disable in Current Session/Enable in Current Session - This option acts as a
+toggle to temporarily disable and subsequently re-enable interactive spell checking in editors during the current
+Visual Studio session. This is separate from the Spell check as you type option in the configuration
+files. If that option is disabled, this menu option will have no effect.
+
+ Use this option to temporarily suspend spell checking in the current session. To turn it off
+on a more permanent basis either globally or for a solution, project, folder, or file, use the configuration file
+option instead.
+
+
Spell Check Entire Solution - This opens the
solution/project spell check tool window and
diff --git a/Docs/Content/VersionHistory/VersionHistory.aml b/Docs/Content/VersionHistory/VersionHistory.aml
index 1e06d89..52ddb40 100644
--- a/Docs/Content/VersionHistory/VersionHistory.aml
+++ b/Docs/Content/VersionHistory/VersionHistory.aml
@@ -9,6 +9,12 @@ project. Select a version below to see a description of its changes.
+
+
+
+
+
+
diff --git a/Docs/Content/VersionHistory/v2021.1.23.0.aml b/Docs/Content/VersionHistory/v2021.1.23.0.aml
new file mode 100644
index 0000000..b4b9105
--- /dev/null
+++ b/Docs/Content/VersionHistory/v2021.1.23.0.aml
@@ -0,0 +1,48 @@
+
+
+
+
+ Changes in this release:
+
+
+
+
+
+
+ Fixed loading of the default ignored words file in the absence of a default global configuration
+file.
+
+
+
+ Fixed loading of ignored words files so that words starting with an invalid escape sequence
+have the leading backslash removed.
+
+
+
+ Fixed saving words to the user dictionary file so that words added by other instances of Visual
+Studio are not lost.
+
+
+
+ Updated the word splitter to split text on emoji characters. This prevents them from being
+included as part of the preceding/following word and fixes a crash in NHunSpell that can occur if they are
+included as part of the word when using non-US dictionaries.
+
+
+
+ Added the menu option Tools, Spell Checker,
+Disable/Enable in Current Session to temporarily disable and subsequently re-enable
+interactive spell checking in editors during the current Visual Studio session.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Docs/ContentLayout.content b/Docs/ContentLayout.content
index acc408a..252bdd6 100644
--- a/Docs/ContentLayout.content
+++ b/Docs/ContentLayout.content
@@ -149,11 +149,16 @@
-
+
-
+
+
+
+
+
+
diff --git a/Docs/VSSpellCheckerDocs.shfbproj b/Docs/VSSpellCheckerDocs.shfbproj
index 2597f3c..2623dc4 100644
--- a/Docs/VSSpellCheckerDocs.shfbproj
+++ b/Docs/VSSpellCheckerDocs.shfbproj
@@ -41,7 +41,7 @@
GuidVisual Studio Spell Checker DocumentationEric%40EWoodruff.us
- Copyright \xA9 2013-2020, Eric Woodruff, All rights reserved
+ Copyright \xA9 2013-2021, Eric Woodruff, All rights reservedhttps://GitHub.com/EWSoftware/VSSpellCheckerAboveNamespaces
@@ -49,7 +49,7 @@
- 2020.8.24.0
+ 2021.1.23.00..\Source\True
@@ -182,6 +182,7 @@
+
diff --git a/LICENSE b/LICENSE
index 419ea42..c9e0f58 100644
--- a/LICENSE
+++ b/LICENSE
@@ -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-2020 Microsoft Corporation, All Rights Reserved.
+and is Copyright (c) 2010-2021 Microsoft Corporation, All Rights Reserved.
-The NHunspell library is Copyright (c) 2009-2020 Maierhofer Software,
+The NHunspell library is Copyright (c) 2009-2021 Maierhofer Software,
All Rights Reserved.
-The HTML Agility Pack is Copyright (c) 2006-2020 Simon Mourier, All Rights
+The HTML Agility Pack is Copyright (c) 2006-2021 Simon Mourier, All Rights
Reserved.
-All other code is Copyright (c) 2013-2020 Eric Woodruff, All Rights Reserved.
+All other code is Copyright (c) 2013-2021 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
diff --git a/Source/VSSpellChecker/Configuration/SpellCheckerConfiguration.cs b/Source/VSSpellChecker/Configuration/SpellCheckerConfiguration.cs
index 5e77c6e..0664e8e 100644
--- a/Source/VSSpellChecker/Configuration/SpellCheckerConfiguration.cs
+++ b/Source/VSSpellChecker/Configuration/SpellCheckerConfiguration.cs
@@ -2,8 +2,8 @@
// System : Visual Studio Spell Checker Package
// File : SpellCheckerConfiguration.cs
// Author : Eric Woodruff (Eric@EWoodruff.us)
-// Updated : 04/18/2020
-// Note : Copyright 2015-2020, Eric Woodruff, All rights reserved
+// Updated : 01/13/2021
+// Note : Copyright 2015-2021, Eric Woodruff, All rights reserved
//
// This file contains the class used to contain the spell checker's configuration settings
//
@@ -508,10 +508,9 @@ public void Load(string filename)
try
{
- // Nothing to do if the file doesn't exist
- if(!File.Exists(filename))
- return;
-
+ // We go through the motions of loading the configuration file even if it doesn't exist. This
+ // allows external files such as the default ignored words file to be loaded even if the default
+ // global configuration file does not exist.
var configuration = new SpellingConfigurationFile(filename, this);
loadedConfigFiles.Add(filename);
diff --git a/Source/VSSpellChecker/Configuration/SpellingConfigurationFile.cs b/Source/VSSpellChecker/Configuration/SpellingConfigurationFile.cs
index f328789..0a6deb7 100644
--- a/Source/VSSpellChecker/Configuration/SpellingConfigurationFile.cs
+++ b/Source/VSSpellChecker/Configuration/SpellingConfigurationFile.cs
@@ -2,8 +2,8 @@
// System : Visual Studio Spell Checker Package
// File : SpellingConfigurationFile.cs
// Author : Eric Woodruff (Eric@EWoodruff.us)
-// Updated : 10/05/2018
-// Note : Copyright 2015-2018, Eric Woodruff, All rights reserved
+// Updated : 01/13/2021
+// Note : Copyright 2015-2021, Eric Woodruff, All rights reserved
// Compiler: Microsoft Visual C#
//
// This file contains the class used to load and save spell checker configuration files
@@ -41,12 +41,12 @@ public class SpellingConfigurationFile
#region Private data members
//=====================================================================
- private Dictionary propertyCache;
+ private readonly Dictionary propertyCache;
private readonly PropertyDescriptorCollection configCache, csoCache, cadCache;
private readonly SpellCheckerConfiguration defaultConfig;
- private XDocument document;
- private XElement root;
+ private readonly XDocument document;
+ private readonly XElement root;
#endregion
@@ -139,7 +139,7 @@ public ConfigurationType ConfigurationType
public SpellingConfigurationFile(string filename, SpellCheckerConfiguration defaultConfig)
{
if(String.IsNullOrWhiteSpace(filename))
- throw new ArgumentNullException("filename", "Filename cannot be null or empty");
+ throw new ArgumentNullException(nameof(filename), "Filename cannot be null or empty");
this.Filename = filename;
this.defaultConfig = defaultConfig;
@@ -635,7 +635,7 @@ public bool ToBoolean(string propertyName)
!Boolean.TryParse(property.Value, out bool value))
{
object defaultValue = this.DefaultValueFor(propertyName);
- return (defaultValue != null) ? (bool)defaultValue : false;
+ return (defaultValue != null) && (bool)defaultValue;
}
return value;
@@ -675,7 +675,7 @@ public TEnum ToEnum(string propertyName) where TEnum : struct
!Enum.TryParse(property.Value, true, out TEnum value))
{
object defaultValue = this.DefaultValueFor(propertyName);
- value = (defaultValue != null) ? (TEnum)defaultValue : default(TEnum);
+ value = (defaultValue != null) ? (TEnum)defaultValue : default;
}
return value;
diff --git a/Source/VSSpellChecker/Editors/Pages/DictionarySettingsUserControl.xaml.cs b/Source/VSSpellChecker/Editors/Pages/DictionarySettingsUserControl.xaml.cs
index 26e0eca..2781493 100644
--- a/Source/VSSpellChecker/Editors/Pages/DictionarySettingsUserControl.xaml.cs
+++ b/Source/VSSpellChecker/Editors/Pages/DictionarySettingsUserControl.xaml.cs
@@ -2,8 +2,8 @@
// System : Visual Studio Spell Checker Package
// File : DictionarySettingsUserControl.xaml.cs
// Author : Eric Woodruff (Eric@EWoodruff.us)
-// Updated : 02/21/2020
-// Note : Copyright 2014-2020, Eric Woodruff, All rights reserved
+// Updated : 01/13/2021
+// Note : Copyright 2014-2021, Eric Woodruff, All rights reserved
//
// This file contains a user control used to edit the spell checker dictionary settings
//
@@ -889,7 +889,7 @@ private void btnExport_Click(object sender, RoutedEventArgs e)
}
}
- Utility.SaveCustomDictionary(dlg.FileName, replaceWords, true, uniqueWords.OrderBy(w => w));
+ Utility.SaveCustomDictionary(dlg.FileName, replaceWords, true, uniqueWords);
}
catch(Exception ex)
{
diff --git a/Source/VSSpellChecker/Editors/Pages/IgnoredWordsUserControl.xaml.cs b/Source/VSSpellChecker/Editors/Pages/IgnoredWordsUserControl.xaml.cs
index 0fc1c0d..ce7d11f 100644
--- a/Source/VSSpellChecker/Editors/Pages/IgnoredWordsUserControl.xaml.cs
+++ b/Source/VSSpellChecker/Editors/Pages/IgnoredWordsUserControl.xaml.cs
@@ -2,8 +2,8 @@
// System : Visual Studio Spell Checker Package
// File : IgnoredWordsUserControl.xaml.cs
// Author : Eric Woodruff (Eric@EWoodruff.us)
-// Updated : 03/19/2020
-// Note : Copyright 2014-2020, Eric Woodruff, All rights reserved
+// Updated : 01/13/2021
+// Note : Copyright 2014-2021, Eric Woodruff, All rights reserved
//
// This file contains a user control used to edit the ignored words spell checker configuration settings
//
@@ -342,7 +342,7 @@ private void btnExport_Click(object sender, RoutedEventArgs e)
}
}
- Utility.SaveCustomDictionary(dlg.FileName, replaceWords, false, uniqueWords.OrderBy(w => w));
+ Utility.SaveCustomDictionary(dlg.FileName, replaceWords, false, uniqueWords);
}
catch(Exception ex)
{
diff --git a/Source/VSSpellChecker/GlobalDictionary.cs b/Source/VSSpellChecker/GlobalDictionary.cs
index 26a6abf..31a5298 100644
--- a/Source/VSSpellChecker/GlobalDictionary.cs
+++ b/Source/VSSpellChecker/GlobalDictionary.cs
@@ -2,8 +2,8 @@
// System : Visual Studio Spell Checker Package
// File : GlobalDictionary.cs
// Author : Eric Woodruff (Eric@EWoodruff.us)
-// Updated : 02/21/2020
-// Note : Copyright 2013-2020, Eric Woodruff, All rights reserved
+// Updated : 01/20/2021
+// Note : Copyright 2013-2021, Eric Woodruff, All rights reserved
//
// This file contains a class that implements the global dictionary
//
@@ -179,20 +179,42 @@ public bool AddWordToDictionary(string word)
if(!dictionaryWordsFile.CanWriteToUserWordsFile(dictionaryFile))
return false;
+ bool multipleWordsAdded = false;
+
lock(dictionaryWords)
{
+ var currentDictionary = new HashSet(Utility.LoadUserDictionary(dictionaryWordsFile, false,
+ false), StringComparer.OrdinalIgnoreCase);
+
dictionaryWords.Add(word);
- // Sort and write all the words to the file. If under source control, this should minimize the
- // number of merge conflicts that could result if multiple people added words and they were all
- // written to the end of the file.
- File.WriteAllLines(dictionaryWordsFile, dictionaryWords.OrderBy(w => w));
+ // The word may have been added by another instance of Visual Studio. If so, don't save the change.
+ if(!currentDictionary.Contains(word))
+ {
+ int wordCount = dictionaryWords.Count;
+
+ // Add words added by other instances of Visual Studio not already in this copy of the
+ // dictionary so that we don't lose them when the file is saved. All new ones will be
+ // added as suggestions below.
+ dictionaryWords.UnionWith(currentDictionary);
+
+ multipleWordsAdded = (wordCount != dictionaryWords.Count);
+
+ // Sort and write all the words to the file. If under source control, this should minimize the
+ // number of merge conflicts that could result if multiple people added words and they were all
+ // written to the end of the file.
+ File.WriteAllLines(dictionaryWordsFile, dictionaryWords.OrderBy(w => w));
+ }
}
- this.AddSuggestion(word);
+ if(multipleWordsAdded)
+ this.AddSuggestions();
+ else
+ this.AddSuggestion(word);
- // Must pass the original word with mnemonics as it must match the span text
- this.NotifySpellingServicesOfChange(originalWord);
+ // Must pass the original word with mnemonics as it must match the span text. If multiple words
+ // were added from other instances, pass null to respell all text.
+ this.NotifySpellingServicesOfChange(multipleWordsAdded ? null : originalWord);
return true;
}
@@ -446,6 +468,17 @@ public static bool IsReadyForUse(CultureInfo language)
return true;
}
+ ///
+ /// This is used to notify all registered spelling dictionary services of a change in status
+ ///
+ /// This is used when turning the interactive spell checking on and off for the session
+ public static void NotifyChangeOfStatus()
+ {
+ if(globalDictionaries != null)
+ foreach(var g in globalDictionaries.Values)
+ g.NotifySpellingServicesOfChange(null);
+ }
+
///
/// This is used to load the user dictionary words file
///
diff --git a/Source/VSSpellChecker/GlobalSuppressions.cs b/Source/VSSpellChecker/GlobalSuppressions.cs
index d294a04..4ddc474 100644
Binary files a/Source/VSSpellChecker/GlobalSuppressions.cs and b/Source/VSSpellChecker/GlobalSuppressions.cs differ
diff --git a/Source/VSSpellChecker/License.rtf b/Source/VSSpellChecker/License.rtf
index 600cc23..dfdee34 100644
--- a/Source/VSSpellChecker/License.rtf
+++ b/Source/VSSpellChecker/License.rtf
@@ -1,15 +1,13 @@
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
+{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}
{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f51\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f52\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f54\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f55\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f56\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f57\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f58\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f59\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f51\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f52\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f54\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f55\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f56\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f57\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f58\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f59\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f43\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f44\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\f46\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f47\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f48\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f49\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\f50\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f51\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f53\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f54\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
+{\f56\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f57\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f58\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f59\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
+{\f60\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f61\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
@@ -32,16 +30,16 @@
{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
-\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{
-\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033
-\snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
+\red192\green192\blue192;\red0\green0\blue0;\red0\green0\blue0;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }
+\noqfpromote {\stylesheet{\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0
+\fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa160\sl259\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused
-Normal Table;}}{\*\rsidtbl \rsid12920148\rsid13042251\rsid13172878}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Woodruff, Eric}
-{\creatim\yr2019\mo4\dy14\hr13\min31}{\revtim\yr2020\mo3\dy19\hr15\min42}{\version3}{\edmins2}{\nofpages2}{\nofwords510}{\nofchars2915}{\nofcharsws3399}{\vern19}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
+Normal Table;}}{\*\rsidtbl \rsid8406335\rsid12920148\rsid13042251\rsid13172878}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Eric Woodruff}
+{\creatim\yr2019\mo4\dy14\hr13\min31}{\revtim\yr2021\mo1\dy13\hr10\min12}{\version4}{\edmins2}{\nofpages2}{\nofwords511}{\nofchars2914}{\nofcharsws3419}{\vern15}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
-\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale110\rsidroot13042251 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
+\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot13042251 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0
@@ -71,19 +69,20 @@ conditions. You may have additional consumer rights under your local laws which
\hich\af1\dbch\af31505\loch\f1 \hich\af1\dbch\af31505\loch\f1 and non-infringement.
\par }{\rtlch\fcs1 \ab\af1\afs18 \ltrch\fcs0 \b\f1\fs18\ul\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 Copyright Notices}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13172878
\par \hich\af1\dbch\af31505\loch\f1 The core Visual Studio package code related to the spell checker implementation was originally written by Noah Richards, Roman Golovin, and Michael Lehenbauer and}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0
-\f1\fs18\lang9\langfe1033\langnp9\insrsid13042251 \hich\af1\dbch\af31505\loch\f1 is Copyright (c) 2010-20}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid12920148 \hich\af1\dbch\af31505\loch\f1 20}{\rtlch\fcs1 \af1\afs18
-\ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 Microsoft Corporation, All\hich\af1\dbch\af31505\loch\f1 Rights Reserved.
-\par \hich\af1\dbch\af31505\loch\f1 The NHunspell library is Copyright (c) 2009-20}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid12920148 \hich\af1\dbch\af31505\loch\f1 20}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0
-\f1\fs18\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 Maierhofer Software, All Rights Reserved.
-\par \hich\af1\dbch\af31505\loch\f1 All other}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid12920148 \hich\af1\dbch\af31505\loch\f1 code is Copyright (c) 2013-20\hich\af1\dbch\af31505\loch\f1 20}{\rtlch\fcs1 \af1\afs18
-\ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 Eric Woodruff, All Rights Reserved.
+\f1\fs18\lang9\langfe1033\langnp9\insrsid13042251 \hich\af1\dbch\af31505\loch\f1 is Copyright (c) 2010-20}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid12920148 \hich\af1\dbch\af31505\loch\f1 2}{\rtlch\fcs1 \af1\afs18
+\ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid8406335 \hich\af1\dbch\af31505\loch\f1 1}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 Microsoft Corporation, All
+\hich\af1\dbch\af31505\loch\f1 Rights Reserved.
+\par \hich\af1\dbch\af31505\loch\f1 The NHunspell library is Copyright (c) 2009-20}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid12920148 \hich\af1\dbch\af31505\loch\f1 2}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0
+\f1\fs18\lang9\langfe1033\langnp9\insrsid8406335 \hich\af1\dbch\af31505\loch\f1 1}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 Maierhofer Software, All Rights Reserved.
+\par \hich\af1\dbch\af31505\loch\f1 All other}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid12920148 \hich\af1\dbch\af31505\loch\f1 code is Copyright (c) 2013-202}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0
+\f1\fs18\lang9\langfe1033\langnp9\insrsid8406335 \hich\af1\dbch\af31505\loch\f1 1}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 Eric Woodruff, All Rights Reserved.
\par \hich\af1\dbch\af31505\loch\f1 All dictionaries supplied with the package are property of their resp\hich\af1\dbch\af31505\loch\f1
ective copyright holders. See the README files in the dictionary folder at the project site for details and licensing terms:
\par }{\field{\*\fldinst {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 HYPERLINK "https://github.com/EWSoftware/VSSpellChecker/tree/master/Source/VSSpellChecker/NHunspell"}{\rtlch\fcs1
\af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13042251 {\*\datafield
00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90bca000000680074007400700073003a002f002f006700690074006800750062002e0063006f006d002f004500570053006f006600740077006100720065002f00560053005300700065006c006c004300680065006300
-6b00650072002f0074007200650065002f006d00610073007400650072002f0053006f0075007200630065002f00560053005300700065006c006c0043006800650063006b00650072002f004e00480075006e007300700065006c006c000000795881f43b1d7f48af2c825dc485276300000000a5ab000300}}}{\fldrslt
-{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\ul\cf2\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 https://github.com/EWSoftware/VSSpellChecker/tree/master/Source/VSSpellChecker/NHunspell}}}\sectd \ltrsect
+6b00650072002f0074007200650065002f006d00610073007400650072002f0053006f0075007200630065002f00560053005300700065006c006c0043006800650063006b00650072002f004e00480075006e007300700065006c006c000000795881f43b1d7f48af2c825dc485276300000000a5ab00030001}}
+}{\fldrslt {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\ul\cf2\lang9\langfe1033\langnp9\insrsid13172878 \hich\af1\dbch\af31505\loch\f1 https://github.com/EWSoftware/VSSpellChecker/tree/master/Source/VSSpellChecker/NHunspell}}}\sectd \ltrsect
\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang9\langfe1033\langnp9\insrsid13172878
\par
\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
@@ -138,7 +137,7 @@ babac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c02000013
617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax374\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;
+{\*\latentstyles\lsdstimax376\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;
\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;
\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1;
@@ -216,7 +215,8 @@ babac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c02000013
\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5;
\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6;
\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention;
-\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;}}{\*\datastore 0105000002000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
+\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Link;}}{\*\datastore 01050000
+02000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
@@ -225,8 +225,8 @@ fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000f078
-7b9c3ffed501feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
+ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000000024
+b9a6d7e9d601feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000105000000000000}}
\ No newline at end of file
diff --git a/Source/VSSpellChecker/PkgCmdID.cs b/Source/VSSpellChecker/PkgCmdID.cs
index 160bb5f..43d30d7 100644
--- a/Source/VSSpellChecker/PkgCmdID.cs
+++ b/Source/VSSpellChecker/PkgCmdID.cs
@@ -2,8 +2,8 @@
// System : Visual Studio Spell Checker Package
// File : PkgCmdID.cs
// Author : Eric Woodruff (Eric@EWoodruff.us)
-// Updated : 10/02/2019
-// Note : Copyright 2013-2019, Eric Woodruff, All rights reserved
+// Updated : 01/20/2021
+// Note : Copyright 2013-2021, Eric Woodruff, All rights reserved
// Compiler: Microsoft Visual C#
//
// This file contains various command IDs for the package
@@ -43,6 +43,10 @@ static class PkgCmdIDList
///
public const uint SpellCheckPriorIssue = 0x0016;
///
+ /// Enable or disable interactive spell checking in the current session
+ ///
+ public const uint EnableInCurrentSession = 0x0018;
+ ///
/// Add a spell checker configuration file to the solution/project based for the file item selected in
/// the Solution Explorer.
///
diff --git a/Source/VSSpellChecker/SpellingTagger.cs b/Source/VSSpellChecker/SpellingTagger.cs
index 2cb9695..82d4bfa 100644
--- a/Source/VSSpellChecker/SpellingTagger.cs
+++ b/Source/VSSpellChecker/SpellingTagger.cs
@@ -2,9 +2,9 @@
// System : Visual Studio Spell Checker Package
// File : SpellingTagger.cs
// Authors : Noah Richards, Roman Golovin, Michael Lehenbauer, Eric Woodruff
-// Updated : 02/21/2020
-// Note : Copyright 2010-2020, Microsoft Corporation, All rights reserved
-// Portions Copyright 2013-2020, Eric Woodruff, All rights reserved
+// Updated : 01/20/2021
+// Note : Copyright 2010-2021, Microsoft Corporation, All rights reserved
+// Portions Copyright 2013-2021, Eric Woodruff, All rights reserved
//
// This file contains a class that implements the spelling tagger
//
@@ -113,12 +113,30 @@ public IgnoredOnceWord(ITrackingSpan span)
private readonly bool unescapeApostrophes;
private DispatcherTimer timer;
+ private static bool disabledInSession;
#endregion
#region Properties
//=====================================================================
+ ///
+ /// This is used to get or set whether or not interactive spell checking is enabled for the session
+ ///
+ public static bool DisabledInSession
+ {
+ get => disabledInSession;
+ set
+ {
+ if(disabledInSession != value)
+ {
+ disabledInSession = value;
+
+ GlobalDictionary.NotifyChangeOfStatus();
+ }
+ }
+ }
+
///
/// This read-only property returns an enumerable list of the current misspellings
///
@@ -511,6 +529,8 @@ private void StartUpdateTask(object sender, EventArgs e)
private async void CheckSpellings(IEnumerable spansToCheck)
#pragma warning restore VSTHRD100
{
+ bool isDisabled = DisabledInSession;
+
try
{
foreach(var dirtySpan in spansToCheck)
@@ -539,7 +559,8 @@ private async void CheckSpellings(IEnumerable spansToCheck)
int removed = currentMisspellings.RemoveAll(tag => tag.ToTagSpan(snapshot).Span.OverlapsWith(dirty));
- newMisspellings.AddRange(GetMisspellingsInSpans(naturalTextSpans));
+ if(!isDisabled)
+ newMisspellings.AddRange(GetMisspellingsInSpans(naturalTextSpans));
// Also remove empties
removed += currentMisspellings.RemoveAll(tag => tag.ToTagSpan(snapshot).Span.IsEmpty);
diff --git a/Source/VSSpellChecker/ToolWindows/InteractiveSpellCheckControl.xaml b/Source/VSSpellChecker/ToolWindows/InteractiveSpellCheckControl.xaml
index 844ffea..0a68630 100644
--- a/Source/VSSpellChecker/ToolWindows/InteractiveSpellCheckControl.xaml
+++ b/Source/VSSpellChecker/ToolWindows/InteractiveSpellCheckControl.xaml
@@ -14,5 +14,5 @@
-
+
diff --git a/Source/VSSpellChecker/ToolWindows/SpellCheckControl.xaml b/Source/VSSpellChecker/ToolWindows/SpellCheckControl.xaml
index af6c0a3..21104d6 100644
--- a/Source/VSSpellChecker/ToolWindows/SpellCheckControl.xaml
+++ b/Source/VSSpellChecker/ToolWindows/SpellCheckControl.xaml
@@ -36,17 +36,22 @@
+
-
+
No text editor is selected, the spell checker is currently disabled, or the file is excluded by filename extension.
Select a text editor or edit the global configuration or the appropriate
solution, project, folder, or file-specific configuration to enable spell checking or remove the excluded
filename extension.
-
-
+
+Interactive spell checking is disabled for this session.
+Enable it again with the Tools, Spell Checker, Enable
+in Current Session menu option.
+
+
diff --git a/Source/VSSpellChecker/ToolWindows/SpellCheckControl.xaml.cs b/Source/VSSpellChecker/ToolWindows/SpellCheckControl.xaml.cs
index fb72cd4..852b35c 100644
--- a/Source/VSSpellChecker/ToolWindows/SpellCheckControl.xaml.cs
+++ b/Source/VSSpellChecker/ToolWindows/SpellCheckControl.xaml.cs
@@ -2,8 +2,8 @@
// System : Visual Studio Spell Checker Package
// File : SpellCheckControl.cs
// Authors : Eric Woodruff (Eric@EWoodruff.us)
-// Updated : 03/18/2020
-// Note : Copyright 2013-2020, Eric Woodruff, All rights reserved
+// Updated : 01/21/2021
+// Note : Copyright 2013-2021, Eric Woodruff, All rights reserved
//
// This file contains the user control that presents the spell checking options to the user
//
@@ -48,6 +48,12 @@ public partial class SpellCheckControl : UserControl
#region Properties
//=====================================================================
+ ///
+ /// This is used to get or set whether or not to check the "disabled in session" property in the tagger
+ ///
+ /// This is only relevant when used in the interactive spell checking tool window
+ public bool CheckDisabledInSession { get; set; }
+
///
/// This read-only property returns the current spelling issue
///
@@ -176,15 +182,21 @@ public void UpdateState(bool isDisabled, bool groupByWord, ISpellingIssue curren
txtMisspelledWord.Text = null;
lbSuggestions.Items.Clear();
+ lblDisabledByConfig.Visibility = lblDisabledInSession.Visibility = Visibility.Collapsed;
+
this.CurrentIssue = currentIssue;
if(isDisabled)
{
- lblDisabled.Visibility = Visibility.Visible;
+ lblDisabledByConfig.Visibility = Visibility.Visible;
return;
}
- lblDisabled.Visibility = Visibility.Collapsed;
+ if(this.CheckDisabledInSession && SpellingTagger.DisabledInSession)
+ {
+ lblDisabledInSession.Visibility = Visibility.Visible;
+ return;
+ }
if(currentIssue == null)
{
diff --git a/Source/VSSpellChecker/Utility.cs b/Source/VSSpellChecker/Utility.cs
index 6549eec..3cca75f 100644
--- a/Source/VSSpellChecker/Utility.cs
+++ b/Source/VSSpellChecker/Utility.cs
@@ -2,8 +2,8 @@
// System : Visual Studio Spell Checker Package
// File : Utility.cs
// Author : Eric Woodruff (Eric@EWoodruff.us)
-// Updated : 03/10/2020
-// Note : Copyright 2013-2020, Eric Woodruff, All rights reserved
+// Updated : 01/21/2021
+// Note : Copyright 2013-2021, Eric Woodruff, All rights reserved
//
// This file contains a utility class with extension and utility methods.
//
@@ -364,7 +364,7 @@ public static PropertyState ToPropertyState(this SpellingConfigurationFile confi
/// The appropriate property value to store
public static bool? ToPropertyValue(this PropertyState state)
{
- return (state == PropertyState.Inherited) ? (bool?)null : state == PropertyState.Yes ? true : false;
+ return (state == PropertyState.Inherited) ? (bool?)null : state == PropertyState.Yes;
}
#endregion
@@ -551,6 +551,7 @@ public static IEnumerable LoadUserDictionary(string filename, bool onlyA
{
IEnumerable words = Enumerable.Empty();
string action = onlyAddedWords ? "Add" : "Ignore";
+ char[] escapedLetters = new[] { 'a', 'b', 'f', 'n', 'r', 't', 'v', 'x', 'u', 'U' };
if(!File.Exists(filename))
return Enumerable.Empty();
@@ -599,7 +600,12 @@ public static IEnumerable LoadUserDictionary(string filename, bool onlyA
wordList.AddRange(w.Split(new[] { '\\' }, StringSplitOptions.RemoveEmptyEntries));
else
if(!onlyAddedWords)
- wordList.Add(w);
+ {
+ if(escapedLetters.Contains(w[1]))
+ wordList.Add(w);
+ else
+ wordList.Add(w.Substring(1));
+ }
}
}
@@ -648,7 +654,10 @@ public static void SaveCustomDictionary(string filename, bool replaceWords, bool
if(dictionary == null)
{
- File.WriteAllLines(filename, words);
+ // Sort and write all the words to the file. If under source control, this should minimize the
+ // number of merge conflicts that could result if multiple people added words and they were all
+ // written to the end of the file.
+ File.WriteAllLines(filename, words.OrderBy(w => w));
return;
}
diff --git a/Source/VSSpellChecker/VSSpellChecker.vsct b/Source/VSSpellChecker/VSSpellChecker.vsct
index 5b0606a..24e01ae 100644
--- a/Source/VSSpellChecker/VSSpellChecker.vsct
+++ b/Source/VSSpellChecker/VSSpellChecker.vsct
@@ -69,6 +69,17 @@
+
+