Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => CodeCompletion redesign => Topic started by: killerbot on August 17, 2010, 12:51:39 pm

Title: some issues and requests
Post by: killerbot on August 17, 2010, 12:51:39 pm
with all the improvements currently being made on the code completion, I wonder what of the following is possible to achieve.
All tests described here are carried out on the cc branch.

Consider the following code (compile with C++Ox support) :
Code
#include <iostream>
#include <vector>
#include <memory>


class Test
{
public:
Test() : mMember() {}
void DoSomething() {}
private:
int mMember;
};

class Confuse
{
public:
Confuse() {}
void DoSomething() {}
};


int main()
{
std::vector<int> MyInts;

MyInts.push_back(2);
MyInts.push_back(4);

Test MyTest;
MyTest.DoSomething();

Test* MyPointerToTest = new Test();
MyPointerToTest->DoSomething();

// time for smart pointers
std::unique_ptr<Test> MyUniquePointer(new Test());
MyUniquePointer->DoSomething();

std::shared_ptr<Test> MySharedPointer(new Test());
MySharedPointer->DoSomething();

std::auto_ptr<Test> MyAutoPointer(new Test());
MyAutoPointer->DoSomething();

delete MyPointerToTest;
return 0;
}

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();"].

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>" ?

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.

How feasible do the cc gurus think this is ?
Personally I think this would be a major benefit.
Title: Re: some issues and requests
Post by: oBFusCATed on August 17, 2010, 01:32:41 pm
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.
-std=c++0x in gcc defines a macro (GCC_CPP_OX_EXPERIMENTAL or something like that) and probably the current parser doesn't define this macro, so the c++-0x additions to the STL are not parsed at all.

How feasible do the cc gurus think this is ?
Personally I think this would be a major benefit.
+1
Title: Re: some issues and requests
Post by: daniloz on August 18, 2010, 08:46:21 am
How feasible do the cc gurus think this is ?
Personally I think this would be a major benefit.
+1
+1 = 2
Title: Re: some issues and requests
Post by: ollydbg on August 19, 2010, 02:02:36 am
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.  :D.

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 (http://forums.codeblocks.org/index.php/topic,12013.0.html), 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.  :D
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.
Code
template <typename T1>
class AAA
{
    typedef T1 T2;
    typedef T2 T3;
    T3 function();
}
This will make the match algorithm failed when dealing with "function".  :D
Also, our algorithm to split a statement is not good compare to CodeLite(it use a lex/yacc grammar). :D

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.


Quote
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:
Code
std::vector<int> MyInts;
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.


Code
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.
Code
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. :D, 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 :D





Title: Re: some issues and requests
Post by: Loaden on August 19, 2010, 03:38:01 am
Sorry, I was busy these days to make a significant improvement, patch size has reached 95KB, so have not noticed this post.
I will carefully review your proposed that these features, and as much as possible to achieve them!
Title: Re: some issues and requests
Post by: Loaden on August 19, 2010, 03:42:02 am
Thank ollydbg summary, your summary is really great!
 :)
Title: Re: some issues and requests
Post by: Loaden on August 27, 2010, 08:27:28 am
Solved the first issue, test are welcome.  :D
Title: Re: some issues and requests
Post by: Loaden on August 27, 2010, 09:10:38 am
Fix the next issue: about template variables calltip error.
Title: Re: some issues and requests
Post by: Loaden on August 27, 2010, 10:26:50 am
About the the requests: support GCC's "-std=c++0x" or "-std=gnu++0x" options.
If use the above options, will define a macro named: __GXX_EXPERIMENTAL_CXX0X__

So, We can parse shared_ptr now. :)
Title: Re: some issues and requests
Post by: killerbot on August 27, 2010, 12:50:37 pm
I can confirm it all works (vector<int>, smart pointer, goto decla/impl).
Really, a job well done. Superb !!!
Title: Re: some issues and requests
Post by: oBFusCATed on August 27, 2010, 12:53:36 pm
Does

Code
#include <tr1/memory>
std::tr1::shared_ptr<blabla> p(...)

work?
Title: Re: some issues and requests
Post by: Loaden on August 27, 2010, 01:09:45 pm
Does

