ProjectExplorer: Support column numbers in file path linkification

... for task details.
As a result, clicking on a linkified file path inside a task in the issues
pane will now open the editor at the column specified in the compiler
output, if there is one. We used to consider only the line.

Change-Id: Idccba33b5b33029abfa8f29c7888af6c7f2e1622
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2024-05-31 12:32:33 +02:00
parent 45702941f8
commit 36f2a21f2d
22 changed files with 115 additions and 89 deletions

View File

@@ -58,7 +58,7 @@ Link OutputLineParser::parseLinkTarget(const QString &target)
return {};
return Link(FilePath::fromString(parts.first()),
parts.length() > 1 ? parts.at(1).toInt() : 0,
parts.length() > 2 ? parts.at(2).toInt() : 0);
parts.length() > 2 ? parts.at(2).toInt() - 1 : 0);
}
// The redirection mechanism is needed for broken build tools (e.g. xcodebuild) that get invoked
@@ -141,26 +141,39 @@ FilePath OutputLineParser::absoluteFilePath(const FilePath &filePath) const
return filePath;
}
void OutputLineParser::addLinkSpecForAbsoluteFilePath(OutputLineParser::LinkSpecs &linkSpecs,
const FilePath &filePath, int lineNo, int pos, int len)
void OutputLineParser::addLinkSpecForAbsoluteFilePath(
OutputLineParser::LinkSpecs &linkSpecs,
const FilePath &filePath,
int lineNo,
int column,
int pos,
int len)
{
if (filePath.toFileInfo().isAbsolute())
linkSpecs.append({pos, len, createLinkTarget(filePath, lineNo)});
linkSpecs.append({pos, len, createLinkTarget(filePath, lineNo, column)});
}
void OutputLineParser::addLinkSpecForAbsoluteFilePath(OutputLineParser::LinkSpecs &linkSpecs,
const FilePath &filePath, int lineNo, const QRegularExpressionMatch &match,
void OutputLineParser::addLinkSpecForAbsoluteFilePath(
OutputLineParser::LinkSpecs &linkSpecs,
const FilePath &filePath,
int lineNo,
int column,
const QRegularExpressionMatch &match,
int capIndex)
{
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, match.capturedStart(capIndex),
match.capturedLength(capIndex));
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, column,
match.capturedStart(capIndex), match.capturedLength(capIndex));
}
void OutputLineParser::addLinkSpecForAbsoluteFilePath(OutputLineParser::LinkSpecs &linkSpecs,
const FilePath &filePath, int lineNo, const QRegularExpressionMatch &match,
void OutputLineParser::addLinkSpecForAbsoluteFilePath(
OutputLineParser::LinkSpecs &linkSpecs,
const FilePath &filePath,
int lineNo,
int column,
const QRegularExpressionMatch &match,
const QString &capName)
{
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, match.capturedStart(capName),
match.capturedLength(capName));
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, column,
match.capturedStart(capName), match.capturedLength(capName));
}
bool Utils::OutputLineParser::fileExists(const FilePath &fp) const

View File

@@ -93,12 +93,13 @@ protected:
Utils::FilePath absoluteFilePath(const Utils::FilePath &filePath) const;
static QString createLinkTarget(const FilePath &filePath, int line, int column);
static void addLinkSpecForAbsoluteFilePath(LinkSpecs &linkSpecs, const FilePath &filePath,
int lineNo, int pos, int len);
int lineNo, int column, int pos, int len);
static void addLinkSpecForAbsoluteFilePath(LinkSpecs &linkSpecs, const FilePath &filePath,
int lineNo, const QRegularExpressionMatch &match,
int capIndex);
int lineNo, int column,
const QRegularExpressionMatch &match, int capIndex);
static void addLinkSpecForAbsoluteFilePath(LinkSpecs &linkSpecs, const FilePath &filePath,
int lineNo, const QRegularExpressionMatch &match,
int lineNo, int column,
const QRegularExpressionMatch &match,
const QString &capName);
bool fileExists(const Utils::FilePath &fp) const;

