Page 1 of 1

Autocompletion in C for "this"-Tag

Posted: Tue Nov 02, 2010 12:14 pm
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

Re: Autocompletion in C for "this"-Tag

Posted: Tue Nov 02, 2010 1:18 pm
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

Re: Autocompletion in C for "this"-Tag

Posted: Tue Nov 02, 2010 1:23 pm
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