예제 #1
0
        public static bool IsToDo(SyntaxNode codeSnippet)
        {
            if (codeSnippet is CatchClauseSyntax)
            {
                codeSnippet = (codeSnippet as CatchClauseSyntax).Block;
            }
            bool bIsToDo = false;

            var commentList = codeSnippet.DescendantTrivia()
                              .Where(childNode => childNode.IsKind(SyntaxKind.SingleLineCommentTrivia) ||
                                     childNode.IsKind(SyntaxKind.MultiLineCommentTrivia));

            foreach (var comment in commentList)
            {
                string updatedComment = IOFile.DeleteSpace(comment.ToString());
                updatedComment = Regex.Replace(updatedComment, "<.*>", "");
                updatedComment = Regex.Replace(updatedComment, "{.*}", "");
                updatedComment = Regex.Replace(updatedComment, "\\(.*\\)", "");
                updatedComment = updatedComment.ToUpper();

                bIsToDo = updatedComment.Contains("TODO") || updatedComment.Contains("FIXME");
            }

            return(bIsToDo);
        }
예제 #2
0
        public string PrintMetaInfo()
        {
            string metaInfo = null;

            foreach (var key in MetaInfo.Keys)
            {
                metaInfo += (IOFile.DeleteSpace(MetaInfo[key]) + Splitter);
            }
            return(metaInfo);
        }