View File

@@ -62,7 +62,7 @@ OutputLineParser::Result JavaParser::handleLine(const QString &line, OutputForma
absoluteFilePath(file),
lineno);
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, task.file, task.line, match, 2);
addLinkSpecForAbsoluteFilePath(linkSpecs, task.file, task.line, task.column, match, 2);
scheduleTask(task, 1);
return {Status::Done, linkSpecs};
}

View File

@@ -117,8 +117,8 @@ OutputLineParser::Result IarParser::parseWarningOrErrorOrFatalErrorDetailsMessag
m_expectSnippet = false;
m_expectFilePath = false;
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, match,
FilePathIndex);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, FilePathIndex);
return {Status::InProgress, linkSpecs};
}

View File

@@ -62,8 +62,8 @@ OutputLineParser::Result KeilParser::parseArmWarningOrErrorDetailsMessage(const
const QString descr = match.captured(DescriptionIndex);
newTask(CompileTask(type, descr, absoluteFilePath(fileName), lineno));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, match,
FilePathIndex);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, FilePathIndex);
return {Status::InProgress, linkSpecs};
}
@@ -98,8 +98,8 @@ OutputLineParser::Result KeilParser::parseMcs51WarningOrErrorDetailsMessage1(con
match.captured(MessageTextIndex));
newTask(CompileTask(type, descr, absoluteFilePath(fileName), lineno));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, match,
FilePathIndex);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, FilePathIndex);
return {Status::InProgress, linkSpecs};
}
@@ -119,8 +119,8 @@ OutputLineParser::Result KeilParser::parseMcs51WarningOrErrorDetailsMessage2(con
match.captured(MessageTextIndex));
newTask(CompileTask(type, descr, absoluteFilePath(fileName), lineno));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, match,
FilePathIndex);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, FilePathIndex);
return {Status::InProgress, linkSpecs};
}

View File

@@ -73,8 +73,8 @@ OutputLineParser::Result SdccParser::handleLine(const QString &line, OutputForma
const QString descr = match.captured(MessageTextIndex);
newTask(CompileTask(type, descr, absoluteFilePath(fileName), lineno));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, match,
FilePathIndex);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, FilePathIndex);
return {Status::InProgress, linkSpecs};
}
@@ -90,8 +90,8 @@ OutputLineParser::Result SdccParser::handleLine(const QString &line, OutputForma
const QString descr = match.captured(MessageTextIndex);
newTask(CompileTask(type, descr, absoluteFilePath(fileName), lineno));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, match,
FilePathIndex);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, FilePathIndex);
return {Status::InProgress, linkSpecs};
}

View File

@@ -93,8 +93,8 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
match.captured(2).toInt());
m_lines = 1;
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line,
match, 1);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, 1);
m_errorOrWarningLine.file = m_lastTask.file;
m_errorOrWarningLine.line = m_lastTask.line;
@@ -107,8 +107,8 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
m_lastTask = BuildSystemTask(Task::Error, QString(),
absoluteFilePath(FilePath::fromUserInput(match.captured(1))));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line,
match, 1);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, 1);
m_lines = 1;
return {Status::InProgress, linkSpecs};
}
@@ -121,8 +121,8 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
match.captured(3).toInt());
m_lines = 1;
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line,
match, 1);
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_lastTask.file, m_lastTask.line, m_lastTask.column, match, 1);
m_errorOrWarningLine.file = m_lastTask.file;
m_errorOrWarningLine.line = m_lastTask.line;
@@ -174,7 +174,12 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
m_lastTask.line = match.captured(1).toInt();
m_expectTripleLineErrorData = LINE_DESCRIPTION;
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, 0,
addLinkSpecForAbsoluteFilePath(
linkSpecs,
m_lastTask.file,
m_lastTask.line,
m_lastTask.column,
0,
match.capturedStart());
return {Status::InProgress, linkSpecs};
}

View File

