Review Request 118215: Declare QML components and component instances in the top-level context of their document

Sven Brauch svenbrauch at googlemail.com
Tue May 20 11:40:18 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118215/#review58190
-----------------------------------------------------------


I'm not sure about this. It looks like it would break when you try to re-open the declarations on subsequent parser passes. If you like you can submit it (since it's so simple), and if we run into issues with completion later we'll know why it is. ;)

- Sven Brauch


On May 20, 2014, 11:33 a.m., Denis Steckelmacher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118215/
> -----------------------------------------------------------
> 
> (Updated May 20, 2014, 11:33 a.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-qmljs
> 
> 
> Description
> -------
> 
> In QML, component instances (identified by an "id" property) are globally visible and can even be used before they are declared. This patch ensures that QML component instances are declared in the top-level context of their document, but does not address the problem of components used before they are declared.
> 
> QML components themselves must also be declared in the top-level context of their module. For instance, a Rectangle component declared like this:
> 
> Module {
>     Component {
>         name: "Rectangle"
>     }
> }
> 
> Must be declared as "Rectangle", and not "Module::Rectangle" as is the case without this patch. Having Rectangle declared in the top-level context will allow import statements to work as expected (if you import a module, you expect Rectangle to be available, not Module.Rectangle).
> 
> 
> Diffs
> -----
> 
>   duchain/declarationbuilder.cpp a0a34af 
>   duchain/tests/testdeclarations.cpp 476c673 
> 
> Diff: https://git.reviewboard.kde.org/r/118215/diff/
> 
> 
> Testing
> -------
> 
> Two C++ unit tests have been changed, because every QML component instance is now declared in the top-level context (and not only the top-level component). All the other unit tests pass unchanged.
> 
> 
> Thanks,
> 
> Denis Steckelmacher
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140520/bb33f31c/attachment.html>


More information about the KDevelop-devel mailing list