aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-05-26 12:02:30 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2016-06-02 08:09:28 +0000
commit942304f909e1bf1f299ab990e1bc6be08ce7c5ca (patch)
tree36eddce92f6f66e1fe488bef89df2a656800ae72
parenta98ce82c53d610cee1110ac54a3e0ef430cb2809 (diff)
Add missing code location to some parsing errors.
Task-number: QTCREATORBUG-16346 Change-Id: I2ab57a0da5cfc2b2fc59898a80d2122b56b96685 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/lib/corelib/language/astimportshandler.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/corelib/language/astimportshandler.cpp b/src/lib/corelib/language/astimportshandler.cpp
index 249e24789..cef4c503c 100644
--- a/src/lib/corelib/language/astimportshandler.cpp
+++ b/src/lib/corelib/language/astimportshandler.cpp
@@ -101,11 +101,14 @@ void ASTImportsHandler::handleImport(const QbsQmlJS::AST::UiImport *import)
if (JsExtensions::hasExtension(extensionName)) {
if (Q_UNLIKELY(!import->importId.isNull())) {
throw ErrorInfo(Tr::tr("Import of built-in extension '%1' "
- "must not have 'as' specifier.").arg(extensionName));
+ "must not have 'as' specifier.").arg(extensionName),
+ toCodeLocation(m_file->filePath(), import->asToken));
}
if (Q_UNLIKELY(m_file->jsExtensions().contains(extensionName))) {
- m_logger.printWarning(Tr::tr("Built-in extension '%1' already "
- "imported.").arg(extensionName));
+ m_logger.printWarning(ErrorInfo(Tr::tr("Built-in extension '%1' already "
+ "imported.").arg(extensionName),
+ toCodeLocation(m_file->filePath(),
+ import->importToken)));
} else {
m_file->addJsExtension(extensionName);
}
@@ -132,7 +135,8 @@ void ASTImportsHandler::handleImport(const QbsQmlJS::AST::UiImport *import)
toCodeLocation(m_file->filePath(), import->importIdToken));
}
if (Q_UNLIKELY(JsExtensions::hasExtension(as)))
- throw ErrorInfo(Tr::tr("Cannot reuse the name of built-in extension '%1'.").arg(as));
+ throw ErrorInfo(Tr::tr("Cannot reuse the name of built-in extension '%1'.").arg(as),
+ toCodeLocation(m_file->filePath(), import->importIdToken));
m_importAsNames.insert(as);
}