Skip to content
  • Ulf Hermann's avatar
    QmlJS: Fix resolution of "alias" directives in qrc files · 35bafd39
    Ulf Hermann authored
    
    
    Previously qrc paths of QML/JS documents were not considered for
    implicit imports. Only the path of the document in the file system
    was considered. The QML engine, however, doesn't know the original
    path at all and only uses the qrc paths for import resolution. This
    created a mismatch between what the QML engine could recognize and
    what the code model suggested.
    
    Without alias directives, any files imported from a qrc file would
    have to reside in the same directory as the one implicitly importing
    them, so this arrangement happened to work, most of the time.
    
    In order to support aliases we have to search the files in the same
    qrc path to figure out the imports. To do that, we keep a reverse
    map of qrc paths to files in the QrcParser and iterate that when
    resolving imports.
    
    Change-Id: I84baae6cbfbe96ddd5322c81494c1e4a3f473f3f
    Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
    Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
    35bafd39