Code
#include <tr1/memory>
std::tr1::shared_ptr<blabla> p(...)

work?

GCC version?
All test based GCC 4.4.x
Title: Re: some issues and requests
Post by: blueshake on August 27, 2010, 01:17:49 pm
Does

Code
#include <tr1/memory>
std::tr1::shared_ptr<blabla> p(...)

work?



no ,it is about operator overload,
Title: Re: some issues and requests
Post by: oBFusCATed on August 27, 2010, 01:29:39 pm
I was asking if you're parsing the the tr1 shared_ptr correctly, not if the operator -> works.
Title: Re: some issues and requests
Post by: daniloz on August 27, 2010, 03:29:30 pm
I can confirm it works also with the "trunk" version... I just had to apply the patch manually, but here is a patch against the trunk version r6536.
Title: Re: some issues and requests
Post by: blueshake on September 02, 2010, 10:25:13 am
@all
here comes my good news.after my some days' work ,cc_branch can support auto_ptr now.see the screenshot.

(http://commondatastorage.googleapis.com/static.panoramio.com/photos/original/40186018.jpg)
Title: Re: some issues and requests
Post by: blueshake on September 02, 2010, 10:28:32 am
once passed through  our (Loaden, ollydbg and I) test, I will release the patch. :P
Title: Re: some issues and requests
Post by: ollydbg on September 02, 2010, 10:40:25 am
Thanks for your work.!!!!!
Loaden and I were too busy in the next few days, I suggest you can post this patch here, then more people can test it.
I will test it in the weekend.
Title: Re: some issues and requests
Post by: killerbot on September 02, 2010, 11:10:29 am
this is great news, if you feel confident have Martin put it on the cc branch, so we can test :-)
on to the next smart pointer  8)
Title: Re: some issues and requests
Post by: blueshake on September 02, 2010, 11:32:58 am
this is great news, if you feel confident have Martin put it on the cc branch, so we can test :-)
on to the next smart pointer  8)
done. :D
Title: Re: some issues and requests
Post by: MortenMacFly on September 02, 2010, 08:57:12 pm
this is great news, if you feel confident have Martin put it on the cc branch, so we can test :-)
on to the next smart pointer  8)
done. :D
Sorry guys, I'm rather busy so I saw this just today. I've applied in to the branch, however - from my point of view this is untested, so be careful.

From a quick inspection of the code I realised at least one spelling mistake "tokenOperatroType" and method names like "CollectSS" won't really improve readability of the code. But these are probably minor things. However, I'd love to see them fixed.
Title: Re: some issues and requests
Post by: killerbot on September 03, 2010, 09:01:21 am
I have tested on the original example, and all 3 smart pointers (auto/unique/shared) work marvelous.
Really great, well done  :P
Title: Re: some issues and requests
Post by: ollydbg on September 03, 2010, 03:00:52 pm
this is great news, if you feel confident have Martin put it on the cc branch, so we can test :-)
on to the next smart pointer  8)
done. :D
Sorry guys, I'm rather busy so I saw this just today. I've applied in to the branch, however - from my point of view this is untested, so be careful.

From a quick inspection of the code I realised at least one spelling mistake "tokenOperatroType" and method names like "CollectSS" won't really improve readability of the code. But these are probably minor things. However, I'd love to see them fixed.

the class : NativeParser is too big, and contains many mixed functionalities, I would suggest to divide to subclasses.
Title: Re: some issues and requests
Post by: blueshake on September 04, 2010, 03:02:18 am
(http://commondatastorage.googleapis.com/static.panoramio.com/photos/medium/40262568.jpg)
Title: Re: some issues and requests
Post by: blueshake on September 04, 2010, 03:22:35 am
about the typo, and the readability,ollydbg had token over the job.let's wait for his good news. :P
Title: Re: some issues and requests
Post by: oBFusCATed on September 08, 2010, 12:19:07 am
Another feature request (question).

Code
std::vector<someclass>::iterator it = myvector.begin();
it->|

Does current code completion parse the overloaded -> operator?
Also does it show the methods/members of someclass, not the iterator's?

This will be event better improvement, because iterators are used more often than smart pointers :)
Title: Re: some issues and requests
Post by: blueshake on September 08, 2010, 01:36:29 am
I  will dig into it this weekend。
Title: Re: some issues and requests
Post by: killerbot on September 08, 2010, 10:41:52 am
Another feature request (question).

