Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => CodeCompletion redesign => Topic started by: daniloz on August 12, 2009, 09:44:16 am

Title: Completion is scope sensitive ??
Post by: daniloz on August 12, 2009, 09:44:16 am
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:

Code
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
Title: Re: Completion is scope sensitive ??
Post by: 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.
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.
Title: Re: Completion is scope sensitive ??
Post by: daniloz on August 12, 2009, 12:35:06 pm
Hi,

Thanks for you reply.

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. :)

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.
Title: Re: Completion is scope sensitive ??
Post by: Jenna on August 12, 2009, 12:48:51 pm
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 ?
Title: Re: Completion is scope sensitive ??
Post by: MortenMacFly on August 12, 2009, 12:55:15 pm
Works fine here for me:
Works here, too.
Title: Re: Completion is scope sensitive ??
Post by: blueshake on August 12, 2009, 12:56:27 pm
Quote
HOWEVER, 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.
Title: Re: Completion is scope sensitive ??
Post by: daniloz on August 12, 2009, 02:24:54 pm
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?
Title: Re: Completion is scope sensitive ??
Post by: daniloz on August 12, 2009, 03:01:05 pm
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!
Title: Re: Completion is scope sensitive ??
Post by: blueshake on August 12, 2009, 03:10:04 pm
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
Title: Re: Completion is scope sensitive ??
Post by: daniloz on August 12, 2009, 04:14:38 pm
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
 
Title: Re: Completion is scope sensitive ??
Post by: blueshake on August 13, 2009, 03:11:09 am
Quote
I 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.