Page 1 of 1

CodeCompletion for typedef defined with macro

Posted: Fri Mar 23, 2012 5:54 pm
by dhs
Hi

I use a macro to define (typedef) multiple Types at the same time from for a specific class

1/ Here is a skeleton of the macro (may not compile)

>> #define DECLARE_MY_TYPES(X) class X;typedef std::vectorr<X> Vector##X; typedef map<str::string, X> Map##X;

2/ Then in any file .h, I do:

>> DECLARE_MY_TYPE(MyClass)
>> VectorMyClass test; // so test ~ std::vector<MyClass>

3/ The compilation of the project has no error.

4/ I try to do autocomplete from CodeLIte (test.<Ctrl-Space> ) --> nothing is showed

I am using the version 3.5.5375 Linux

Could you please tell me if COdeLite support typedef using ## in the macro ? I already try this with Eclipse and eclipse understand the feature

Thanks

DO Hong Son

Re: CodeCompletion for typedef defined with macro

Posted: Fri Mar 23, 2012 11:44 pm
by eranif
Enable clang code completion - and it should understand that

http://www.codelite.org/LiteEditor/ClangIntegration35


Eran

Re: CodeCompletion for typedef defined with macro

Posted: Sun Mar 25, 2012 6:08 pm
by dhs
Hi

I compile codelite on Linux without clang because the gcc version of my linux machine is a little bit old (here is the post: viewtopic.php?f=3&t=1642)

Is there any other workaround for this issue ?

Another issue I can see is that sometime CodeLite cannot distinguish between a normal variable and a pointer; So if I have a class X with a varibale x, CodeLIte will show same functions on code complete list when I do (x.) and (x->).

Thanks

Re: CodeCompletion for typedef defined with macro

Posted: Mon Mar 26, 2012 12:41 am
by eranif
dhs wrote:Is there any other workaround for this issue ?
No.
dhs wrote:Another issue I can see is that sometime CodeLite cannot distinguish between a normal variable and a pointer; So if I have a class X with a varibale x, CodeLIte will show same functions on code complete list when I do (x.) and (x->).
Works as intended - in the far past it was trying to be smarter and auto fix based on the operator used - it caused more annoyance then it helped

Eran

Re: CodeCompletion for typedef defined with macro

Posted: Mon Mar 26, 2012 4:23 pm
by dhs
I try the following workaround by adding into Tagsoption --> ctags --> Advanced --> Types:
VectorInt=std::vector<int>
but CodeLite still does not show the code completion.

Did I do something wrong ?

Re: CodeCompletion for typedef defined with macro

Posted: Mon Mar 26, 2012 4:59 pm
by eranif
dhs wrote:VectorInt=std::vector<int>
I am not sure why, but this should work:

Code: Select all

#include <vector>
...
typedef std::vector<int> VectorInt;
VectorInt myVec;
myVec. // completion works
Eran

Re: CodeCompletion for typedef defined with macro

Posted: Tue Apr 03, 2012 2:02 am
by dhs
Could you please explain to me the difference between Types and Tokens in Tag Settings --> ctags --> Advanced ?

Is it possible to have the preprocessed files after Tokens and Types ? (to check if replacement is correct)

I try to explore the ctag file using a SQLite brower. is it possible to add some types manually to the database ?