Code
std::vector<someclass>::iterator it = myvector.begin();
it->|

Does current code completion parse the overloaded -> operator?
Also does it show the methods/members of someclass, not the iterator's?

This will be event better improvement, because iterators are used more often than smart pointers :)

this is an excellent idea.

I have to say I have seen very nice improvements on the cc branch. It is really way better then before :-)
Congratulations to the cc gurus !!!

I do think I found something which is not 100% procent correct. It has to do with the CC toolbar/dropdown.
For example I have a file [c file in this case], so the scope say "global" : OK.
When I position the cursor in the different functions, the toolbar updates correctly, and when I select a method from the toolbar the cursor jumps to the function, all OK.
BUT when I position the cursor between 2 functions, the toolbar doesn't show a function [acceptable since we are in between functions], BUT the drop down list is empty. Since I was still at the global scope, the dropdown list should still contain all the functions. Right ?
Title: Re: some issues and requests
Post by: MortenMacFly on September 08, 2010, 01:57:33 pm
I have to say I have seen very nice improvements on the cc branch. It is really way better then before :-)
Congratulations to the cc gurus !!!
True, however, I am still facing random crashes. Unfortunately not always. They are of two kinds:
1.) a compiler error occurs and the file in question is opened by C::B automatically. Result: C::B either crashes or freezes. This happens to me often for winbase.h and/or cstdint (the latter only when NOT using the C0XX compiler switch).
2.) a compiler warning/note occurs in the logs and I click on e.g. a note which opens the file in question, too. Result is the same as above but it'll always crash, not freeze.

In both cases the trace log is useless unfortunately. In both cases it works when having CC disabled.

I told Loaden about this but unfortunately he cannot reproduce. He sent me a patch I should try for a solution (actually related to refactoring), but it didn't work.

So: Is it only me or can anybody else reproduce this, too? I am using SVN HEAD of the CC branch, no additional things.
Title: Re: some issues and requests
Post by: ollydbg on September 08, 2010, 02:02:16 pm
I have to say I have seen very nice improvements on the cc branch. It is really way better then before :-)
Congratulations to the cc gurus !!!
True, however, I am still facing random crashes. Unfortunately not always. They are of two kinds:
1.) a compiler error occurs and the file in question is opened by C::B automatically. Result: C::B either crashes or freezes. This happens to me often for winbase.h and/or cstdint (the latter only when NOT using the C0XX compiler switch).
2.) a compiler warning/note occurs in the logs and I click on e.g. a note which opens the file in question, too. Result is the same as above but it'll always crash, not freeze.

In both cases the trace log is useless unfortunately. In both cases it works when having CC disabled.

I told Loaden about this but unfortunately he cannot reproduce.

I have heard this bug, but I have never meet this kind of crash. I will try to test more project.

Quote
He sent me a patch I should try for a solution (actually related to refactoring), but it didn't work.
Currently, Loaden are testing his new patch, which is V25....(include the refactoring)  :D

Title: Re: some issues and requests
Post by: MortenMacFly on September 08, 2010, 02:08:17 pm
In both cases the trace log is useless unfortunately.
When I say this I mean that it fails in the wxwidgets DLL like this:
wxStringBase13GetStringDataEv        
wxStringBase6lengthEv                
wxStringBase5emptyEv                  
xStringBaseC2ERKS_                    
wxFileName9GetVolumeEv                
wxFileName7GetPathEi12wxPathFormat    
wxFileName11GetFullPathE12wxPathFormat

...but coming from codecompletion:

nativeparser.cpp (int NativeParser::FindCurrentFunctionStart(ccSearchData* searchData, wxString* nameSpace, wxString* procName, int caretPos)):
size_t num_results = m_pParser->FindTokensInFile(searchData->pf->file.GetFullPath(), result, tkAnyFunction | tkClass);

called from:

nativeparser.cpp (NativeParser::FindCurrentFunctionToken(ccSearchData* searchData, TokenIdxSet& result, int caretPos)):
if (procName.IsEmpty())

etc...

