public void CheckCommentSpelling(
            IClassMemberDeclaration decl,
            IDocCommentBlockNode docNode,
            IHighlightingConsumer highlightingConsumer,
            bool spellCheck)
        {
            if (docNode == null)
            {
                return;
            }

            IFile file = decl.GetContainingFile();

            if (file == null)
            {
                return;
            }

            foreach (Range wordRange in this.GetWordsFromXmlComment(docNode))
            {
                DocumentRange range = file.GetDocumentRange(wordRange.TreeTextRange);
                string        word  = wordRange.Word;

                if (decl.DeclaredName != word)
                {
                    if ((IdentifierResolver.IsIdentifier(decl, _solution, word, _identifierSettings.IdentifierLookupScope) ||
                         IdentifierResolver.IsKeyword(decl, _solution, word)) &&
                        IdentifierResolver.AnalyzeForMetaTagging(word, _xmlDocumentationSettings.CompiledWordsToIgnoreForMetatagging))
                    {
                        var highlighting = new CanBeSurroundedWithMetatagsHighlight(word,
                                                                                    range, decl, _solution);

                        highlightingConsumer.AddHighlighting(highlighting, range, file);
                    }
                    else if (spellCheck)
                    {
                        this.CheckWordSpelling(decl, wordRange, highlightingConsumer, range, file);
                    }
                }
            }
        }
Exemple #2
0
 public SurroundWithMetatagsQuickFix(CanBeSurroundedWithMetatagsHighlight suggestion)
 {
     _suggestion = suggestion;
 }