CodeLite Source Code Completion issue

General questions regarding the usage of CodeLite
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

CodeLite Source Code Completion issue

Post 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
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Source Code Completion issue

Post 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
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite Source Code Completion issue

Post 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
You do not have the required permissions to view the files attached to this post.
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Source Code Completion issue

Post 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
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite Source Code Completion issue

Post by jiapei100 »

Haha... Eran:

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

Thanks very much.


Best Regards
JIA
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Source Code Completion issue

Post 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
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite Source Code Completion issue

Post 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
Welcome to Vision Open
http://www.visionopen.com
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite Source Code Completion issue

Post 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
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Source Code Completion issue

Post by eranif »

jiapei100 wrote:Any improvements on this?
Nope
Make sure you have read the HOW TO POST thread
Post Reply