Page 1 of 1

CodeLite Source Code Completion issue

Posted: Sun Apr 04, 2010 8:39 pm
by jiapei100
Hi, Eran Ifrah:

I'm coming to drop a question once again. ^_^

1) Drawback description

I've got a member variable as follows:

Code: Select all

vector<VO_Triangle2DStructure>	m_vTemplateTriangle2D;
where
vector
is from
using namespace std;
and
VO_Triangle2DStructure
is one of my own classes.

I've got one line of code as:

Code: Select all

this->m_vTemplateTriangle2D[i].GetVertexIndexes();
Unfortunately, I can't successfully
Goto Declaration
when my mouse hangs on the function
GetVertexIndexes
.


2) As a comparison

Code: Select all

this->m_vNormalizedTriangle2D.push_back (...);
I can
Goto Declaration
for function
push_back
.
That is to say, STL is under tracking for code completion.


3) As a comparison

Code: Select all

int i;
this->m_VOAlignedMeanShape.GetSubShape(i);
I can
Goto Declaration
for function
GetSubShape
.
That is to say, member function of my self-defined member variable can be retrieved for code completion.


As a conclusion:
it looks like CodeLite is not able to trace the code when integrating STL and self-defined class, for example:
vector<SelfDefinedClass> someVariable;


So, Eran: can you repeat this potential drawback on your computer?
Because it's strange that this consistently happened on my computer.
I'm thinking it could be a drawback of CodeLite.
(Well, I'm using the newest CodeLite 2.5.0.4025 ).


Best Regards
JIA

Re: CodeLite Source Code Completion issue

Posted: Sun Apr 04, 2010 11:02 pm
by eranif
jiapei100 wrote:So, Eran: can you repeat this potential drawback on your computer?
No. This works perfectly fine on my computer - your conclusion is wrong. there is something in your environment which make codelite fails - if you want me to have a look at it. You will need to provide a full working example.
jiapei100 wrote:(Well, I'm using the newest CodeLite 2.5.0.4025 )
There is a hot-fix 2.5.2.4031 - so you might want to upgrade.

Eran

Re: CodeLite Source Code Completion issue

Posted: Mon Apr 05, 2010 5:25 am
by jiapei100
Hi, Dear Eran:

Thank you for your prompt reply, always ^_^

My demo code is posted as follows (and attached as well)

1) MyClass.h

Code: Select all

#ifndef __CMYCLASS_H__
#define __CMYCLASS_H__

class CMyClass
{
public:
	CMyClass(){}
	~CMyClass(){}
	
	void func();
};

#endif

2) MyClass.cpp

Code: Select all

#include "MyClass.h"

void CMyClass::func()
{
	
}
3)
main.cpp

Code: Select all

#include <MyClass.h>
#include <vector>

using namespace std;

int main(int argc, char **argv)
{
	vector<CMyClass> vc;
	vc.resize(5);
	
	vc[3].func();
	return 0;
}


It looks I can not
Goto Declaration
to
vector
now.


A video demo can be viewed at
http://www.visionopen.com/codelite_v2.5.2.4031.ogv

So, is there any place that needs to be particularly set up in codelite IDE????
Please do help...

Best Regards
JIA Pei

Re: CodeLite Source Code Completion issue

Posted: Mon Apr 05, 2010 10:42 am
by eranif
Try to avoid:

Code: Select all

using namespace
(I myself think its a bad coding taken from the Java world)

and use:

Code: Select all

std::vector<CMyClass> vc
instead.

Also, codelite does not support well 'operator[]'

So, for vector you might want to try:

Code: Select all

vc.at(3).
to get a better code-completion

Eran

Re: CodeLite Source Code Completion issue

Posted: Mon Apr 05, 2010 11:57 am
by jiapei100
Haha... Eran:

Perfect !!! Now, it's working !!!

Thanks very much.


Best Regards
JIA

Re: CodeLite Source Code Completion issue

Posted: Mon Apr 05, 2010 12:15 pm
by eranif
Hi jiapei100,
First, thanks for reporting this.
Since I am not using 'using namespace' in my code - it passed by me without notice.

In the meanwhile, I fixed the code-completion to work with the 'using namespace' example you provided
This fix is committed to trunk.
Eran

Re: CodeLite Source Code Completion issue

Posted: Mon Apr 05, 2010 12:25 pm
by jiapei100
Hi, Dear Eran:

It's pretty fast of you to give such a "using namespace ** " support !!!
Thank you very much !!!!

What's more, is it possible for you to give support to "[]" in the next release?

Best Best Regards
JIA

Re: CodeLite Source Code Completion issue

Posted: Wed Jun 02, 2010 9:07 am
by jiapei100
Hi, Eran, an additional question:

Code: Select all

.at(i)
is working now, for code completion.
However, I tried two dimension vectors.

Code: Select all

.at(i).at(j)
is still not working .

Any improvements on this?

Best Regards
JIA

Re: CodeLite Source Code Completion issue

Posted: Wed Jun 02, 2010 1:31 pm
by eranif
jiapei100 wrote:Any improvements on this?
Nope