forked from qt-creator/qt-creator
Output parsers: Generalize the search directory concept
All parsers can now have search directories, not just the GnuMakeParser. This allows us to get rid of the "task mangling", removing another instance where the order of parsers in the chain mattered. Task-number: QTCREATORBUG-22665 Change-Id: Id0d55522ae6800afd9f50ff36546224b0d8bb382 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -145,13 +145,6 @@ Core::Id CustomParser::id()
|
||||
return Core::Id("ProjectExplorer.OutputParser.Custom");
|
||||
}
|
||||
|
||||
FilePath CustomParser::absoluteFilePath(const QString &filePath) const
|
||||
{
|
||||
if (workingDirectory().isEmpty())
|
||||
return FilePath::fromUserInput(filePath);
|
||||
return workingDirectory().resolvePath(filePath);
|
||||
}
|
||||
|
||||
bool CustomParser::hasMatch(const QString &line, CustomParserExpression::CustomParserChannel channel,
|
||||
const CustomParserExpression &expression, Task::TaskType taskType)
|
||||
{
|
||||
@@ -165,7 +158,8 @@ bool CustomParser::hasMatch(const QString &line, CustomParserExpression::CustomP
|
||||
if (!match.hasMatch())
|
||||
return false;
|
||||
|
||||
const FilePath fileName = absoluteFilePath(match.captured(expression.fileNameCap()));
|
||||
const FilePath fileName = absoluteFilePath(FilePath::fromString(
|
||||
match.captured(expression.fileNameCap())));
|
||||
const int lineNumber = match.captured(expression.lineNumberCap()).toInt();
|
||||
const QString message = match.captured(expression.messageCap());
|
||||
|
||||
@@ -475,7 +469,8 @@ void ProjectExplorerPlugin::testCustomOutputParsers()
|
||||
|
||||
CustomParser *parser = new CustomParser;
|
||||
parser->setSettings(settings);
|
||||
parser->setWorkingDirectory(FilePath::fromString(workDir));
|
||||
parser->addSearchDir(FilePath::fromString(workDir));
|
||||
parser->skipFileExistsCheck();
|
||||
|
||||
OutputParserTester testbench;
|
||||
testbench.appendOutputParser(parser);
|
||||
|
||||
Reference in New Issue
Block a user