News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Completion HOWTO ?

Started by drakoh, April 24, 2005, 07:04:14 PM

Previous topic - Next topic

drakoh

Hi,

got a quick question about code completion.

how does it work ? it will never complete my structure fields ...

like :

typedef struct test { int var; } test

int main(int ac, char** av) { test* t = malloc(sizeof(test));
t->v <---- now type Ctrl+Space, and nothing happens ...
return (0);
}

I have seen I had to enable certains option and I also had to build the project at least one time, but even after doing this I still can't complete, Am I doing something wrong ?

thx !

--edit--
it strangely started to work ... now fields do appear, I dont even have to type Ctrl+Space, and I dont remenber having changed anything (maybe the debug flags for compiler/linker ?)

Pelle

Hello,

Good question.

The member list (a list of struct/union members after . or ->) actually requires full browse information. The Options, Source tab seems to be misleading. Both "Build browse info"/"Full", and "Use member list" must be enabled on the source tab.

That said, I think the problem is with the browse info. If I look in the database, I can't find the local variable t in your example. If that variable isn't found, the rest will fail.

The browse info builder doesn't work like the compiler, reading all the include files for a source file - it just scans the source file. This means I can sometimes get into trouble, like with the following:

name1 * name2

What is it? Two variables being multiplied, or a pointer declaration where name1 is a typedef? And so on.

I have to investigate some more...

Pelle
/Pelle

drakoh

ok I see, thx for your time !

BTW I had a look to eclipse for c developpment too, and it works quite well .... under linux.
under windows some things works, but it require mingw, ctags, and unix stuff.

JohnF

Quote from: "Pelle"Hello,

The member list (a list of struct/union members after . or ->) actually requires full browse information. The Options, Source tab seems to be misleading. Both "Build browse info"/"Full", and "Use member list" must be enabled on the source tab.

That said, I think the problem is with the browse info.
Pelle

Your Add-in structs are not picked up by this feature as far as I can see.

For example,

ADDIN_RANGE range;

When one types range.

Nothing but a beep.

John

Pelle

OK. Thanks for the info. I will look at it. Maybe I need a different approach...

Pelle
/Pelle

Pelle

Hello,

Attached is a version for testing. It seems to handle the reported cases better, hopefully without handling other cases worse.

Add-in definitions are probably found in sysdefs.tag, which is built only once. You should manually delete this file (in the Bin folder of Pelles C), to get the updated definitions. You also need to build any project, to get this file rebuilt too (will be built when missing).

Pelle
/Pelle

JohnF

That worked for the ADDIN structs, thanks.

John

drakoh

thx will be trying this evening !