Let's start with a current issue : hover over the "DoSomething" part of "MyTest.DoSomething();", right click and choose "Find declaration". CB offers you a choice, although there should be no choice, only the the Test::DoSomething() is a candidate, it however also offer the one from the class Confuse an an option. [same applies when starting from 'MyPointerToTest->DoSomething();"].
I'm under big work load these days, so I delayed my reply.
.
There are three major parts of CC
A. collect tokens
B. resolve statement
C. other improvement
The cc_branch till now has a lot of improvement in the first part A "correct tokens", we have add some functionality like:
1, one parser peer a project, this means a workplace can have several parser object and tokenstree, thus they don't intervene each other.
2, a NONE parser, which means if you open a file which does not belong to any project, then a NONE parser will be created and now, you can have the symbols tree for these files.
3, preprocessor handling can deal with #if #ifdef like directive, and to achieve this, you need some "up-front" file list, so that these files(there are a lot of #define in them) will be parsed before other files, thus, proprocessor handling can works better.
4, function like macro handling, we have really do some kind macro expansion
5, there are some patches to support reading the "template information", but they are not complete, they can only handle some template class declared in global namespace, also if there are typedef the template class there are some parsing errors.
6, there are other patches to tokenizer and parserthread class, Yes, there a lot patches included.
About Part B: expression(statement) solving
This is most thing about your question
1, we have introduce some new match algorithm(this can avoid some recursive call and make it faster), as you can see, a match is from the parent to child. like: objA.m_aaa.m_x, if you do a cc's suggestion list here, you need to match "objA", then match "m_aaa" in the result of "match objA"....
2, about the "template issue", only template class or template function under global workspace can works.
3, about the "find declaration issue", I remember you have complaint in
Is this something we can solve with the improved CC, this is still not solved. The current implementation is just do a plain text match in the tokenstree, so you get a lot of functions of other class. I have a solution in that thread, but I'm not sure it is a best way, since no one give any comments in that post.
4, about the smart pointer issue, I have tried it several days, but it is complex because there are some "typedef" in the template class that make things more hard, e.g.
template <typename T1>
class AAA
{
typedef T1 T2;
typedef T2 T3;
T3 function();
}
This will make the match algorithm failed when dealing with "function".
Also, our algorithm to split a statement is not good compare to CodeLite(it use a lex/yacc grammar).
About part C (UI and other improvement)
1, smart tab jump
2, auto completion for preprocessor, include files ....
3, some code format adjust after autocompletion
4, Toolbar improvement
5, symbols tree for AAA.cpp and AAA.h which are not in the same directory.
6, some auto generated code improvement
7, a Parser Test project was added, so we can find the parser error more quickly
8, realtime parse(parse while editing) and reparse issue fix, also support wxsmith change of code.
9, ..... can be seen in the SVN Log message.
Next, hover over the "MyInts" part of "MyInts.push_back(4);", CB shows in the tooltip it is a vector, I guess it would be better to say it is a "vector<int>" ?
This one, as you define the variable like this:
once a variable token "MyInts" is added to the Tokenstree, it has some other infomations like: its type string is: std::vector, its template argument list string is<int>, so I think this issue can be resolved.
A similar remark applies for all the smart pointers, for example : hovering over "MyAutoPointer" tells you it is a auto_ptr, where auto_ptr<Test> would be better, right ?
And now on to the new requests.
When I type "MyAutoPointer->", the completion allows me to choose from the list of auto_ptr methods [eg. get, release, reset, ...], it would be very good if this list is extended with the list of methods of the wrapped pointer. Since smart pointers are a very good tool to write good software, it is now less nice (in CB) since you loose the completion of the original pointer.
For the other smart pointers in this example, there's nothing at all, so it would be nice, those also got supported and provide the same level of user friendliness [codecompletion wise] as auto_ptr,
that is smart pointer methods, and original pointer methods.
If I have a template class, then I found that it has a operator "->" defined, I can get the return type. As I said before, e.g.
template <typename T1>
class AAA
{
typedef T1 T2;
typedef T2 T3;
T3 function();
T3 operator -> () .....
}
the return type of the operator -> is quite different of the T1(because there are a lot of typedef), so it is not easy to solve this. But logically it can.
, it just need a lot of time.
We are fighting some bugs in the latest cc_branch, some thread safe problem of the parser can cause the crash... it is also tough