Review Request 118435: Handle namespace imports, classes and wrappers in code-completion

Sven Brauch svenbrauch at googlemail.com
Sat May 31 10:48:51 UTC 2014


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

Ship it!


I never used the importIdentifier stuff, but what you do looks okay, and since it works it should be fine. The rest looks alright as well.

Re. items with equal names: The completion model (CodeCompletionModelControllerInterfaceV4 I think the class is called) has a flag to hide items with equal names, you could try that, but I'm not sure it's enough in all cases here (because of the prefix etc. stuff).


codecompletion/completionitem.h
<https://git.reviewboard.kde.org/r/118435/#comment40928>

    don't include the kdevplatform/ here



codecompletion/completionitem.cpp
<https://git.reviewboard.kde.org/r/118435/#comment40929>

    rather use kDebug(), it can be disabled


- Sven Brauch


On May 31, 2014, 10:35 a.m., Denis Steckelmacher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118435/
> -----------------------------------------------------------
> 
> (Updated May 31, 2014, 10:35 a.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-qmljs
> 
> 
> Description
> -------
> 
> This adds support for import statements in the code-completion context (by enumerating the declarations of {...import...}), and adds a NormalDeclarationCompletionItem subclass that provides better type names for QML components, classes and instances. For instance, instead of displaying "QtQuick::Rectangle QtQuick::Rectangle", the item displays "component QtQuick::Rectangle". Instead of "<class> my_button", it displays "QtQuick.Controls::Button my_button".
> 
> These two changes required a near rewrite of context.cpp, because the old code did not handle the QML class hierarchy and used a mean of finding the globally visible symbols that was incompatible with namespaces.
> 
> 
> Diffs
> -----
> 
>   codecompletion/CMakeLists.txt de6f53c 
>   codecompletion/completionitem.h PRE-CREATION 
>   codecompletion/completionitem.cpp PRE-CREATION 
>   codecompletion/context.h 09b3d8f 
>   codecompletion/context.cpp 751dc8e 
> 
> Diff: https://git.reviewboard.kde.org/r/118435/diff/
> 
> 
> Testing
> -------
> 
> There are currently no unit tests for code-completion, but I've seen that other plugins have ones. I will add some of them in the coming days.
> 
> Manual testing has shown that everything behaves as expected. The code-completion is not yet perfect, though, and there are many duplicates (it's a QML-related problem: Button exists in a wrapper and in a component version because it is declared like that in its plugin.qmltypes file). A future patch will change that and ensure that only the most pertinent version of a symbol is displayed.
> 
> 
> Thanks,
> 
> Denis Steckelmacher
> 
>

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


More information about the KDevelop-devel mailing list