From 36f2a21f2d5260766e90e5e56f711a8a2d0db284 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 31 May 2024 12:32:33 +0200 Subject: [PATCH] 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 --- src/libs/utils/outputformatter.cpp | 41 +++++++++----- src/libs/utils/outputformatter.h | 9 +-- src/plugins/android/javaparser.cpp | 2 +- src/plugins/baremetal/iarewparser.cpp | 4 +- src/plugins/baremetal/keilparser.cpp | 12 ++-- src/plugins/baremetal/sdccparser.cpp | 8 +-- .../cmakeprojectmanager/cmakeparser.cpp | 21 ++++--- .../mesonprojectmanager/mesonoutputparser.cpp | 2 +- .../nim/project/nimoutputtaskparser.cpp | 2 +- src/plugins/projectexplorer/clangparser.cpp | 8 +-- src/plugins/projectexplorer/customparser.cpp | 2 +- src/plugins/projectexplorer/gccparser.cpp | 55 ++++++++++--------- src/plugins/projectexplorer/gnumakeparser.cpp | 2 +- src/plugins/projectexplorer/ldparser.cpp | 4 +- .../projectexplorer/linuxiccparser.cpp | 2 +- src/plugins/projectexplorer/lldparser.cpp | 2 +- src/plugins/projectexplorer/msvcparser.cpp | 6 +- .../projectexplorer/sanitizerparser.cpp | 5 +- .../projectexplorer/xcodebuildparser.cpp | 3 +- .../qmakeprojectmanager/qmakeparser.cpp | 2 +- src/plugins/qtsupport/qtparser.cpp | 8 +-- src/plugins/qtsupport/qttestparser.cpp | 4 +- 22 files changed, 115 insertions(+), 89 deletions(-) diff --git a/src/libs/utils/outputformatter.cpp b/src/libs/utils/outputformatter.cpp index cf00b5ee3fa..d36662f4d34 100644 --- a/src/libs/utils/outputformatter.cpp +++ b/src/libs/utils/outputformatter.cpp @@ -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, - int capIndex) +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, - const QString &capName) +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 diff --git a/src/libs/utils/outputformatter.h b/src/libs/utils/outputformatter.h index d26dc643271..da4dfe8a3a1 100644 --- a/src/libs/utils/outputformatter.h +++ b/src/libs/utils/outputformatter.h @@ -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; diff --git a/src/plugins/android/javaparser.cpp b/src/plugins/android/javaparser.cpp index 72859bfdab3..65ddfba9ad6 100644 --- a/src/plugins/android/javaparser.cpp +++ b/src/plugins/android/javaparser.cpp @@ -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}; } diff --git a/src/plugins/baremetal/iarewparser.cpp b/src/plugins/baremetal/iarewparser.cpp index 23a1d10a1db..286cb0e1686 100644 --- a/src/plugins/baremetal/iarewparser.cpp +++ b/src/plugins/baremetal/iarewparser.cpp @@ -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}; } diff --git a/src/plugins/baremetal/keilparser.cpp b/src/plugins/baremetal/keilparser.cpp index 4ae0c6aa648..64bf64e46fd 100644 --- a/src/plugins/baremetal/keilparser.cpp +++ b/src/plugins/baremetal/keilparser.cpp @@ -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}; } diff --git a/src/plugins/baremetal/sdccparser.cpp b/src/plugins/baremetal/sdccparser.cpp index aa97173f85c..517f051390b 100644 --- a/src/plugins/baremetal/sdccparser.cpp +++ b/src/plugins/baremetal/sdccparser.cpp @@ -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}; } diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index 7da4e383911..c5c8c30d253 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -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,8 +174,13 @@ 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, - match.capturedStart()); + addLinkSpecForAbsoluteFilePath( + linkSpecs, + m_lastTask.file, + m_lastTask.line, + m_lastTask.column, + 0, + match.capturedStart()); return {Status::InProgress, linkSpecs}; } case LINE_DESCRIPTION: diff --git a/src/plugins/mesonprojectmanager/mesonoutputparser.cpp b/src/plugins/mesonprojectmanager/mesonoutputparser.cpp index 9ba777f0753..241f05a9160 100644 --- a/src/plugins/mesonprojectmanager/mesonoutputparser.cpp +++ b/src/plugins/mesonprojectmanager/mesonoutputparser.cpp @@ -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); diff --git a/src/plugins/nim/project/nimoutputtaskparser.cpp b/src/plugins/nim/project/nimoutputtaskparser.cpp index 31fc1e8e77a..1fde71d3c21 100644 --- a/src/plugins/nim/project/nimoutputtaskparser.cpp +++ b/src/plugins/nim/project/nimoutputtaskparser.cpp @@ -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}; } diff --git a/src/plugins/projectexplorer/clangparser.cpp b/src/plugins/projectexplorer/clangparser.cpp index 28679f0ed58..05bcc3e0aa2 100644 --- a/src/plugins/projectexplorer/clangparser.cpp +++ b/src/plugins/projectexplorer/clangparser.cpp @@ -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() << 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() << 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(); diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index e10595af78a..0e2a360af11 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -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}; diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index 3e61df45dee..3a43e8ebe99 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -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() << 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() << 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() << 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() << 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() << 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() << 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() << 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’ and ‘boxed_value’)\n" @@ -1477,13 +1482,13 @@ void ProjectExplorerTest::testGccOutputParsers_data() FilePath::fromUserInput("/data/dev/creator/src/libs/utils/aspects.cpp"), 3454, 13, QVector{ 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(); } diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp index d31ce499700..015d030d180 100644 --- a/src/plugins/projectexplorer/gnumakeparser.cpp +++ b/src/plugins/projectexplorer/gnumakeparser.cpp @@ -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}; diff --git a/src/plugins/projectexplorer/ldparser.cpp b/src/plugins/projectexplorer/ldparser.cpp index ea7521bd0e2..95bb4e84959 100644 --- a/src/plugins/projectexplorer/ldparser.cpp +++ b/src/plugins/projectexplorer/ldparser.cpp @@ -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}; } diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index 734f8148658..6e625b240a5 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -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; diff --git a/src/plugins/projectexplorer/lldparser.cpp b/src/plugins/projectexplorer/lldparser.cpp index 3bb4079b766..0bc36ff845e 100644 --- a/src/plugins/projectexplorer/lldparser.cpp +++ b/src/plugins/projectexplorer/lldparser.cpp @@ -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}; diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index 0613a0b74e8..17710cb13c3 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -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 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}; diff --git a/src/plugins/projectexplorer/sanitizerparser.cpp b/src/plugins/projectexplorer/sanitizerparser.cpp index 8da13d5d37b..546de844485 100644 --- a/src/plugins/projectexplorer/sanitizerparser.cpp +++ b/src/plugins/projectexplorer/sanitizerparser.cpp @@ -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); } } diff --git a/src/plugins/projectexplorer/xcodebuildparser.cpp b/src/plugins/projectexplorer/xcodebuildparser.cpp index 8a2d3e2962a..2037614e043 100644 --- a/src/plugins/projectexplorer/xcodebuildparser.cpp +++ b/src/plugins/projectexplorer/xcodebuildparser.cpp @@ -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}; } diff --git a/src/plugins/qmakeprojectmanager/qmakeparser.cpp b/src/plugins/qmakeprojectmanager/qmakeparser.cpp index 57051ba5a20..0b0bdc5af08 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparser.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparser.cpp @@ -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}; diff --git a/src/plugins/qtsupport/qtparser.cpp b/src/plugins/qtsupport/qtparser.cpp index 387af762a3b..93fd16d90a5 100644 --- a/src/plugins/qtsupport/qtparser.cpp +++ b/src/plugins/qtsupport/qtparser.cpp @@ -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); diff --git a/src/plugins/qtsupport/qttestparser.cpp b/src/plugins/qtsupport/qttestparser.cpp index 93030f20e68..a19929b7544 100644 --- a/src/plugins/qtsupport/qttestparser.cpp +++ b/src/plugins/qtsupport/qttestparser.cpp @@ -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}; }