@@ -56,7 +56,7 @@ inline Utils::OutputLineParser::LinkSpecs MesonOutputParser::addTask(
fileName,
match.captured(lineNumberCapIndex).toInt());
addTask(task);
addLinkSpecForAbsoluteFilePath(linkSpecs, task.file, task.line, match, 1);
addLinkSpecForAbsoluteFilePath(linkSpecs, task.file, task.line, task.column, match, 1);
#else
Q_UNUSED(type);
Q_UNUSED(line);

View File

@@ -39,7 +39,7 @@ NimParser::Result NimParser::handleLine(const QString &lne, OutputFormat)
const CompileTask t(type, message, absoluteFilePath(FilePath::fromUserInput(filename)),
lineNumber);
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, t.file, t.line, match, 1);
addLinkSpecForAbsoluteFilePath(linkSpecs, t.file, t.line, t.column, match, 1);
scheduleTask(t, 1);
return {Status::Done, linkSpecs};
}

View File

@@ -65,7 +65,7 @@ OutputLineParser::Result ClangParser::handleLine(const QString &line, OutputForm
const int lineNo = match.captured(3).toInt();
const int column = 0;
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, match, 2);
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, column, match, 2);
createOrAmendTask(Task::Unknown, lne.trimmed(), lne, false,
filePath, lineNo, column, linkSpecs);
return {Status::InProgress, linkSpecs};
@@ -84,7 +84,7 @@ OutputLineParser::Result ClangParser::handleLine(const QString &line, OutputForm
const FilePath filePath = absoluteFilePath(FilePath::fromUserInput(match.captured(1)));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, match, 1);
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, column, match, 1);
createOrAmendTask(taskType(match.captured(8)), match.captured(9), lne, false,
filePath, lineNo, column, linkSpecs);
return {Status::InProgress, linkSpecs};
@@ -235,7 +235,7 @@ void ProjectExplorerTest::testClangOutputParser_data()
68, 10,
QVector<QTextLayout::FormatRange>()
<< formatRange(34, 0)
<< formatRange(34, 28, "olpfile:///usr/include/c++/4.6/utility::68::-1")
<< formatRange(34, 28, "olpfile:///usr/include/c++/4.6/utility::68::10")
<< formatRange(62, 93)))
<< QString();
@@ -255,7 +255,7 @@ void ProjectExplorerTest::testClangOutputParser_data()
567, 51,
QVector<QTextLayout::FormatRange>()
<< formatRange(74, 0)
<< formatRange(74, 64, "olpfile:///home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp::567::-1")
<< formatRange(74, 64, "olpfile:///home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp::567::51")
<< formatRange(138, 202)))
<< QString();

View File