That isn't very clear to me...
Title: Re: some issues and requests
Post by: Loaden on September 08, 2010, 03:03:21 pm
I have to say I have seen very nice improvements on the cc branch. It is really way better then before :-)
Congratulations to the cc gurus !!!
True, however, I am still facing random crashes. Unfortunately not always. They are of two kinds:
1.) a compiler error occurs and the file in question is opened by C::B automatically. Result: C::B either crashes or freezes. This happens to me often for winbase.h and/or cstdint (the latter only when NOT using the C0XX compiler switch).
2.) a compiler warning/note occurs in the logs and I click on e.g. a note which opens the file in question, too. Result is the same as above but it'll always crash, not freeze.

In both cases the trace log is useless unfortunately. In both cases it works when having CC disabled.

I told Loaden about this but unfortunately he cannot reproduce. He sent me a patch I should try for a solution (actually related to refactoring), but it didn't work.

So: Is it only me or can anybody else reproduce this, too? I am using SVN HEAD of the CC branch, no additional things.
Hi, Morten, can you trying this patch? (Only for testting)
Change Log:
Quote
1, add code re-factoring feature, support "Find reference" and "Rename symbols".
2, fix a bug cc will hang when create a project by wizard.
3, improve re-parsing of up-front header files, increase some performance.
4, add filter when parsing source files, .xrc  .xml files were not parsed.
5, real-time parsing does not parse system header files.
6, optimize the ui performance when opening several editors, special handling for wx2.8.11.
7, re-factor the CC search function, (use SearchData type instead of cbEditor)
8, optimize the UI performance after batch parse finishes, some tasks were moved from main thread to child thread.
9, add an menu entry of "Reparse this file"
10, add an menu entry of "Reparse current project", and improve Re-parsing project functionality
11, change the short-key to do the codecompletion from Ctrl+SPACE to Shift+SPACE, because in Chinese,Japanese or Korean System, Ctrl+SPACE is always used to switch IME.
12, fix switch parser delay when editor actived
13, improve switch parser

2010-09-09 10:12:53 Update: delete the attachment.
Title: Re: some issues and requests
Post by: Loaden on September 08, 2010, 03:14:45 pm
BUT when I position the cursor between 2 functions, the toolbar doesn't show a function [acceptable since we are in between functions], BUT the drop down list is empty. Since I was still at the global scope, the dropdown list should still contain all the functions. Right ?
I will checking, and try to fix.
Title: Re: some issues and requests
Post by: MortenMacFly on September 08, 2010, 03:59:12 pm
Hi, Morten, can you trying this patch? (Only for testting)
I'll give it a try... Probably any volunteers should do the same.
Title: Re: some issues and requests
Post by: Loaden on September 09, 2010, 04:17:48 am
BUT when I position the cursor between 2 functions, the toolbar doesn't show a function [acceptable since we are in between functions], BUT the drop down list is empty. Since I was still at the global scope, the dropdown list should still contain all the functions. Right ?
I will checking, and try to fix.
Fixed!

All change log:
Quote
1, add code re-factoring feature, support "Find reference" and "Rename symbols".
2, fix a bug cc will hang when create a project by wizard.
3, improve re-parsing of up-front header files, increase some performance.
4, add filter when parsing source files, .xrc  .xml files were not parsed.
5, real-time parsing does not parse system header files.
6, optimize the ui performance when opening several editors, special handling for wx2.8.11.
7, re-factor the CC search function, (use SearchData type instead of cbEditor)
8, optimize the UI performance after batch parse finishes, some tasks were moved from main thread to child thread.
9, add an menu entry of "Reparse this file"
10, add an menu entry of "Reparse current project", and improve Re-parsing project functionality
11, change the short-key to do the codecompletion from Ctrl+SPACE to Shift+SPACE, because in Chinese,Japanese or Korean System, Ctrl+SPACE is always used to switch IME.
12, fix switch parser delay when editor actived
13, improve switch parser
14, fix crash when show call tip in *NONE* project file.
15, fix global scope update error

2010-09-10 15:58:41 Update: delete the attachment.
Title: Re: some issues and requests
Post by: Loaden on September 09, 2010, 04:20:25 am
Hi, Morten, can you trying this patch? (Only for testting)
I'll give it a try... Probably any volunteers should do the same.
If there have any crash report, please show me, thanks!

