Guidance needed to contribute to kdev-clang
Olivier J. G.
olivier.jg at gmail.com
Tue Feb 11 10:23:33 UTC 2014
On Mon, Feb 10, 2014 at 6:30 PM, Maciej Cencora <m.cencora at gmail.com> wrote:
> Hi,
>
> I would like to contribute to kdev-clang plugin but I need some guidance
> or suggestions on directions where to fix following problems:
>
> 1) assertion failed in duchain/tuduchain.h
> void setType(Declaration* decl, AbstractType::Ptr type) const
> {
> IdentifiedType *id = dynamic_cast<IdentifiedType*>(type.unsafeData());
> Q_ASSERT(id);
> ...
> }
>
As I noted (accidentally not sent to the list), this is fixed.
>
> 2) same data/function member use is colorized differently in header file
> and in source file
>
Not sure I can identify this problem... are you talking about old-cpp's use
of orangish for member variables/declarations?
>
> 3) no navigation widget on class scope specifier for out-of-line member
> function definitions
> class Foo
> {
> void bar();
> };
>
> void Foo::bar() {} // "Foo" not navigable, but colorized
>
This is strange. Possibly something going wrong with use creation
(tuduchain.cpp:157), but it seems to create a valid use...
>
> 4) no navigation widget and colorization of destructor declaration
> class B
> {
> public:
> ~B() {} // "~B" is not navigable, and not colorized
> };
> ...
> B b;
> b.~B(); // "~B" is not navigable, and not colorized
>
Hmm, the range we get for the destructor (from clang) only includes the
tilde. Possibly we should create a use of B here; two problems with that
are that we don't seem to get a use cursor, and that would be strange VS
the constructor (which is a function). Maybe investigate the cursor and
range that clang gives us here (TUDUChain::visitCursor)?
>
> 5) no navigation widget for uses inside user defined subscript operator:
> int getInt();
> std::map<int, int> c;
> c[getInt()] = 0; // "getInt()" is not navigable separately but whole
> [getInt()] is
>
This is because the use of operator[] takes that whole range. A solution
might be to customize the range for an operator[] use to just include the
opening "[".
>
> 6) no navigation widget for uses of other overloaded operators
> std::cout << 1; // "<<" is not navigable
>
This is odd. One could check if we get anything in TUDUChain::visitCursor
...
>
> 7) no navigation widget or colorization of uses of template parameters
> template <typename Type> // "Type" is colorized but not navigable
> class A
> {
> Type member; // "Type" is not navigable, and not colorized
> };
>
TUDUChain::visitCursor is again the entry point to finding out what's going
on here. First question: are we creating a Declaration or a use for the
"Type" in "<typename Type"? We should be creating a declaration. Next
question, what cursor, if any, do we get for "Type" in "Type member;"? It
should be a use of the declaration in "<typename Type>"
Regards,
-Olivier JG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140211/1074d50e/attachment.html>
More information about the KDevelop-devel
mailing list