@@ -237,7 +237,7 @@ OutputLineParser::Result CustomParser::hasMatch(
const int lineNumber = match.captured(expression.lineNumberCap()).toInt();
const QString message = match.captured(expression.messageCap());
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, fileName, lineNumber, match,
addLinkSpecForAbsoluteFilePath(linkSpecs, fileName, lineNumber, -1, match,
expression.fileNameCap());
scheduleTask(CompileTask(taskType, message, fileName, lineNumber), 1);
return {Status::Done, linkSpecs};

View File

@@ -221,7 +221,7 @@ OutputLineParser::Result GccParser::handleLine(const QString &line, OutputFormat
const int lineNo = match.captured(2).toInt();
const int column = match.captured(3).toInt();
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, match, "file");
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, column, match, "file");
gccCreateOrAmendTask(
Task::Unknown, lne.trimmed(), lne, false, filePath, lineNo, column, linkSpecs);
return {Status::InProgress, linkSpecs};
@@ -234,7 +234,7 @@ OutputLineParser::Result GccParser::handleLine(const QString &line, OutputFormat
const FilePath filePath = absoluteFilePath(FilePath::fromUserInput(match.captured(3)));
LinkSpecs linkSpecs;
if (!filePath.isEmpty())
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, -1, match, 3);
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, -1, -1, match, 3);
gccCreateOrAmendTask(type, match.captured(2), lne, false, filePath, -1, 0, linkSpecs);
return {Status::Done, linkSpecs};
}
@@ -243,7 +243,12 @@ OutputLineParser::Result GccParser::handleLine(const QString &line, OutputFormat
const FilePath filePath = absoluteFilePath(FilePath::fromUserInput(data->rawFilePath));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(
linkSpecs, filePath, data->line, data->fileOffset, data->rawFilePath.size());
linkSpecs,
filePath,
data->line,
data->column,
data->fileOffset,
data->rawFilePath.size());
gccCreateOrAmendTask(
data->type, data->description, lne, false, filePath, data->line, data->column, linkSpecs);
return {Status::InProgress, linkSpecs};
@@ -343,9 +348,9 @@ void ProjectExplorerTest::testGccOutputParsers_data()
9, 0,
QVector<QTextLayout::FormatRange>()
<< formatRange(46, 0)
<< formatRange(46, 29, "olpfile:///temp/test/untitled8/main.cpp::0::-1")
<< formatRange(46, 29, "olpfile:///temp/test/untitled8/main.cpp::0::0")
<< formatRange(75, 39)
<< formatRange(114, 29, "olpfile:///temp/test/untitled8/main.cpp::9::-1")
<< formatRange(114, 29, "olpfile:///temp/test/untitled8/main.cpp::9::0")
<< formatRange(143, 56))
<< CompileTask(Task::Error,
"(Each undeclared identifier is reported only once for each function it appears in.)",
@@ -514,9 +519,9 @@ void ProjectExplorerTest::testGccOutputParsers_data()
264, 0,
QVector<QTextLayout::FormatRange>()
<< formatRange(45, 0)
<< formatRange(45, 68, "olpfile:///home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp::0::-1")
<< formatRange(45, 68, "olpfile:///home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp::0::0")
<< formatRange(113, 106)
<< formatRange(219, 68, "olpfile:///home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp::264::-1")
<< formatRange(219, 68, "olpfile:///home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp::264::0")
<< formatRange(287, 57))
<< CompileTask(Task::Error,
"expected ';' before ':' token",
@@ -583,9 +588,9 @@ void ProjectExplorerTest::testGccOutputParsers_data()
194, 0,
QVector<QTextLayout::FormatRange>()
<< formatRange(50, 0)
<< formatRange(50, 67, "olpfile:///Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c::0::-1")
<< formatRange(50, 67, "olpfile:///Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c::0::0")
<< formatRange(117, 216)
<< formatRange(333, 67, "olpfile:///Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c::194::-1")
<< formatRange(333, 67, "olpfile:///Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c::194::0")
<< formatRange(400, 64)))
<< QString();
@@ -822,9 +827,9 @@ void ProjectExplorerTest::testGccOutputParsers_data()
1134, 26,
QVector<QTextLayout::FormatRange>()
<< formatRange(26, 22)
<< formatRange(48, 39, "olpfile:///Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h::15::-1")
<< formatRange(48, 39, "olpfile:///Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h::15::0")
<< formatRange(87, 46)
<< formatRange(133, 50, "olpfile:///Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh::1134::-1")
<< formatRange(133, 50, "olpfile:///Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh::1134::26")
<< formatRange(183, 44))}
<< QString();
@@ -929,7 +934,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
14, 25,
QVector<QTextLayout::FormatRange>()
<< formatRange(41, 22)
<< formatRange(63, 67, "olpfile:///home/code/src/creator/src/libs/extensionsystem/pluginerrorview.cpp::31::-1")
<< formatRange(63, 67, "olpfile:///home/code/src/creator/src/libs/extensionsystem/pluginerrorview.cpp::31::0")
<< formatRange(130, 146))}
<< QString();
@@ -953,11 +958,11 @@ void ProjectExplorerTest::testGccOutputParsers_data()
597, 5,
QVector<QTextLayout::FormatRange>()
<< formatRange(43, 22)
<< formatRange(65, 31, "olpfile:///usr/include/qt4/QtCore/QString::1::-1")
<< formatRange(65, 31, "olpfile:///usr/include/qt4/QtCore/QString::1::0")
<< formatRange(96, 40)
<< formatRange(136, 33, "olpfile:///usr/include/qt4/QtCore/qstring.h::0::-1")
<< formatRange(136, 33, "olpfile:///usr/include/qt4/QtCore/qstring.h::0::0")
<< formatRange(169, 28)
<< formatRange(197, 33, "olpfile:///usr/include/qt4/QtCore/qstring.h::597::-1")
<< formatRange(197, 33, "olpfile:///usr/include/qt4/QtCore/qstring.h::597::5")
<< formatRange(230, 99))}
<< QString();
@@ -1233,17 +1238,17 @@ void ProjectExplorerTest::testGccOutputParsers_data()
273, 25,
QVector<QTextLayout::FormatRange>()
<< formatRange(140, 22)
<< formatRange(162, 32, "olpfile:///usr/include/qt/QtCore/qlocale.h::43::-1")
<< formatRange(162, 32, "olpfile:///usr/include/qt/QtCore/qlocale.h::43::0")
<< formatRange(194, 27)
<< formatRange(221, 36, "olpfile:///usr/include/qt/QtCore/qtextstream.h::46::-1")
<< formatRange(221, 36, "olpfile:///usr/include/qt/QtCore/qtextstream.h::46::0")
<< formatRange(257, 27)
<< formatRange(284, 38, "olpfile:///qtc/src/shared/proparser/proitems.cpp::31::-1")
<< formatRange(284, 38, "olpfile:///qtc/src/shared/proparser/proitems.cpp::31::0")
<< formatRange(322, 5)
<< formatRange(327, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::0::-1")
<< formatRange(327, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::0::0")
<< formatRange(360, 51)
<< formatRange(411, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::273::-1")
<< formatRange(411, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::273::25")
<< formatRange(444, 229)
<< formatRange(673, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::399::-1")
<< formatRange(673, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::399::16")
<< formatRange(706, 221)),
compileTask(Task::Error,
"no match for operator+ (operand types are boxed_value<double> and boxed_value<double>)\n"
@@ -1477,13 +1482,13 @@ void ProjectExplorerTest::testGccOutputParsers_data()
FilePath::fromUserInput("/data/dev/creator/src/libs/utils/aspects.cpp"), 3454, 13,
QVector<QTextLayout::FormatRange>{
formatRange(82, 22),
formatRange(104, 44, "olpfile:///data/dev/creator/src/libs/utils/aspects.cpp::12::-1"),
formatRange(104, 44, "olpfile:///data/dev/creator/src/libs/utils/aspects.cpp::12::0"),
formatRange(148, 5),
formatRange(153, 48, "olpfile:///data/dev/creator/src/libs/utils/layoutbuilder.h::0::-1"),
formatRange(153, 48, "olpfile:///data/dev/creator/src/libs/utils/layoutbuilder.h::0::0"),
formatRange(201, 177),
formatRange(378, 44, "olpfile:///data/dev/creator/src/libs/utils/aspects.cpp::3454::-1"),
formatRange(378, 44, "olpfile:///data/dev/creator/src/libs/utils/aspects.cpp::3454::13"),
formatRange(422, 31),
formatRange(453, 48, "olpfile:///data/dev/creator/src/libs/utils/layoutbuilder.h::79::-1"),
formatRange(453, 48, "olpfile:///data/dev/creator/src/libs/utils/layoutbuilder.h::79::51"),
formatRange(501, 228)})})
<< QString();
}

View File

@@ -103,7 +103,7 @@ OutputLineParser::Result GnuMakeParser::handleLine(const QString &line, OutputFo
if (!m_suppressIssues) {
const FilePath file = absoluteFilePath(FilePath::fromUserInput(match.captured(1)));
const int lineNo = match.captured(4).toInt();
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineNo, match, 1);
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineNo, -1, match, 1);
emitTask(BuildSystemTask(res.type, res.description, file, lineNo));
}
return {Status::Done, linkSpecs};

View File

@@ -62,7 +62,7 @@ Utils::OutputLineParser::Result LdParser::handleLine(const QString &line, Utils:
if (match.hasMatch()) {
handle = true;
filePath = absoluteFilePath(Utils::FilePath::fromString(match.captured("file")));
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, 0, match, "file");
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, -1, -1, match, "file");
currentTask().setFile(filePath);
} else {
handle = !lne.isEmpty() && lne.at(0).isSpace();
@@ -135,7 +135,7 @@ Utils::OutputLineParser::Result LdParser::handleLine(const QString &line, Utils:
}
if (hasKeyword || filePath.fileName().endsWith(".o")) {
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineno, match, capIndex);
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineno, -1, match, capIndex);
createOrAmendTask(type, description, line, false, filePath, lineno, 0, linkSpecs);
return {getStatus(), linkSpecs};
}

