Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git languages/cpp/parser/commentformatter.cpp languages/cpp/parser/commentformatter.cpp
- index 59edf44..1ba7b5a 100644
- --- languages/cpp/parser/commentformatter.cpp
- +++ languages/cpp/parser/commentformatter.cpp
- @@ -49,6 +49,25 @@ QList<KDevelop::ProblemPointer> CommentFormatter::extractToDos( uint token, cons
- stripped_left += KDevelop::strip( "**", *it );
- stripped_right += KDevelop::rStrip( "/**", *it );
- + int left_spaces;
- + for (left_spaces = 0; left_spaces < it->size(); ++left_spaces) {
- + if (!isSpace((*it)[left_spaces])) {
- + break;
- + }
- + }
- +
- + int right_spaces;
- + for (right_spaces = it->size() - 1; right_spaces >= 0; --right_spaces) {
- + if (!isSpace((*it)[right_spaces])) {
- + break;
- + }
- + }
- + right_spaces = it->size() - 1 - right_spaces;
- +
- + stripped_left += left_spaces;
- + stripped_right += right_spaces;
- + *it = it->mid(left_spaces, it->size() - left_spaces - right_spaces);
- +
- if( KDevelop::containsToDos(*it) ) {
- KDevelop::ProblemPointer p(new KDevelop::Problem());
- p->setSource(KDevelop::ProblemData::ToDo);
- diff --git languages/cpp/parser/tests/test_parser.cpp languages/cpp/parser/tests/test_parser.cpp
- index 94748e6..5356dc4 100644
- --- languages/cpp/parser/tests/test_parser.cpp
- +++ languages/cpp/parser/tests/test_parser.cpp
- @@ -377,7 +377,7 @@ private slots:
- QVERIFY(it);
- it = it->next;
- QVERIFY(it);
- - QCOMPARE(CommentFormatter::formatComment(it->element->comments, lastSession), QByteArray("FIXME comment\nthis is TODO\nTODO: comment\n(another TODO)"));
- + QCOMPARE(CommentFormatter::formatComment(it->element->comments, lastSession), QByteArray("FIXME comment\nthis is TODO\n TODO: comment\n(another TODO)"));
- it = it->next;
- QVERIFY(it);
- QCOMPARE(CommentFormatter::formatComment(it->element->comments, lastSession), QByteArray("Just a simple comment"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement