News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Completion is scope sensitive ??

Started by daniloz, August 12, 2009, 09:44:16 AM

Previous topic - Next topic

daniloz

Hi All,

I'm new to this forum, but have been working with Code::Blocks for some while now and since I discovery it I really liked it. It's the best source code editor ever !! Thank you for the great job!

My questions now (sorry if this is well know, but I couldn't find it in the help or FAQs):

1- Is code completion working only in the part of the code that a variable is defined, for example? Is it that smart?

2- It doesn't seem to be working for me in the following example:


int AAA;

void main()
{
int BBB;
int CCC;
}


That's what's happening:

-> If the cursor is inside the main() function, BBB and CCC get completed, BUT AAA is not found (no completions at all).

-> If the cursor is outside the main() function, none of the variables are completed.

BTW, I have the latest SVN version (compiled here using MinGW).

Thank you,
daniloz

blueshake

#1
if you type the codes, you need to save the file,so the codecompletion can get the chance to parse the file.
in the function,the codecompletion will parse the codes in the function body.so it work.have a try.it will work. :D

actually the current codecompletion can not parse file in real time.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

daniloz

Hi,

Thanks for you reply.

Quote from: blueshake on August 12, 2009, 12:16:09 PM
if you type the codes, you need to save the file,so the codecompletion can get the chance to parse the file.

[...]

actually the current codecompletion can not parse file in real time.

I am aware of that. I've saved the file. :)

Quote from: blueshake on August 12, 2009, 12:16:09 PM
in the function,the codecompletion will parse the codes in the function body.so it work.have a try.it will work. :D

You're right. If the cursor is INSIDE the function, I get BBB and CCC completed. It works perfect.

HOWEVER, if the cursor is OUTSIDE the function, no completion is done AT ALL.

Jenna

Works fine here for me:
AAA, BBB and CCC are completed inside the function, AAA is completed outside the function.
C::B svn r5730.

Which version do you use ?

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

blueshake

QuoteHOWEVER, if the cursor is OUTSIDE the function, no completion is done AT ALL.
dose it still not work outside the function after you save the file?
the AAA showed in my local copy.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

daniloz

Ok, I have C::B svn r5730 as well and it's NOT working outside the function.  :shock:

Can it be related to my workspace? Any setting?

Actually, I have a 8.02 version of C::B installed (properly on C:\Program Files and everything) and it seems that the r5730 is aware of the settings I had with the v8.02. Is this possible?

daniloz

Additional information:

I removed the configuration folder from the v8.02 installation and ran again the r5730 with default configuration.

No completion outside the function whatsoever.

Thanks!

blueshake

it is strange.It work fine for me.
does codeblock 8.02 can work?as I konw .sometimes codeblock 8.02 may  not work when you type in
a new file.

I think you can try this.in svn 5730
create a new console project which contains the basic codes. and try again.remember save the
file . :D
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

daniloz

Thanks for the hint blueshake.

I did it and it's working now. But only if it's included in a project. What's the explanation? :D

blueshake

QuoteI did it and it's working now. But only if it's included in a project. What's the explanation?
sorry , it's out of my ability.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?