View File

@@ -59,7 +59,7 @@ OutputLineParser::Result LinuxIccParser::handleLine(const QString &line, OutputF
const FilePath filePath = absoluteFilePath(FilePath::fromUserInput(match.captured(1)));
const int lineNo = match.captured(2).toInt();
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, match, 1);
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, -1, match, 1);
createOrAmendTask(type, match.captured(6).trimmed(), line, false, filePath, lineNo);
m_expectFirstLine = false;
return Status::InProgress;

View File

@@ -46,7 +46,7 @@ Utils::OutputLineParser::Result LldParser::handleLine(const QString &line, Utils
const auto file = absoluteFilePath(Utils::FilePath::fromUserInput(
trimmedLine.mid(filePathOffset, filePathLen).trimmed()));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineNo, filePathOffset, filePathLen);
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineNo, -1, filePathOffset, filePathLen);
scheduleTask(CompileTask(Task::Unknown, trimmedLine.mid(4).trimmed(),
file, lineNo), 1);
return {Status::Done, linkSpecs};

View File

@@ -114,7 +114,7 @@ OutputLineParser::Result MsvcParser::handleLine(const QString &line, OutputForma
const FilePath filePath = absoluteFilePath(FilePath::fromUserInput(match.captured(2)));
const int lineNo = match.captured(3).toInt();
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, match, 2);
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, lineNo, -1, match, 2);
createOrAmendTask(Task::Unknown, description, line, false, filePath, lineNo, 0, linkSpecs);
return {Status::InProgress, linkSpecs};
}
@@ -146,7 +146,7 @@ MsvcParser::Result MsvcParser::processCompileLine(const QString &line)
QPair<FilePath, int> position = parseFileName(match.captured(1));
const FilePath filePath = absoluteFilePath(position.first);
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, position.second, match, 1);
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, position.second, -1, match, 1);
const QString &description = match.captured(3) + match.captured(4).trimmed();
createOrAmendTask(
taskType(match.captured(2)),
@@ -228,7 +228,7 @@ OutputLineParser::Result ClangClParser::handleLine(const QString &line, OutputFo
const FilePath file = absoluteFilePath(position.first);
const int lineNo = position.second;
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineNo, match, 1);
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineNo, -1, match, 1);
createOrAmendTask(
taskType(match.captured(2)), match.captured(3).trimmed(), line, false, file, lineNo);
return {Status::InProgress, linkSpecs};

