60 const StringRef Text =
61 Lexer::getSourceText(CharSourceRange::getCharRange(Range),
62 PP.getSourceManager(), PP.getLangOpts());
65 if (!TodoMatch.match(Text, &Matches))
68 const StyleKind ParsedStyle =
69 !Matches[3].empty() ? StyleKind::Parentheses : StyleKind::Hyphen;
70 const StringRef Username =
71 ParsedStyle == StyleKind::Parentheses ? Matches[3] : Matches[5];
72 const StringRef Comment = Matches[6];
74 if (!Username.empty() &&
75 (ParsedStyle == StyleKind::Parentheses || !Comment.empty())) {
79 if (Username.empty()) {
80 Check.diag(Range.getBegin(),
"missing username/bug in TODO")
81 << FixItHint::CreateReplacement(
82 CharSourceRange::getCharRange(Range),
87 Check.diag(Range.getBegin(),
"missing details in TODO");