aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmllint
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-12-13 13:19:33 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-12-13 19:41:37 +0000
commit2c33b5d0b449b90993312e86e0904931e516dc2d (patch)
tree61fa3fe7224512b2a70f6d30f95803362637569d /src/qmllint
parent17feb7753607c51eee8a624fd9e4e19d48a0a793 (diff)
qqmljscompiler: Allow for reading file contents from memory
This is necessary in order for the qmllint library to provide linting in memory. This in turn is used by our LSP. Change-Id: Ice01c16b4d9ff90cddac87c8840dc5556981f9d5 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit f5dc8ef19f4a92b307da38598955efd89922fc7e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qmllint')
-rw-r--r--src/qmllint/qqmllinter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qmllint/qqmllinter.cpp b/src/qmllint/qqmllinter.cpp
index feefa3e1a4..8692dec480 100644
--- a/src/qmllint/qqmllinter.cpp
+++ b/src/qmllint/qqmllinter.cpp
@@ -242,7 +242,8 @@ bool QQmlLinter::lintFile(const QString &filename, const QString *fileContents,
QLoggingCategory::setFilterRules(u"qt.qml.compiler=false"_qs);
CodegenWarningInterface interface(m_logger.get());
- qCompileQmlFile(filename, saveFunction, &codegen, &error, true, &interface);
+ qCompileQmlFile(filename, saveFunction, &codegen, &error, true, &interface,
+ fileContents);
success &= !m_logger->hasWarnings() && !m_logger->hasErrors();