View File

@@ -93,7 +93,8 @@ OutputLineParser::Result SanitizerParser::handleContinuation(const QString &line
m_task.file = file;
m_task.line = summaryMatch.captured("line").toInt();
m_task.column = summaryMatch.captured("column").toInt();
addLinkSpecForAbsoluteFilePath(linkSpecs, file, m_task.line, summaryMatch, "file");
addLinkSpecForAbsoluteFilePath(
linkSpecs, file, m_task.line, m_task.column, summaryMatch, "file");
addLinkSpecs(linkSpecs);
}
} else {
@@ -107,7 +108,7 @@ OutputLineParser::Result SanitizerParser::handleContinuation(const QString &line
const FilePath file = absoluteFilePath(FilePath::fromUserInput(fileMatch.captured("file")));
if (fileExists(file)) {
addLinkSpecForAbsoluteFilePath(linkSpecs, file, fileMatch.captured("line").toInt(),
fileMatch, "file");
fileMatch.captured("column").toInt(), fileMatch, "file");
addLinkSpecs(linkSpecs);
}
}

View File

@@ -57,7 +57,8 @@ OutputLineParser::Result XcodebuildParser::handleLine(const QString &line, Outpu
absoluteFilePath(FilePath::fromString(
lne.left(filePathEndPos))));
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, task.file, task.line, 0, filePathEndPos);
addLinkSpecForAbsoluteFilePath(linkSpecs, task.file, task.line, task.column, 0,
filePathEndPos);
scheduleTask(task, 1);
return {Status::Done, linkSpecs};
}

