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