Provide, in an automatic/seamless way, all possible/likely solutions to "complete" the current identifier.
That's only one thing. To make really good code-completion you will also have to:
- Provide call tips while writing function-call function (maybe with some documentation gathered from comments)
- Provide reliable list of include files when user type #include macro
- Help with coding initializer lists on constructors
- and probably much more
Additionally current implementation also does few more things like:
- Providing class browser
- Providing "goto declaration/definition" stuff
- Detecting current scope we're in
Ok, now we can not find all identifiers in current scope. Why? Because in c++ we always include global namespace which contains really huge amount of symbols so even enumerating them may be a problem. Also we can not only take symbols from one scope - for example when we're in member function of class we must look in local variables of this function, members of the class, all members of base classes, global namespaces and all namespaces included through "using" keyword - so it's not so simple.
It even looks worse when dealing with templates - let's take an example:
teplate<typename T> class Template
{
public:
T& GetInstance() { return m_Instance; }
private:
T m_Instance;
};
class Parameter
{
public:
void PrintfText() { printf("Text"); }
};
int main(int,char**)
{
Template<Parameter> Object;
Object.GetInstance().Printf <<<<< What to complete here ?
}
In this example we don't only need to know that Object has function named GetInstance. If we detect what this function returns we see that this is template parameter - so such lists also have to be accessible from somwhere. And believe me - stl, boost and other modern libraries won't easily work without it.
Now to do the completion really good we can't overcome the problem of parsing most of the code in include files. Of course it don't require full parsing but to have accurate results we can only skip bodies of functions, everything else must be parsed as in standard c++ parser. But since we need to parse current context while completing the code, body of function we're in must be parsed then (so this shows that really good code-completion is in fact full c++ parser).
We can cache result of parsing include files (of course there are exceptions for this but they're rare) and we can quickly parse current file (when skipping function bodies) so the performance should be acceptable.
I thought lately about the cc plugin and how to improve it becuase the current implemetnation is not good enough for me (I started to really love templates and cc fails in this area) so maybe I could help too. But I think that maybe we shoudn't start any huge changes before the release (so it's not so long

) and we should focus on the release right now.
But just one suggestion which should be considered before starting the change (I already written about this some time ago but it was long time ago so I don't even remember where I wrote this

).
I think that current cc plugin should be splitted into three parts:
- Parser plugin (or maybe language-support plugin) - this one will be responsible for parsing files / detecting completion context etc. etc. - mainly analysing source code and changes made to them. I also thought about adding possibility to define own lexers and fold detectors for scintilla editor here - and I can say that I already have this part done
- Code-completion plugin - here we could leave all things related to managing threads / gui updates etc
- Parser manager - which would provide some bridge between those two (maybe more) plugins - it would manage parser plugins (for example give proper parser for given language) and it could provide some interface used to access symbols.
If parser manager and interfaces for accessing symbols will be really good designed, we can separate parsing from completion in most of areas.
Regards
BYO