Skip to content

Commit

Permalink
Working on duplicate detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoussin committed Dec 9, 2015
1 parent dc02a12 commit 3139ffd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions doxygen.cpp
Expand Up @@ -155,6 +155,27 @@ void Doxygen::createDocumentation(const DoxygenSettingsStruct &DoxySettings, Cor
return;
}

// We don't want to document multiple times.
//QRegExp duplicate("\\brief\s*([^\n\r])+");
// Todo: fix when doc is not saved
QRegExp duplicate("^(\\s|\t)?\\*/");
QString text(editorWidget->document()->toPlainText());
QStringList lines(text.split(QRegExp("\n|\r\n|\r")));

for (int i= 1; i <= 10; i++)
{
int prevLine = lastLine - i;
if (prevLine < 0) break;
QString checkText(lines.at(prevLine));
if (checkText.contains(duplicate))
{
qDebug() << "Duplicate found in" << editor->document()->filePath().toString() << prevLine;
qDebug() << checkText;
return;
}
}


QStringList scopes = scopesForSymbol(lastSymbol);
Overview overview;
overview.showArgumentNames = true;
Expand Down

0 comments on commit 3139ffd

Please sign in to comment.