<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 10, 2014 at 6:30 PM, Maciej Cencora <span dir="ltr"><<a href="mailto:m.cencora@gmail.com" target="_blank">m.cencora@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi,<br><br></div>I would like to contribute to kdev-clang plugin but I need some guidance or suggestions on directions where to fix following problems:<br>
<br></div>
1) assertion failed in duchain/tuduchain.h<br>void setType(Declaration* decl, AbstractType::Ptr type) const<br>{<br>     IdentifiedType *id = dynamic_cast<IdentifiedType*>(type.unsafeData());<br>     Q_ASSERT(id);<br>

...<br>}<br></div></div></div></div></div></div></div></div></blockquote><div>As I noted (accidentally not sent to the list), this is fixed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div><div><div><div><div><div></div><br></div>2) same data/function member use is colorized differently in header file and in source file<br></div></div></div></div></div></div></blockquote><div> </div>
<div>Not sure I can identify this problem... are you talking about old-cpp's use of orangish for member variables/declarations?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div><div><div><div><br></div>3) no navigation widget on class scope specifier for out-of-line member function definitions<br>
class Foo<br>{<br>    void bar();<br>};<br><br>void Foo::bar() {} // "Foo" not navigable, but colorized<br></div></div></div></div></div></blockquote><div><br></div><div>This is strange. Possibly something going wrong with use creation (tuduchain.cpp:157), but it seems to create a valid use...<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><br></div>4) no navigation widget and colorization of destructor declaration<br>
class B<br>{<br>public:<br>
    ~B() {} // "~B" is not navigable, and not colorized<br>};<br>...<br></div><div>B b;<br>b.~B(); // "~B" is not navigable, and not colorized</div></div></div></div></blockquote><div><br></div><div>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)?<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><br></div>5) no navigation widget for uses inside user defined subscript operator:<br>

int getInt();<br>std::map<int, int> c;<br>c[getInt()] = 0; // "getInt()" is not navigable separately but whole [getInt()] is<br></div></div></div></blockquote><div><br></div><div>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 "[".<br>
 <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div>6) no navigation widget for uses of other overloaded operators<br>
std::cout << 1; // "<<" is not navigable<br></div></div></blockquote><div><br></div><div>This is odd. One could check if we get anything in TUDUChain::visitCursor ...<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div>
<br></div><div>7) no navigation widget or colorization of uses of template parameters<br>template <typename Type> // "Type" is colorized but not navigable<br>class A<br>{<br>    Type member; // "Type" is not navigable, and not colorized<br>

};<br></div></div></blockquote><div><br></div><div>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>"<br>
<br></div><div>Regards,<br><br></div><div>-Olivier JG<br></div><br></div></div></div>