View File

@@ -46,7 +46,7 @@ OutputLineParser::Result QMakeParser::handleLine(const QString &line, OutputForm
BuildSystemTask t(type, description, absoluteFilePath(FilePath::fromUserInput(fileName)),
match.captured(2).toInt() /* line */);
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, t.file, t.line, fileNameOffset,
addLinkSpecForAbsoluteFilePath(linkSpecs, t.file, t.line, t.column, fileNameOffset,
fileName.length());
scheduleTask(t, 1);
return {Status::Done, linkSpecs};

View File

@@ -45,7 +45,7 @@ Utils::OutputLineParser::Result QtParser::handleLine(const QString &line, Utils:
LinkSpecs linkSpecs;
const Utils::FilePath file
= absoluteFilePath(Utils::FilePath::fromUserInput(match.captured("file")));
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineno, match, "file");
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineno, -1, match, "file");
CompileTask task(type, match.captured("description").trimmed(), file, lineno);
task.column = match.captured("column").toInt();
scheduleTask(task, 1);
@@ -62,7 +62,7 @@ Utils::OutputLineParser::Result QtParser::handleLine(const QString &line, Utils:
message.prepend(": ").prepend(fileName);
} else if (fileName.endsWith(".ui")) {
filePath = absoluteFilePath(Utils::FilePath::fromUserInput(fileName));
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, -1, match, "file");
addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, -1, -1, match, "file");
} else {
isUicMessage = false;
}
@@ -79,7 +79,7 @@ Utils::OutputLineParser::Result QtParser::handleLine(const QString &line, Utils:
LinkSpecs linkSpecs;
const Utils::FilePath file
= absoluteFilePath(Utils::FilePath::fromUserInput(match.captured("file")));
addLinkSpecForAbsoluteFilePath(linkSpecs, file, 0, match, "file");
addLinkSpecForAbsoluteFilePath(linkSpecs, file, -1, -1, match, "file");
CompileTask task(type, match.captured("description"), file);
scheduleTask(task, 1);
return {Status::Done, linkSpecs};
@@ -95,7 +95,7 @@ Utils::OutputLineParser::Result QtParser::handleLine(const QString &line, Utils:
if (!ok)
lineno = -1;
LinkSpecs linkSpecs;
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineno, match, "file");
addLinkSpecForAbsoluteFilePath(linkSpecs, file, lineno, -1, match, "file");
CompileTask task(type, match.captured("description"), file, lineno,
match.captured("column").toInt());
scheduleTask(task, 1);

View File

@@ -44,8 +44,8 @@ OutputLineParser::Result QtTestParser::handleLine(const QString &line, OutputFor
m_currentTask.file = absoluteFilePath(FilePath::fromString(
QDir::fromNativeSeparators(match.captured("file"))));
m_currentTask.line = match.captured("line").toInt();
addLinkSpecForAbsoluteFilePath(linkSpecs, m_currentTask.file, m_currentTask.line, match,
"file");
addLinkSpecForAbsoluteFilePath(
linkSpecs, m_currentTask.file, m_currentTask.line, m_currentTask.column, match, "file");
emitCurrentTask();
return {Status::Done, linkSpecs};
}