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

@@ -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: