diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2024-04-02 11:23:56 +0200 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2024-04-17 12:27:36 +0200 |
| commit | 779d60cc432c4fc1b71c41db0f73eec309e5ee14 (patch) | |
| tree | c4c2955caaa9b869ce46aab7efff4b2ebd4e4d3b /src/qmlcompiler/qqmljsimportvisitor.cpp | |
| parent | f0d265e3f52e25b1081e56b5ce811376be6f6c51 (diff) | |
QQmlJS: Store method's source location and expose it in QQmlSA
This is useful for tooling like Axivion and can help with better error
messages.
Change-Id: Ic63afd2eeb4ee3627d05303c2518fa90282fb7ab
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qmlcompiler/qqmljsimportvisitor.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp index ff942886de..25d5944be2 100644 --- a/src/qmlcompiler/qqmljsimportvisitor.cpp +++ b/src/qmlcompiler/qqmljsimportvisitor.cpp @@ -1590,6 +1590,8 @@ bool QQmlJSImportVisitor::visit(UiPublicMember *publicMember) QQmlJSMetaMethod method; method.setMethodType(QQmlJSMetaMethodType::Signal); method.setMethodName(publicMember->name.toString()); + method.setSourceLocation(combine(publicMember->firstSourceLocation(), + publicMember->lastSourceLocation())); while (param) { method.addParameter( QQmlJSMetaParameter( @@ -1725,6 +1727,7 @@ void QQmlJSImportVisitor::visitFunctionExpressionHelper(QQmlJS::AST::FunctionExp if (!name.isEmpty()) { QQmlJSMetaMethod method(name); method.setMethodType(QQmlJSMetaMethodType::Method); + method.setSourceLocation(combine(fexpr->firstSourceLocation(), fexpr->lastSourceLocation())); if (!m_pendingMethodAnnotations.isEmpty()) { method.setAnnotations(m_pendingMethodAnnotations); |
