diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2026-09-30 09:31:41 +0200 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2026-10-02 11:22:43 +0000 |
| commit | 3aa66f7d3601b2222d6042c812c5054463ac4e0a (patch) | |
| tree | 831c2c9a7069c6eecddee269e001d774fa8c9416 /tests/auto/qmldom/stringdumper/tst_qmldomstringdumper.h | |
| parent | 63c1bcf809d438711ecd484b3c679a4bcd9bc84a (diff) | |
qmldom: Make --reformat reformat something
It turned every file down. Two mistakes, each enough on its own.
What loadFile() hands its callback is the metadata about the file, of
which the file itself is a field, so the check that what was loaded is a
QmlFile was asking the metadata, which is an ExternalItemInfo and never
a QmlFile. Ask the file, the way the option that dumps the syntax tree
already does.
The index the loaded files are put at was never advanced, so every file
after the first was dropped and the slots they should have gone in
stayed empty. An empty slot is not a QmlFile either, which is the other
way the same message came out.
With both fixed it writes what qmlformat writes: --reformat over a file
gives what qmlformat --normalize gives, byte for byte, since the dom
writes the script of a file through the same formatter and the options
it reformats with are the normalising ones.
Amends 4cfb323389363bf12f84044b8c7501ef2f0441b9
Task-number: QTBUG-151040
Pick-to: 6.12 6.8
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: Ibb38e0f422ebdf8991dbbc45208acbc1e4abf036
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Diffstat (limited to 'tests/auto/qmldom/stringdumper/tst_qmldomstringdumper.h')
0 files changed, 0 insertions, 0 deletions
