示例#1
0
        private void CheckMember(
            IClassMemberDeclaration declaration,
            IHighlightingConsumer highlightingConsumer,
            CommentAnalyzer commentAnalyzer,
            IdentifierSpellCheckAnalyzer identifierAnalyzer)
        {
            if (declaration is IConstructorDeclaration && declaration.IsStatic)
            {
                // TODO: probably need to put this somewhere in settings.
                //Static constructors have no visibility so not clear how to check them.
                return;
            }


            // Documentation doesn't work properly on multiple declarations (as of R# 6.1) so see if we can get it from the parent
            XmlNode docNode = null;
            IDocCommentBlockNode commentBlock;
            var multipleDeclarationMember = declaration as IMultipleDeclarationMember;

            if (multipleDeclarationMember != null)
            {
                // get the parent
                IMultipleDeclaration multipleDeclaration = multipleDeclarationMember.MultipleDeclaration;

                // Now ask for the actual comment block
                commentBlock = SharedImplUtil.GetDocCommentBlockNode(multipleDeclaration);

                if (commentBlock != null)
                {
                    docNode = commentBlock.GetXML(null);
                }
            }
            else
            {
                commentBlock = SharedImplUtil.GetDocCommentBlockNode(declaration);

                docNode = declaration.GetXMLDoc(false);
            }

            commentAnalyzer.CheckMemberHasComment(declaration, docNode, highlightingConsumer);
            commentAnalyzer.CheckCommentSpelling(declaration, commentBlock, highlightingConsumer, true);
            identifierAnalyzer.CheckMemberSpelling(declaration, highlightingConsumer, true);
        }
示例#2
0
 public IList <IDeclaration> GetDeclarationsIn(IPsiSourceFile sourceFile) =>
 SharedImplUtil.GetDeclarationsIn(this, sourceFile);