diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2019-02-03 21:00:11 +0100 |
---|---|---|
committer | André Hartmann <aha_1980@gmx.de> | 2019-02-08 08:02:36 +0000 |
commit | 49afb01e0a657a42221723ac29a69c1cfa9edc54 (patch) | |
tree | 7d45e4ec4e04780c9f20670cc94f2558d3da43b5 /src/plugins/qtsupport/qtoutputformatter.cpp | |
parent | 05bb8e9e30169f160bc9159ed9d0945f78298e4d (diff) |
QtOutputFormatter: Allow standalone file:// links
Either alone on a line, or with text before, or with
text afterwards, separated by colon, space, tab, or
brace as before.
Especially thought to capture cases like
file:///home/user/main.cpp:157
on a single line, but accept that also as long as
the file link is separated by a word separator from
the sourrounding text.
Fixes: QTCREATORBUG-20406
Change-Id: I25bceb186818c9ea680741573a806f66395c3e16
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/qtsupport/qtoutputformatter.cpp')
-rw-r--r-- | src/plugins/qtsupport/qtoutputformatter.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp index 8fba279776..c5a4d7a427 100644 --- a/src/plugins/qtsupport/qtoutputformatter.cpp +++ b/src/plugins/qtsupport/qtoutputformatter.cpp @@ -53,7 +53,7 @@ public: : qmlError("(" QT_QML_URL_REGEXP // url ":\\d+" // colon, line "(?::\\d+)?)" // colon, column (optional) - "[: \t)]") // colon, space, tab or brace + "\\b") // word boundary , qtError("Object::.*in (.*:\\d+)") , qtAssert(QT_ASSERT_REGEXP) , qtAssertX(QT_ASSERT_X_REGEXP) @@ -364,6 +364,26 @@ void QtSupportPlugin::testQtOutputFormatter_data() << 0 << 19 << "file:///main.qml:20" << "/main.qml" << 20 << -1; + QTest::newRow("File link without further text") + << "file:///home/user/main.cpp:157" + << 0 << 30 << "file:///home/user/main.cpp:157" + << "/home/user/main.cpp" << 157 << -1; + + QTest::newRow("File link with text before") + << "Text before: file:///home/user/main.cpp:157" + << 13 << 43 << "file:///home/user/main.cpp:157" + << "/home/user/main.cpp" << 157 << -1; + + QTest::newRow("File link with text afterwards") + << "file:///home/user/main.cpp:157: Text afterwards" + << 0 << 30 << "file:///home/user/main.cpp:157" + << "/home/user/main.cpp" << 157 << -1; + + QTest::newRow("File link with text before and afterwards") + << "Text before file:///home/user/main.cpp:157 and text afterwards" + << 12 << 42 << "file:///home/user/main.cpp:157" + << "/home/user/main.cpp" << 157 << -1; + QTest::newRow("Unix file link with timestamp") << "file:///home/user/main.cpp:157 2018-03-21 10:54:45.706" << 0 << 30 << "file:///home/user/main.cpp:157" |