Commits

Nerzhul500 committed bd064bf

Markup highlightings is different for text and attr value

Comments (0)

Files changed (6)

ReSpeller/Analyzers/XmlTypoAnalysis.cs

         var xmlValueToken = element as IXmlValueToken;
         DocumentRange xmlValueTokenRange = xmlValueToken.GetDocumentRange();
         AnalyzerHelper.GenerateRangeBasedHighlightings(myChecker, highlightings, element.GetContainingFile(), xmlValueTokenRange, 
-          (range, list) => new XmlTextTypoHighlighting(range, list));
+          (range, list) => new MarkupAttributeTypoHighlighting(range, list));
       }
       else if (element is XmlFloatingTextToken)
       {
           return;
         DocumentRange xmlFloatingTokenRange = tokenNode.GetDocumentRange();
         AnalyzerHelper.GenerateRangeBasedHighlightings(myChecker, highlightings, element.GetContainingFile(), xmlFloatingTokenRange, 
-          (range, list) => new XmlTextTypoHighlighting(range, list));
+          (range, list) => new MarkupTextTypoHighlighting(range, list));
       }
     }
   }

ReSpeller/Highlightings/MarkupAttributeTypoHighlighting.cs

+using System.Collections.Generic;
+using JetBrains.DocumentModel;
+using JetBrains.ReSharper.Daemon;
+
+namespace ReSpeller.Highlightings
+{
+  [ConfigurableSeverityHighlighting(SeverityId,
+    "XML,RESX,XAML,HTML", OverlapResolve = OverlapResolveKind.WARNING,
+    ToolTipFormatString = ToolTipFormatString)]
+  public class MarkupAttributeTypoHighlighting : TextRangeTypoHighlighting
+  {
+    private const string ToolTipFormatString = "Typo in markup attribute value: \"{0}\"";
+    internal const string SeverityId = "MarkupAttributeTypo";
+
+    public MarkupAttributeTypoHighlighting(DocumentRange range, List<string> suggestions) : base(range, suggestions)
+    {
+    }
+
+    public override string ToolTip { get { return string.Format(ToolTipFormatString, myRange.GetText()); }}
+    public override string ErrorStripeToolTip { get { return string.Format(ToolTipFormatString, myRange.GetText()); } }
+  }
+}

ReSpeller/Highlightings/MarkupTextTypoHighlighting.cs

+using System.Collections.Generic;
+using JetBrains.DocumentModel;
+using JetBrains.ReSharper.Daemon;
+
+namespace ReSpeller.Highlightings
+{
+  [ConfigurableSeverityHighlighting(SeverityId,
+    "XML,RESX,XAML,HTML", OverlapResolve = OverlapResolveKind.WARNING,
+    ToolTipFormatString = ToolTipFormatString)]
+  public class MarkupTextTypoHighlighting : TextRangeTypoHighlighting
+  {
+    private const string ToolTipFormatString = "Typo in markup text: \"{0}\"";
+    internal const string SeverityId = "MarkupTextTypo";
+
+    public MarkupTextTypoHighlighting(DocumentRange range, List<string> suggestions) : base(range, suggestions)
+    {
+    }
+
+    public override string ToolTip { get { return string.Format(ToolTipFormatString, myRange.GetText()); }}
+    public override string ErrorStripeToolTip { get { return string.Format(ToolTipFormatString, myRange.GetText()); } }
+  }
+}

ReSpeller/Highlightings/XmlTextTypoHighlighting.cs

-using System.Collections.Generic;
-using JetBrains.DocumentModel;
-using JetBrains.ReSharper.Daemon;
-
-namespace ReSpeller.Highlightings
-{
-  [ConfigurableSeverityHighlighting(SeverityId,
-    "XML,RESX,XAML", OverlapResolve = OverlapResolveKind.WARNING,
-    ToolTipFormatString = ToolTipFormatString)]
-  public class XmlTextTypoHighlighting : TextRangeTypoHighlighting
-  {
-    private const string ToolTipFormatString = "Typo in markup text: \"{0}\"";
-    internal const string SeverityId = "XmlTextTypo";
-
-    public XmlTextTypoHighlighting(DocumentRange range, List<string> suggestions) : base(range, suggestions)
-    {
-    }
-
-    public override string ToolTip { get { return string.Format(ToolTipFormatString, myRange.GetText()); }}
-    public override string ErrorStripeToolTip { get { return string.Format(ToolTipFormatString, myRange.GetText()); } }
-  }
-}

ReSpeller/Properties/AssemblyInfo.cs

          false)]
 [assembly:
    RegisterConfigurableSeverity(
-         XmlTextTypoHighlighting.SeverityId,
+         MarkupTextTypoHighlighting.SeverityId,
          null,
          HighlightingGroupIds.CodeSmell,
          "Typo in markup text",
          "Typo in markup text",
          Severity.SUGGESTION,
+         false)]
+[assembly:
+   RegisterConfigurableSeverity(
+         MarkupAttributeTypoHighlighting.SeverityId,
+         null,
+         HighlightingGroupIds.CodeSmell,
+         "Typo in markup attribute value",
+         "Typo in markup attribute value",
+         Severity.SUGGESTION,
          false)]

ReSpeller/ReSpeller.csproj

     <Compile Include="Bulbs\EditAddToDictionaryBulb.cs" />
     <Compile Include="Bulbs\TextRangeTypoReplaceBulbItem.cs" />
     <Compile Include="Highlightings\CommentTypoHighlighting.cs" />
+    <Compile Include="Highlightings\MarkupAttributeTypoHighlighting.cs" />
     <Compile Include="Highlightings\IdentifierTypoHighlighting.cs" />
     <Compile Include="Highlightings\StringLiteralTypoHighlighting.cs" />
     <Compile Include="Highlightings\TextRangeTypoHighlighting.cs" />
-    <Compile Include="Highlightings\XmlTextTypoHighlighting.cs" />
+    <Compile Include="Highlightings\MarkupTextTypoHighlighting.cs" />
     <Compile Include="QuickFixes\TypoQuickFix.cs" />
     <Compile Include="Settings\ReSpellerSettings.cs" />
     <Compile Include="Settings\ReSpellerSettingsControl.xaml.cs">
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.