Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.10
-
None
Description
Discovered while working on https://bugreports.qt.io/browse/QTBUG-134308:
- If you load a lazy QmlFile before doing a commitToBase() on the temporary Environment that created it, then it loads fine.
- If you load the lazy QmlFile later (which is usually the case in qmlls), then you end up loading the file using the Base environment (as the temporary environment is probably already destroyed). The Base environment uses the fallback import path, not the one that was set in the temporary DomEnvironment, and will load the file with missing import paths.
This means that base types will not be found, and this probably causes bugs later on like QTBUG-133586 where goes to definition only works if the lazy file was populated before the commitToBase-call, and not afterwards. (At least that would explain why QTBUG-133586 reproduces so randomly).
One way to fix would be to pass the import paths around during commitToBase(), but the cleaner long-term fix would be to make sure that qmlls uses different DomEnvironments/QQmlCodeModels for files requiring different import paths in QTBUG-134308.
Attachments
Issue Links
- is required for
-
QTBUG-133586 F2 shortcut or Ctrl+Click in qml files sometimes leads to build dir instead of source and sometimes does absolutly nothing
-
- Open
-
- resulted from
-
QTBUG-134308 qmlls: implement workspacefolder
-
- In Progress
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-137705 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
652927,4 | dom: workaround mixed import paths in commitToBase | dev | qt/qtdeclarative | Status: NEW | +2 | 0 |