Author Topic: code completion  (Read 6167 times)

msk4web

  • Guest
code completion
« on: December 19, 2005, 03:04:36 pm »
I have problem with the code completion. it don't seem working all time.
I create a class and save the file then I create an Instance in other file, when I try to browser its member
don't happen any thing. in times it work but rarly.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: code completion
« Reply #1 on: December 19, 2005, 03:18:55 pm »
Code completion is not perfect, but it normally works quite well with these constraints:

1. header files on the hard disk are scanned, not in-memory
2. No project = no code completion. Source or header not part of the project = no code completion.
3. no std:: classes, no STL
4. namespaces do work, but the keyword using is not implemented yet
5. it must have finished parsing before it is any good - this can take up to 10-15 seconds on a large project
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: code completion
« Reply #2 on: December 19, 2005, 03:26:55 pm »
Thomas,

The code completion, how close is it connected to other parsing functions in the CB sources ?
For exampe the goto function -> if that is within a namespace : no luck

void f1()
{
 ///
}

void f2()
{
 ///
}

both will show up in goto function

BUT :
namespace ReportToThomas
{
void f1()
{
 ///
}

void f2()
{
 ///
}
} // end of namespace

--> goto function : remains empty

Code completion itself : I noticed it does not work on function arguments (see bug report). Is that an known limitation of the implementation, or might this be a minor bug ??


Thanks for the info,
Lieven

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: code completion
« Reply #3 on: December 19, 2005, 04:57:20 pm »
The code completion, how close is it connected to other parsing functions in the CB sources ?
--> goto function : remains empty
The goto function is implemented using the code completion plugin (as is everything else that is even remotely related).

Quote
I noticed it does not work on function arguments
That is a known limitation, function arguments are currently disabled to avoid conflicts with types in the global namespace which would otherwise be incorrectly identified.
You will have to ask Yiannis if he plans on implementing this any time soon. I believe that it is not a top priority at the moment, though.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: code completion
« Reply #4 on: December 19, 2005, 10:17:19 pm »
I was wondering about that conflict with the global namespace. Don't know the parser of course, but function arguments are to be considered as local variables within the function. ANd code completion works on the local variables on the inside.
Could a simple modification result in such behaviour ?

So goto function also depends on the code completion, nice, wondering why I can't deal with namespaces then. Gonna try something tomorrow if code copmpletion does kick in when coding inside a namespace.