Commits

aarondandy committed 274278e

spelling fixes

Comments (0)

Files changed (25)

src/YouCantSpell.Core.Test/CachedSpellCheckerTest.cs

 
 		private static string[] SampleWords1
 		{
+			// ReSharper disable SpellingError
 			get { return new[] {"apple", "orange", "teh", "balon"}; }
+			// ReSharper restore SpellingError
 		}
 
 		private SpellChecker _primary;

src/YouCantSpell.Core/CStyle/CStyleFreeTextParser.cs

 		/// <summary>
 		/// Trims punctuation characters from the two ends of a word.
 		/// </summary>
-		/// <param name="word">The word to be trimed.</param>
-		/// <param name="frontTrimCount">Output: The number of characters trimed from the front.</param>
-		/// <returns>The trimed text.</returns>
+		/// <param name="word">The word to be trimmed.</param>
+		/// <param name="frontTrimCount">Output: The number of characters trimmed from the front.</param>
+		/// <returns>The trimmed text.</returns>
 		/// <remarks>
-		/// The length and frontTrimCount can be used to determine how many characters were trimed from the end.
+		/// The length and frontTrimCount can be used to determine how many characters were trimmed from the end.
 		/// </remarks>
 		private static string TrimWordEndCharacters(string word, out int frontTrimCount) {
 			frontTrimCount = 0;
 			foreach(Match xmlNodeMatch in XmlNodeSplitRegex.Matches(textData.SubText))
 			{
 				// The first free text part is from location 0 to the start of the first found tag.
-				// After that, except for the last part the free text part is located btween the end
+				// After that, except for the last part the free text part is located between the end
 				// of the previous tag and the start of the current tag.
 				yield return new TextSubString(
 					textData.Source,
 				if(StringUtil.IsWrappedInQuotes(word))
 					continue; // If something is wrapped in quotes we should probably leave it alone.
 
-				// Trim the special characters such as periods and parenthesis from the ends of the word as we can safely ignore them, usualy.
+				// Trim the special characters such as periods and parenthesis from the ends of the word as we can safely ignore them, usually.
 				var wordChunk = TrimWordEndCharacters(sentenceChunk);
 				if(!ReferenceEquals(wordChunk, sentenceChunk))
 					word = wordChunk.SubText; // if the word was updated we need to change the string variable to match

src/YouCantSpell.Core/CachedSpellChecker.cs

 namespace YouCantSpell
 {
 	/// <summary>
-	/// A spell checker that operates by caching results and syncronizing requests.
+	/// A spell checker that operates by caching results and synchronizing requests.
 	/// </summary>
 	public class CachedSpellChecker : ISpellChecker, IDisposable
 	{
 		private readonly int _cacheMax = 1024; // must be larger than 0
 
 		/// <summary>
-		/// Wraps another spell checker to provide caching and syncronization.
+		/// Wraps another spell checker to provide caching and synchronization.
 		/// </summary>
 		/// <param name="core">The core spell checker to be wrapped.</param>
 		/// <param name="ownsCore">If true this wrapper will be responsible for disposal of the core spell checker.</param>
 		public void Add(string word) {
 			lock(_sync) {
 				_core.Add(word);
-				_cache.Clear(); // NOTE: when a new item is added the cahces must be cleared as it will affect the suggestions
+				_cache.Clear(); // NOTE: when a new item is added the caches must be cleared as it will affect the suggestions
 			}
 		}
 
 		public void Add(IEnumerable<string> words) {
 			lock(_sync) {
 				_core.Add(words);
-				_cache.Clear();  // NOTE: when a new item is added the cahces must be cleared as it will affect the suggestions
+				_cache.Clear();  // NOTE: when a new item is added the caches must be cleared as it will affect the suggestions
 			}
 		}
 

src/YouCantSpell.Core/ISpellChecker.cs

 		bool Check(string word);
 
 		/// <summary>
-		/// Gets a list of recomended alternative spellings based on the given word.
+		/// Gets a list of recommended alternative spellings based on the given word.
 		/// </summary>
 		/// <param name="word">The word to get suggestions for.</param>
 		/// <returns>Word suggestions.</returns>

src/YouCantSpell.Core/TextSubString.cs

 namespace YouCantSpell
 {
 	/// <summary>
-	/// A sub-string of text derrived from a larger string of text.
+	/// A sub-string of text derived from a larger string of text.
 	/// </summary>
 	public class TextSubString : ITextSubString
 	{
 		}
 
 		/// <summary>
-		/// The sub-text derrived from the source text.
+		/// The sub-text derived from the source text.
 		/// </summary>
 		public string SubText {
 			get { return _subStringCache ?? (_subStringCache = Source.Substring(Offset, Length)); }

src/YouCantSpell.Core/Utility/StringUtil.cs

 		}
 
 		/// <summary>
-		/// Classiffies the casing of a string.
+		/// Classifies the casing of a string.
 		/// </summary>
 		/// <param name="letters">The text to classify.</param>
 		/// <returns>The letter casing of the entire string.</returns>
 		}
 
 		/// <summary>
-		/// Classiffies the casing of a string.
+		/// Classifies the casing of a string.
 		/// </summary>
 		/// <param name="letters">The text to classify.</param>
 		/// <returns>The letter casing of the entire string.</returns>

src/YouCantSpell.ReSharper.Core/YouCantSpell.ReSharper.Core.csproj

   <ItemGroup>
     <EmbeddedResource Include="StringListBox.resx">
       <DependentUpon>StringListBox.cs</DependentUpon>
+      <SubType>Designer</SubType>
     </EmbeddedResource>
     <EmbeddedResource Include="Text.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Text.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
     </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>

src/YouCantSpell.ReSharper.Shared/CSharp/CSharpSpellCheckDaemonStageProcess.cs

 		{
 
 			var fullText = comment.CommentText;
-			if (String.IsNullOrEmpty(fullText) || ReSharperUtil.ResharperLineRegex.IsMatch(fullText))
+			if (String.IsNullOrEmpty(fullText) || ReSharperUtil.ReSharperLineRegex.IsMatch(fullText))
 				return Enumerable.Empty<HighlightingInfo>(); // ignore resharper disable/restore lines
 
 			var validRange = FindTrueDocumentRange(comment.GetCommentRange());
 			return validPartRanges[0];
 		}
 
-		public override void Execute(Action<DaemonStageResult> commiter) {
+		public override void Execute(Action<DaemonStageResult> committer) {
 			var localIdentifierNames = new HashSet<string>(StringComparer.CurrentCultureIgnoreCase);
 			var highlightings = new List<HighlightingInfo>();
 
 				}
 			);
 
-			commiter(new DaemonStageResult(highlightings));
+			committer(new DaemonStageResult(highlightings));
 		}
 
 	}

src/YouCantSpell.ReSharper.Shared/CSharp/CSharpSpellingQuikFix.cs

 	/// A C# implementation of the spelling quick fix.
 	/// </summary>
 	[QuickFix]
-	public class CSharpSpellingQuikFix : SpellingQuickFixBase<CSharpSpellingErrorHighlighting, CSharpSpellingFixBulbItem>
+	public class CSharpSpellingQuickFix : SpellingQuickFixBase<CSharpSpellingErrorHighlighting, CSharpSpellingFixBulbItem>
 	{
 
-		public CSharpSpellingQuikFix([NotNull] CSharpSpellingErrorHighlighting highlighting)
+		public CSharpSpellingQuickFix([NotNull] CSharpSpellingErrorHighlighting highlighting)
 			: base(highlighting) { }
 
 		protected override CSharpSpellingFixBulbItem CreateSpellingFix(string suggestion) {

src/YouCantSpell.ReSharper.Shared/CSharp/CSharpSpellingSuggestionFormatter.cs

 			// just in case anything funny like a prefix or @ was added we need to get rid of that (unless @ is OK)
 			var reparsedNamed = _namingManager.Parsing.Parse(newSuggestion, NamingRule.Default, _namingPolicyProvider);
 			if(reparsedNamed.NamePrefix.Text.Length > 0 && (!literalIsOk || reparsedNamed.NamePrefix.Text != "@")) {
-				// we need to pull the prefix off except for one special situaton, with literals, if that is a prefix
+				// we need to pull the prefix off except for one special situation, with literals, if that is a prefix
 				newSuggestion = newSuggestion.Substring(reparsedNamed.NamePrefix.Text.Length);
 			}
 			if(!literalIsOk && newSuggestion.Length > 1 && newSuggestion.StartsWith("@"))
 			if(0 != position) {
 				// Here we may need to correct the first letter if this is not the first word as the naming provider assumes the first word.
 				// The R# methods assume the words I am giving it are the entire identifier name so the first letter may not be correct for
-				// a suggestion derrived from the 2nd word part within an identifier, we will need to adjust that.
+				// a suggestion derived from the 2nd word part within an identifier, we will need to adjust that.
 				newSuggestion = ForceFirstCharCase(
 					newSuggestion,
 					SecondWordFirstLetterClassification(_namingPolicy.NamingRule.NamingStyleKind)

src/YouCantSpell.ReSharper.Shared/Html/HtmlSpellCheckDaemonStageProcess.cs

 			return results;
 		}
 
-		public void Execute(Action<DaemonStageResult> commiter) {
+		public void Execute(Action<DaemonStageResult> committer) {
 			var textNodeTypes = _htmlFile.TokenTypes.TEXT;
 			var highlightings = new List<HighlightingInfo>(0);
 
 					highlightings.AddRange(FindWordHighlightings(node));
 			});
 
-			commiter(new DaemonStageResult(highlightings));
+			committer(new DaemonStageResult(highlightings));
 		}
 
 		

src/YouCantSpell.ReSharper.Shared/JavaScript/JavaScriptFreeTextSpellingHighlightFinder.cs

 					continue;
 
 				// If we got this far we need to offer spelling suggestions.
-				var wordPartocumentOffset = textRange.TextRange.StartOffset + wordPart.Offset;
+				var wordPartDocumentOffset = textRange.TextRange.StartOffset + wordPart.Offset;
 				var wordRange = new DocumentRange(
 					_document,
-					new TextRange(wordPartocumentOffset, wordPartocumentOffset + word.Length)
+					new TextRange(wordPartDocumentOffset, wordPartDocumentOffset + word.Length)
 				);
 				var highlight = new JavaScriptSpellingErrorHighlighting(
 					node,

src/YouCantSpell.ReSharper.Shared/JavaScript/JavaScriptSpellCheckDaemonStageProcess.cs

 		/// <summary>
 		/// Locates resharper in-code configuration comments.
 		/// </summary>
-		private static readonly Regex ResharperLineRegex = new Regex(@"ReSharper\s+(disable|restore)\s+(.*)", RegexOptions.Compiled);
+		private static readonly Regex ReSharperLineRegex = new Regex(@"ReSharper\s+(disable|restore)\s+(.*)", RegexOptions.Compiled);
 
 		private static readonly Regex StringLiteralContentParser = new Regex(@"^""(.+)""$", RegexOptions.Compiled | RegexOptions.Singleline);
 
 #endif
  {
 			if(null == JavaScriptLanguage.Instance)
-				throw new InvalidOperationException("JavaScript languange instance not supported.");
+				throw new InvalidOperationException("JavaScript language instance not supported.");
 			if (null == javaScriptFile)
 				throw new ArgumentNullException("javaScriptFile");
 
 		private IEnumerable<HighlightingInfo> FindHighlightings(IComment comment, HashSet<string> ignoredIdentifiers, IDeclarationsCache declarationsCache) {
 
 			var fullText = comment.CommentText;
-			if(ResharperLineRegex.IsMatch(fullText))
+			if(ReSharperLineRegex.IsMatch(fullText))
 				return Enumerable.Empty<HighlightingInfo>(); // ignore resharper disable/restore lines
 
 			var validRange = FindTrueDocumentRange(comment.GetCommentRange());
 			return validPartRanges[0];
 		}
 
-		public override void Execute(Action<DaemonStageResult> commiter) {
+		public override void Execute(Action<DaemonStageResult> committer) {
 			var localIdentifierNames = new HashSet<string>(StringComparer.CurrentCultureIgnoreCase);
 			var highlightings = new List<HighlightingInfo>();
 
 				}
 			);
 
-			commiter(new DaemonStageResult(highlightings));
+			committer(new DaemonStageResult(highlightings));
 		}
 	}
 }

src/YouCantSpell.ReSharper.Shared/JavaScript/JavaScriptSpellingSuggestionFormatter.cs

 			// just in case anything funny like a prefix or @ was added we need to get rid of that (unless @ is OK)
 			var reparsedNamed = _namingManager.Parsing.Parse(newSuggestion, NamingRule.Default, _namingPolicyProvider);
 			if(reparsedNamed.NamePrefix.Text.Length > 0 && (!literalIsOk || reparsedNamed.NamePrefix.Text != "@")) {
-				// we need to pull the prefix off except for one special situaton, with literals, if that is a prefix
+				// we need to pull the prefix off except for one special situation, with literals, if that is a prefix
 				newSuggestion = newSuggestion.Substring(reparsedNamed.NamePrefix.Text.Length);
 			}
 			if(!literalIsOk && newSuggestion.Length > 1 && newSuggestion.StartsWith("@"))
 			if(!firstWord) {
 				// Here we may need to correct the first letter if this is not the first word as the naming provider assumes the first word.
 				// The R# methods assume the words I am giving it are the entire identifier name so the first letter may not be correct for
-				// a suggestion derrived from the 2nd word part within an identifier, we will need to adjust that.
+				// a suggestion derived from the 2nd word part within an identifier, we will need to adjust that.
 				newSuggestion = ForceFirstCharCase(
 					newSuggestion,
 					SecondWordFirstLetterClassification(_namingPolicy.NamingRule.NamingStyleKind)

src/YouCantSpell.ReSharper.Shared/PrimaryOptionsControl.cs

 			groupBoxIgnoredWords.Text = ResourceAccessor.GetString("UI_IgnoredWordListTitle")
 				?? "Ignored Words";
 
-			// Extact the string keys from the settings and apply them to the UI list boxes.
+			// Extract the string keys from the settings and apply them to the UI list boxes.
 			UserWords.Initialize(
 				settings.EnumEntryIndices<SpellCheckSettings, string, byte>(x => x.UserEntries)
 				.ToArray()
 		/// </summary>
 		/// <param name="settings">This is the settings context that we use to apply pending changes.</param>
 		/// <param name="listBox">This is the list box that has all the words we added or removed.</param>
-		/// <param name="property">This is the property on the settings colleection that needs to be updated.</param>
+		/// <param name="property">This is the property on the settings collection that needs to be updated.</param>
 		private void ApplyChanges(OptionsSettingsSmartContext settings, StringListBox listBox, Expression<Func<SpellCheckSettings, IIndexedEntry<string, byte>>> property) {
 			foreach(var word in listBox.ItemsToRemove)
 				settings.RemoveIndexedValue(property, word);

src/YouCantSpell.ReSharper.Shared/ReSharperUtil.cs

 		/// <summary>
 		/// Locates resharper in-code configuration comments.
 		/// </summary>
-		public static readonly Regex ResharperLineRegex = new Regex(@"ReSharper\s+(disable|restore)\s+(.*)", RegexOptions.Compiled);
+		public static readonly Regex ReSharperLineRegex = new Regex(@"ReSharper\s+(disable|restore)\s+(.*)", RegexOptions.Compiled);
 
 		/// <summary>
 		/// Extracts a declared element from an node or its parent.

src/YouCantSpell.ReSharper.Shared/SpellCheckDaemonStage.cs

 				get { return _process; }
 			}
 
-			public void Execute(System.Action<DaemonStageResult> commiter) {
+			public void Execute(System.Action<DaemonStageResult> committer) {
 				foreach(var stage in this) {
-					stage.Execute(commiter);
+					stage.Execute(committer);
 				}
 			}
 		}

src/YouCantSpell.ReSharper.Shared/SpellCheckSettings.cs

 	{
 
 		// you need to use collections to store any kind of list in R#
-		// so here I have a lookup keyed on the thing I care about and with a value that is complete and total garbage, so it is a byte
-		// Is it a 1? Is it a 0? It is certainly less than 9000. Who cares, dont use it!
+		// so here I have a look-up keyed on the thing I care about and with a value that is complete and total garbage, so it is a byte
+		// Is it a 1? Is it a 0? It is certainly less than 9000. Who cares, don’t use it!
 
 		[SettingsIndexedEntryAttribute("Ignore Words")]
 		public IIndexedEntry<string, byte> IgnoreEntries { get; set; }

src/YouCantSpell.ReSharper.Shared/SpellingAddToDictionaryBulbItem.cs

 namespace YouCantSpell.ReSharper
 {
 	/// <summary>
-	/// A bulb item that allos adding the word to the dictionary.
+	/// A bulb item that allows adding the word to the dictionary.
 	/// </summary>
 	public class SpellingAddToDictionaryBulbItem :
 #if RSHARP6

src/YouCantSpell.ReSharper.Shared/SpellingErrorHighlightingBase.cs

 using JetBrains.ReSharper.Psi.Tree;
 using YouCantSpell.ReSharper;
 
-// this defines the common category inforamtion for the spelling highlighting, for example when finding problems with the solution
+// this defines the common category information for the spelling highlighting, for example when finding problems with the solution
 [assembly: RegisterConfigurableSeverity(SpellingErrorHighlightingBase.SeverityId,
 	null,
 	"Spelling",
 		/// Creates a spelling highlighting for the given node and locations with the word in error as well as fix suggestions.
 		/// </summary>
 		/// <param name="node">The element that the highlight is bound to.</param>
-		/// <param name="range">The specific document range that the highligght is bound to.</param>
+		/// <param name="range">The specific document range that the highlight is bound to.</param>
 		/// <param name="wordInError">The word that is in error.</param>
 		/// <param name="getSuggestions">The suggestion generator that can be used to generate suggestions.</param>
 		protected SpellingErrorHighlightingBase(ITreeNode node, DocumentRange range, string wordInError, Func<string, string[]> getSuggestions) {

src/YouCantSpell.ReSharper.Shared/SpellingFixBulbItemBase.cs

 		/// Creates a new spelling fix bulb item.
 		/// </summary>
 		/// <param name="highlighting">The highlighting the quick fix is bound to.</param>
-		/// <param name="suggestion">The sugggested spelling of the bulb item.</param>
+		/// <param name="suggestion">The suggested spelling of the bulb item.</param>
 		protected SpellingFixBulbItemBase(THighlighting highlighting, string suggestion) {
 			_highlighting = highlighting;
 			_suggestion = suggestion;

src/YouCantSpell.ReSharper.Shared/SpellingIgnoreWordBulbItem.cs

 		private readonly string _word;
 
 		/// <summary>
-		/// Creats a new ignore bulb item that adds the word to the ignore list when executed.
+		/// Creates a new ignore bulb item that adds the word to the ignore list when executed.
 		/// </summary>
 		/// <param name="highlight">The highlight that the bulb item is bound to.</param>
 		public SpellingIgnoreWordBulbItem(SpellingErrorHighlightingBase highlight)

src/YouCantSpell.ReSharper.Shared/SpellingQuickFixBase.cs

 	/// The base spelling quick fix class.
 	/// </summary>
 	/// <typeparam name="THighlighting">The highlighting type that the quick fix will attach to.</typeparam>
-	/// <typeparam name="TSpellingFixBulbItem">The spelling builb item type that is generated by the highlighting.</typeparam>
+	/// <typeparam name="TSpellingFixBulbItem">The spelling bulb item type that is generated by the highlighting.</typeparam>
 	public abstract class SpellingQuickFixBase<THighlighting,TSpellingFixBulbItem> : IQuickFix
 		where THighlighting : SpellingErrorHighlightingBase
 		where TSpellingFixBulbItem : SpellingFixBulbItemBase<THighlighting>
 		/// </summary>
 		/// <param name="highlighting">The highlighting to be bound to.</param>
 		/// <remarks>
-		/// The derrived constructors should be called by ReSharper and the highlighting should be injected into it.
+		/// The derived constructors should be called by ReSharper and the highlighting should be injected into it.
 		/// </remarks>
 		protected SpellingQuickFixBase([NotNull] THighlighting highlighting) {
 			_highlighting = highlighting;
 		/// Generates a single spelling fix bulb item from the given suggestion.
 		/// </summary>
 		/// <param name="suggestion">The suggestion text.</param>
-		/// <returns>A new builb item that can correct the highlighted spelling mistake with one suggestion.</returns>
+		/// <returns>A new bulb item that can correct the highlighted spelling mistake with one suggestion.</returns>
 		protected abstract TSpellingFixBulbItem CreateSpellingFix(string suggestion);
 
 
 #endif
 		Items {
 			get {
-				// add all of the spelling sugggestions
+				// add all of the spelling suggestions
 				var items = _highlighting
 					.Suggestions
 					.Select<string,

src/YouCantSpell.ReSharper.Shared/Xml/XmlSpellCheckDaemonStageProcess.cs

 			);
 		}
 
-		public void Execute(Action<DaemonStageResult> commiter) {
+		public void Execute(Action<DaemonStageResult> committer) {
 			var highlightings = new List<HighlightingInfo>(0);
 
 			_xmlFile.ProcessChildren<XmlFloatingTextToken>(node => {
 					highlightings.AddRange(FindWordHighlightings(node));
 			});
 
-			commiter(new DaemonStageResult(highlightings));
+			committer(new DaemonStageResult(highlightings));
 		}
 
 		

src/YouCantSpell.ReSharper.v61/YouCantSpell.ReSharper.v61.csproj

     <EmbeddedResource Include="..\YouCantSpell.ReSharper.Shared\PrimaryOptionsControl.resx">
       <Link>PrimaryOptionsControl.resx</Link>
       <DependentUpon>PrimaryOptionsControl.cs</DependentUpon>
+      <SubType>Designer</SubType>
     </EmbeddedResource>
     <EmbeddedResource Include="..\YouCantSpell.ReSharper.Shared\resources\SpellCheckOptionsIcon.png">
       <Link>resources\SpellCheckOptionsIcon.png</Link>