About V32 patch:
Based on the V31, just modify the codecompletion.cpp file.
Title: Re: some issues and requests
Post by: ollydbg on September 09, 2010, 04:54:10 am
BUT when I position the cursor between 2 functions, the toolbar doesn't show a function [acceptable since we are in between functions], BUT the drop down list is empty. Since I was still at the global scope, the dropdown list should still contain all the functions. Right ?
I will checking, and try to fix.
Fixed!

All change log:
Quote
1, add code re-factoring feature, support "Find reference" and "Rename symbols".
2, fix a bug cc will hang when create a project by wizard.
3, improve re-parsing of up-front header files, increase some performance.
4, add filter when parsing source files, .xrc  .xml files were not parsed.
5, real-time parsing does not parse system header files.
6, optimize the ui performance when opening several editors, special handling for wx2.8.11.
7, re-factor the CC search function, (use SearchData type instead of cbEditor)
8, optimize the UI performance after batch parse finishes, some tasks were moved from main thread to child thread.
9, add an menu entry of "Reparse this file"
10, add an menu entry of "Reparse current project", and improve Re-parsing project functionality
11, change the short-key to do the codecompletion from Ctrl+SPACE to Shift+SPACE, because in Chinese,Japanese or Korean System, Ctrl+SPACE is always used to switch IME.
12, fix switch parser delay when editor actived
13, improve switch parser
14, fix crash when show call tip in *NONE* project file.
15, fix global scope update error

wonderful!! I will check it soon.
Title: Re: some issues and requests
Post by: Loaden on September 10, 2010, 10:03:09 am
Final test patch:
Quote
1, add code re-factoring feature, support "Find reference" and "Rename symbols".
2, fix a bug cc will hang when create a project by wizard.
3, improve re-parsing of up-front header files, increase some performance.
4, add filter when parsing source files, .xrc  .xml files were not parsed.
5, real-time parsing does not parse system header files.
6, optimize the ui performance when opening several editors, special handling for wx2.8.11.
7, re-factor the CC search function, (use SearchData type instead of cbEditor)
8, optimize the UI performance after batch parse finishes, some tasks were moved from main thread to child thread.
9, add an menu entry of "Reparse this file"
10, add an menu entry of "Reparse current project", and improve Re-parsing project functionality
11, change the short-key to do the codecompletion from Ctrl+SPACE to Shift+SPACE only for Chinese,Japanese or Korean system, because in Chinese,Japanese or Korean System, Ctrl+SPACE is always used to switch IME.
12, fix switch parser delay when editor actived
13, improve switch parser
14, fix crash when show call tip in *NONE* project file.
15, fix global scope update error
16, improve system header search thread

2010-09-12 11:45:12  Update: delete the attachment.
Title: Re: some issues and requests
Post by: blueshake on September 12, 2010, 04:30:57 am
I  will dig into it this weekend。

I just dig into iterator definiton.and it is quite complicate. so I think our first job is to make cc support template inheritance.

