Commit f7b2dd95 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.textToModelMerger: check for no imports

No imports make no sense in the visual designer.

Change-Id: Ib426d726c6d7e11a3dce25b3c73c4bc921f64f60

Reviewed-by: default avatarQt Sanity Bot <>
Reviewed-by: default avatarThomas Hartmann <>
parent f231c246
......@@ -748,6 +748,11 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
setupImports(doc, differenceHandler);
if (m_rewriterView->model()->imports().isEmpty()) {
const QmlJS::DiagnosticMessage diagnosticMessage(QmlJS::DiagnosticMessage::Error, AST::SourceLocation(0, 0, 0, 0), QCoreApplication::translate("QmlDesigner::TextToModelMerger error message", "No import statements found"));
errors.append(RewriterView::Error(diagnosticMessage, QUrl::fromLocalFile(doc->fileName())));
if (view()->checkSemanticErrors()) {
Check check(doc, m_lookupContext->context());
check.setOptions(check.options() & ~Check::ErrCheckTypeErrors);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment