Autocompletion in C for "this"-Tag

General questions regarding the usage of CodeLite
tingel2k
CodeLite Curious
Posts: 1
Joined: Mon Nov 01, 2010 2:57 pm
Genuine User: Yes
IDE Question: C++
Contact:

Autocompletion in C for "this"-Tag

Post by tingel2k »

Hi,

is it possible to get the autocompletion for the keyword "this" in a program written in C ?
f.e.

Code: Select all

void stupid_func( struct coolstruct * this ){ 

    this->coolness = 5 ;
    this->stupidity = 0xff; 
}
is there a way to get the completion for the structure from "this"?

Greetz tingel2k
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Autocompletion in C for "this"-Tag

Post by eranif »

I noticed two problems:
1) 'this' is handled in a special way in code completion, this can be fixed (i.e. check the file extension)
2) codelite does not seem to provide completion to variables declared as 'strcut coolstruct* mystruct', it will offer completion for declaration like this 'coolstruct* mystruct'


I will look into both problems.
Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Autocompletion in C for "this"-Tag

Post by eranif »

As a workaround:

Use typedef:

Code: Select all

typedef struct
{
	int coolness;
	int stupidity;
} coolstruct;
Use the typedef in the prototype, and rename 'this':

Code: Select all

void foo(coolstruct *cs)
{
}
EDIT:
Please open a bug for both issues in sourceforge so they wont get lost in the forum
Eran
Make sure you have read the HOW TO POST thread
Post Reply