Commits

Anonymous committed f7fd52e

bunch of bug fixes

Comments (0)

Files changed (5)

 
 Compatibility
 --------
-============== ============ ============ ===========
-VS Verstion:   VS 2012 (11) VS 2010 (10) VS 2008 (9)
-ReSharper v6.1 Maybe        Yep          Yep
-ReSharper v7.0 Maybe        Yep          Yep
-============== ============ ============ ===========
+================ ============ ============ ===========
+VS Verstion:     VS 2012 (11) VS 2010 (10) VS 2008 (9)
+ReSharper v6.1.1 Yep          Yep          Yep
+ReSharper v7.0.1 Yep          Yep          Yep
+================ ============ ============ ===========
 
 Download
 --------
 
 Features
 --------
+
+Languages/file types supported:
+- C#
 - JavaScript
-- C#
--  Uses inheritance information.
--  Misspellings are suggested at the root of the problem (parent).
--  C# in Razor and ASP
-- HTML
--  CSHTML
--  ASPX
-- XML (AppConfig)
+- HTML: including cshtml and aspx
+- XML: including app.config
+
+Reduce false positives:
+- Ignores known or related types and identifiers.
+- Ignores inherited words from base classes, members, and interfaces.
 
 Problems
 --------

src/YouCantSpell.Core/CStyle/CStyleFreeTextParser.cs

 		/// <summary>
 		/// Identifies words that appear to be like C styled identifiers.
 		/// </summary>
-        public static readonly Regex CodeWordDetectionRegex = new Regex(@"^\p{Lu}+$|^\p{Ll}+\p{Lu}|^\p{Lu}\p{Ll}+\p{Lu}", RegexOptions.Compiled | RegexOptions.Singleline);
+        public static readonly Regex CodeWordDetectionRegex = new Regex(@"^\p{Lu}+$|^\p{Ll}+\p{Lu}|^(\p{Lu}\p{Ll}*){2,}", RegexOptions.Compiled | RegexOptions.Singleline);
 		/// <summary>
 		/// Determines if a word is composed only of valid characters.
 		/// </summary>

src/YouCantSpell.ReSharper.Shared/CStyleSpellCheckDaemonStageProcessBase.cs

 		}
 
 		protected DocumentRange? FindTrueDocumentRange(TreeTextRange range) {
-			return CodeFile.GetIntersectingRanges(range)
-				.SingleOrDefault(x => x.Document == PsiSourceFile.Document);
+			var ranges = CodeFile.GetIntersectingRanges(range)
+				.Where(x => x.Document == PsiSourceFile.Document)
+				.ToList();
+			return ranges.Count == 0 ? (DocumentRange?)null : ranges[0];
 		}
 
 		protected IEnumerable<TextSubString> ParseNameParts(string nameText) {

src/YouCantSpell.ReSharper.Shared/SpellingErrorHighlightingBase.cs

 using System;
 using System.Collections.ObjectModel;
+using System.Linq;
 using JetBrains.DocumentModel;
 using JetBrains.ReSharper.Daemon;
 using JetBrains.ReSharper.Psi.Tree;
 	/// </summary>
 	public abstract class SpellingErrorHighlightingBase : IHighlighting
 	{
+
 		/// <summary>
 		/// The core severity ID which identifies the fix highlight type. Subclasses must be attributed with this ID.
 		/// </summary>
 		/// The suggestions for the word.
 		/// </summary>
 		public ReadOnlyCollection<string> Suggestions {
-			get { return Array.AsReadOnly((_getSuggestions ?? ShellSpellCheckResources.GetSpellingSuggestions)(WordInError)); }
+			get
+			{
+				var suggestions = (_getSuggestions ?? ShellSpellCheckResources.GetSpellingSuggestions)(WordInError)
+					?? new string[0];
+				// use the LINQ OrderBy as it is a stable sort.
+				suggestions = suggestions
+					.OrderByDescending(x => StringComparer.InvariantCultureIgnoreCase.Equals(WordInError, x))
+					.ToArray();
+				return Array.AsReadOnly(suggestions);
+			}
 		}
 
 		/// <summary>

src/YouCantSpell.ReSharper.Shared/TagMarkupSpellCheckDaemonStageProcessBase.cs

 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using JetBrains.Application;
 using JetBrains.DocumentModel;
 using JetBrains.ReSharper.Daemon;
 		public IDocument Document { get; private set; }
 
 		protected DocumentRange? FindTrueDocumentRange(TreeTextRange range) {
-			return CodeFile.GetIntersectingRanges(range)
-				.SingleOrDefault(x => x.Document == PsiSourceFile.Document);
+			var ranges = CodeFile.GetIntersectingRanges(range)
+				.Where(x => x.Document == PsiSourceFile.Document)
+				.ToList();
+			return ranges.Count == 0 ? (DocumentRange?)null : ranges[0];
 		}
 
 		protected bool WordIsIgnored(string word) {