Review Request 118700: Special handling of the QML "parent" identifier
Milian Wolff
mail at milianw.de
Fri Jun 13 10:53:46 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118700/#review59958
-----------------------------------------------------------
Ship it!
One small issue, then good to go!
duchain/expressionvisitor.cpp
<https://git.reviewboard.kde.org/r/118700/#comment41744>
.str() not .byteArray()
- Milian Wolff
On June 13, 2014, 10:13 a.m., Denis Steckelmacher wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118700/
> -----------------------------------------------------------
>
> (Updated June 13, 2014, 10:13 a.m.)
>
>
> Review request for KDevelop.
>
>
> Repository: kdev-qmljs
>
>
> Description
> -------
>
> This patch adds a special-case for "parent" in ExpressionVisitor. Even if every QML object has a "parent" property of type QQuickItem, the user most of the time wants to refer to the enclosing QML component when he/she types "parent". If there is no enclosing QML component (the current component is a top-level one or something else happened), then ExpressionVisitor falls back to the old behavior and returns a QQuickItem instance.
>
> I would like to be able to activate this special handling of "parent" only for QML files, because Javascript files may use "parent" for something else. Is it possible, given a DUContext, to find its language? (or is there a way for the QML/JS plugin to store in the DUContext that the file is a Javascript one or a QML one?)
>
>
> Diffs
> -----
>
> codecompletion/tests/qmlcompletiontest.cpp 1b5cdee
> duchain/expressionvisitor.cpp 6545997
> duchain/parsesession.h b5d51d3
> duchain/parsesession.cpp 1231a40
> tests/files/test.qml 2d3dc7d
>
> Diff: https://git.reviewboard.kde.org/r/118700/diff/
>
>
> Testing
> -------
>
> A new unit test has been added. "parent" is used to refer to the enclosing component of a sub-component, and uses are correctly built. The rest of the unit tests pass. Manual testing shows that the highlighting of "parent" and the code-completion for "parent." is as expected.
>
>
> Thanks,
>
> Denis Steckelmacher
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140613/d2572d02/attachment.html>
More information about the KDevelop-devel
mailing list