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

Denis Steckelmacher steckdenis at yahoo.fr
Sat May 31 10:35:04 UTC 2014


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

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/20904460/attachment-0001.html>


More information about the KDevelop-devel mailing list