forked from qt-creator/qt-creator
Fix parsing line and column information from file paths
Amends 84ea908b2d
Change-Id: I9f203d4d4903549e220caa8e3c4b9887da68d049
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -57,7 +57,7 @@ LineColumn LineColumn::extractFromFileName(const QString &fileName, int &postfix
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const QRegularExpressionMatch vsMatch = vsRegexp.match(fileName);
|
const QRegularExpressionMatch vsMatch = vsRegexp.match(fileName);
|
||||||
postfixPos = match.capturedStart(0);
|
postfixPos = vsMatch.capturedStart(0);
|
||||||
filePath = fileName.left(vsMatch.capturedStart(0));
|
filePath = fileName.left(vsMatch.capturedStart(0));
|
||||||
if (vsMatch.lastCapturedIndex() > 1) // index 1 includes closing )
|
if (vsMatch.lastCapturedIndex() > 1) // index 1 includes closing )
|
||||||
lineColumn.line = vsMatch.captured(2).toInt();
|
lineColumn.line = vsMatch.captured(2).toInt();
|
||||||
|
@@ -46,7 +46,7 @@ Link Link::fromString(const QString &fileName, bool canContainLineNumber, QStrin
|
|||||||
const LineColumn lineColumn = LineColumn::extractFromFileName(fileName, postfixPos);
|
const LineColumn lineColumn = LineColumn::extractFromFileName(fileName, postfixPos);
|
||||||
if (postfix && postfixPos >= 0)
|
if (postfix && postfixPos >= 0)
|
||||||
*postfix = fileName.mid(postfixPos);
|
*postfix = fileName.mid(postfixPos);
|
||||||
return {Utils::FilePath::fromString(fileName.left(postfixPos - 1)),
|
return {Utils::FilePath::fromString(fileName.left(postfixPos)),
|
||||||
lineColumn.line,
|
lineColumn.line,
|
||||||
lineColumn.column};
|
lineColumn.column};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user