diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2024-09-25 14:28:42 +0200 |
|---|---|---|
| committer | Sami Shalayel <sami.shalayel@qt.io> | 2024-10-11 17:37:39 +0200 |
| commit | 5fc2bfd3697d36423d27fa630cba48f25f719841 (patch) | |
| tree | 25cbdea59f6c493b582d5462fe8933dfbb75ecd6 /src/qmlcompiler/qqmljsfunctioninitializer.cpp | |
| parent | 9f167800927a70d75cdb98e8a9980d421a267a10 (diff) | |
QQmlSA: fix sourcelocations for plugins
Fix qqmljstypepropagator to pass more correct sourcelocations to QQmlSA
plugins: replace approximate getCurrentBindingSourceLocation()
calls with more precise getCurrentNonEmptySourceLocation() calls.
getCurrentNonEmptySourceLocation() is a newly introduced helper method
that filters out empty sourcelocations.
Empty sourcelocations happens for example for:
someValue: 42
where the parser generates a return with an empty sourcelocation:
someValue: return 42
This also adds the ability to check signal handlers in QQmlSA plugins,
as those were previously ignored in
QQmlJSTypePropagator::generate_ret_SAcheck().
Add a test to make sure the new sourcelocations do make sense, and add
sourcelocations to the expected warnings in the quick plugin.
This has the advantage that warnings become deduplicated because of
their more precise sourcelocations. Previously, two warnings on the
same binding would share the same sourcelocation, which would
technically generate two identical warnings that complain about two
different things.
Also fix the lintplugin in tst_qmllint to use the correct
sourcelocations.
This is needed for the .ui.qml warnings QQmlSA plugin.
Task-number: QTBUG-129308
Change-Id: Id52da7cf9ba586edcdae523017720fb695dd2726
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp')
0 files changed, 0 insertions, 0 deletions