such as
Code
class MyClass : public TempClass<wxString> {
T* getStr() { return m_string; }
};
tempate <typename T>
class TempClass {
T m_string;
};
Title: Re: some issues and requests
Post by: Loaden on September 12, 2010, 05:51:13 am
I just dig into iterator definiton.and it is quite complicate. so I think our first job is to make cc support template inheritance.
Agree.
Title: Re: some issues and requests
Post by: oBFusCATed on October 23, 2010, 01:50:39 am
Here are some problems I've found after I've tested the changes to the CC (I'm testing the debuggers branch)

1. "typedef struct { } struct_name;"  is parsed as __UNAMED_STRUCT_XXXX
2. __cplusplus and/or _GLIBCPP_USE_NAMESPACES are not define while parsing, so __BEGIN_NAMESPACE_STD is not defined correctly (see cdefs.h)
3. Add workspace symbols in the Symbols browser view combo
4. The class combo in the toolbar has :: at the end of the strings... pretty wrong!
5. Goto declaration goes to the start of the line not the start of the token
6. Goto declaration goes to the { of a function, when the declaration is an argument, should go to the start of the token
7. Combine 'Goto declaration and goto implementation' into one option and display popup menu with the possibilities (see Visual Assist)
8. Sometimes 'goto declaration' works but 'goto implementation' doesn't
9. No support for iterators' ->
9.1. No support for my custom smart pointer ->
10. No support for #define FACTORY_DECLARE(type, factory_typename)   typedef CFactory<type> factory_typename
11. No template parameters for templated classes in the Symbol Browser
12. Call tip for constructors still not working
13. Call tip sometimes don't show (pretty random)
14. There is no highlighted parameter in the calltip (sometimes)
15. Symbols browser is not updated after some text is typed and "Update parser when typing" = on (when probably, should be replace with while (native speaker correct me please))
16. namespace {} is not added to the Symbols browser

Have fun and good luck :)
Title: Re: some issues and requests
Post by: oBFusCATed on October 23, 2010, 03:20:30 pm
Also, I think the SDK versions should be increased...
Title: Re: some issues and requests
Post by: Loaden on October 23, 2010, 04:33:23 pm
1. "typedef struct { } struct_name;"  is parsed as __UNAMED_STRUCT_XXXX
2. __cplusplus and/or _GLIBCPP_USE_NAMESPACES are not define while parsing, so __BEGIN_NAMESPACE_STD is not defined correctly (see cdefs.h)
3. Add workspace symbols in the Symbols browser view combo
1. This is the right way.
2. We can not distinguish between  C or C++, but __cplusplus just needed by C++, not C. We can not find the best way.
3. This is impossible! Because in current, a project per to a parser.
 :)
Title: Re: some issues and requests
Post by: Loaden on October 23, 2010, 04:43:35 pm
4. The class combo in the toolbar has :: at the end of the strings... pretty wrong!
5. Goto declaration goes to the start of the line not the start of the token
6. Goto declaration goes to the { of a function, when the declaration is an argument, should go to the start of the token
7. Combine 'Goto declaration and goto implementation' into one option and display popup menu with the possibilities (see Visual Assist)
4. Could you give me more explain?
5. In current, we record only the line number, but not the position.
6. Sorry, do not understood.
7. e.g. How to decision? void tes|t() { /* implement*/ }
Title: Re: some issues and requests
Post by: blueshake on October 23, 2010, 05:14:04 pm
Quote
No support for my custom smart pointer ->

this should be supported now.
@oBFusCATed

can you give some test codes??
Title: Re: some issues and requests
Post by: oBFusCATed on October 23, 2010, 06:24:41 pm
1. This is the right way.
2. We can not distinguish between  C or C++, but __cplusplus just needed by C++, not C. We can not find the best way.
3. This is impossible! Because in current, a project per to a parser.
4. Could you give me more explain?
5. In current, we record only the line number, but not the position.
6. Sorry, do not understood.
7. e.g. How to decision? void tes|t() { /* implement*/ }
1. No, it is not the right thing to do, I'm talking as a user.
   I don't care that some has used "typedef struct {} name;" (this is the correct C code, by the way), instead of "struct name {};".
   In the symbols browser I want to see the struct name, in both cases.
   Now, I get Unamed_Struct_00xxx and I should search in the typedefs to see what is the real name.
   You can say that it can't be done (of course I doubt about that:) ), but saying this is the right was is plain wrong :)
2. You can, it the .h file is included from C++ file the __cplusplus macro is define, simple as that (of course it will get pretty nasty if both C and C++ file include the same header) :)
3. I see
4. See here http://smrt.is-a-geek.org/codeblocks/screens/cc_toolbar_bug.png
5. Can you record the position, I don't think it will be such problem? (Another int in the token struct, big deal).
6. If you have code like this:

int func(int arg1)
{
 ....
 ....
    int c = arg1; <--- goto declaration here will goto the opening curly bracket of the function '{', not to the position of the argument
}
It looks like 6 is related to 5 :)

7. No need for decision, you can fill the popup menu with all the found declarations and implementations

Blueshake, seems you're right, probably the bug 9.1 is related to bug 10.
Title: Re: some issues and requests
Post by: ollydbg on October 24, 2010, 04:07:51 am
5. Can you record the position, I don't think it will be such problem? (Another int in the token struct, big deal).
You mean the "column position"? if Yes, the Tokenizer class should record the column position, then add a int member variable in the Token class.


Title: Re: some issues and requests
Post by: oBFusCATed on October 24, 2010, 12:29:58 pm
Yes, the column
Title: Re: some issues and requests
Post by: Loaden on November 01, 2010, 09:53:29 am
5. Goto declaration goes to the start of the line not the start of the token
6. Goto declaration goes to the { of a function, when the declaration is an argument, should go to the start of the token
8. Sometimes 'goto declaration' works but 'goto implementation' doesn't
13. Call tip sometimes don't show (pretty random)
14. There is no highlighted parameter in the calltip (sometimes)
Hi, oBFusCATed, these issue should be fixed in HEAD.
Title: Re: some issues and requests
Post by: Loaden on November 01, 2010, 09:57:16 am
15. Symbols browser is not updated after some text is typed and "Update parser when typing" = on (when probably, should be replace with while (native speaker correct me please))
Can you post a test demo in here?
I can't reproduce you problem.
Title: Re: some issues and requests
Post by: Loaden on November 01, 2010, 10:06:11 am
12. Call tip for constructors still not working
Fixed in r6802.
Title: Re: some issues and requests
Post by: Loaden on November 01, 2010, 10:27:05 am
11. No template parameters for templated classes in the Symbol Browser
supported in r6803.
Title: Re: some issues and requests
Post by: Loaden on November 01, 2010, 10:33:36 am
2. We can not distinguish between  C or C++, but __cplusplus just needed by C++, not C. We can not find the best way.
2. You can, it the .h file is included from C++ file the __cplusplus macro is define, simple as that (of course it will get pretty nasty if both C and C++ file include the same header) :)
No, we can't.
In batch parsing, we can only get the target compiler, but in a project, a target can per a compiler.
So, who is the C Compiler? who is the C++ compiler?
If there have C Compiler, and have C++ Compiler too, then how to decision?
This is too hard, we can't solved it.
Title: Re: some issues and requests
Post by: oBFusCATed on November 01, 2010, 12:34:01 pm
Loaden: thanks for the fixes, I'll give it a try the next time Morten syncs the branches :)

No, we can't.
In batch parsing, we can only get the target compiler, but in a project, a target can per a compiler.
So, who is the C Compiler? who is the C++ compiler?
If there have C Compiler, and have C++ Compiler too, then how to decision?
This is too hard, we can't solved it.

Why do you care for the compiler?
You know the type of every translation unit (.c or .cpp file),
so if a header is included from a cpp file or a header where __cplusplus is define, you define the __cplusplus...
Title: Re: some issues and requests
Post by: Loaden on November 01, 2010, 01:24:53 pm
Loaden: thanks for the fixes, I'll give it a try the next time Morten syncs the branches :)

No, we can't.
In batch parsing, we can only get the target compiler, but in a project, a target can per a compiler.
So, who is the C Compiler? who is the C++ compiler?
If there have C Compiler, and have C++ Compiler too, then how to decision?
This is too hard, we can't solved it.

Why do you care for the compiler?
You know the type of every translation unit (.c or .cpp file),
so if a header is included from a cpp file or a header where __cplusplus is define, you define the __cplusplus...
Another way, done in r6805.
Title: Re: some issues and requests
Post by: oBFusCATed on November 01, 2010, 01:41:34 pm
Super :)
Title: Re: some issues and requests
Post by: oBFusCATed on December 29, 2010, 02:09:50 pm
Another problem I've encountered:

Type "#include <wx/i", then the completion for the include shows, then choose wx/ipc.h from the list.
The result is "#include <wx/wx/ipc.h>" not the correct one "#include <wx/ipc.h>"
Title: Re: some issues and requests
Post by: Jenna on December 29, 2010, 11:20:48 pm
Another problem I've encountered:

Type "#include <wx/i", then the completion for the include shows, then choose wx/ipc.h from the list.
The result is "#include <wx/wx/ipc.h>" not the correct one "#include <wx/ipc.h>"

Works fine here on debian.
Title: Re: some issues and requests
Post by: oBFusCATed on December 29, 2010, 11:32:28 pm
Hm, works here, too, now :(
It seems that it is a bit random or the testcase is time dependant :(