Author Topic: C::B 13.12 Can't work with big project which have more than 100 files.  (Read 36069 times)

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
My enviroment:
Release 13.12 rev 9501 (2013/12/25 19:25:45) gcc 4.7.1 Windows/unicode - 32 bit
Windows 7 64bit.

Problem:
I want to manage the wxFormBuilder project which I've download from sourceforge.net, and I create a new empty project then added all files to that project.
When I open one cpp file from C::B project tree, the file is opened normally, but when I try to edit it, the main GUI is frozen, the title bar shows "No response".

Some one who can help me?

Additional,
It's work normally with little project.

Thank you very much!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #1 on: February 24, 2014, 03:19:04 pm »
Turn off the Code Completion CC Plugin; does the problem go away?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #2 on: February 25, 2014, 02:39:52 pm »
Turn off the Code Completion CC Plugin; does the problem go away?

Tim S.


The problem is still exists, I think maybe there are something running in the background and can not be switch off.

Any one, who can have a try? I'm not sure this problem is only occurred on my platform.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #3 on: February 25, 2014, 03:03:50 pm »
Attach the 7zipped CB Project file (cbp); I will see if I can dup the issue.

Edit: Please include the version number of wxFormBuilder you are trying to build? 2/3/4 etc.

Tim S.
« Last Edit: February 25, 2014, 04:32:12 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #4 on: February 25, 2014, 03:18:22 pm »
How did you turn off CC ?
In "Settings -> Editor -> Codecompletion" or in "Plugins -> Manage plugins" ?

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #5 on: February 26, 2014, 03:21:26 am »
The version of wxFormBuilder is 3.x, the latest revision. And I create a empty project by CB, then save it to the src/rad path, then add all files in this directory, and try to edit some files from CB, but it don't work.
I've tried to switch off the auto completion function, I go to settings>editor...>code completion,  chose disable code completion and disable symbols browser.
But it no efficiency.
I'll attach the project file and try to create project again tonight.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #6 on: February 26, 2014, 06:11:48 am »
Try to disable the whole plugin in "Plugins -> Manage ..."  and post if the issue goes away.

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #7 on: February 26, 2014, 02:56:42 pm »
It's work now, while I have disabled the whole code completion plugin use the Manage Plugins menu.

So it's clear now, the code completion maybe have some issue need to be fixed.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #8 on: February 26, 2014, 03:53:01 pm »
My enviroment:
Release 13.12 rev 9501 (2013/12/25 19:25:45) gcc 4.7.1 Windows/unicode - 32 bit
Windows 7 64bit.

Problem:
...
Would you mind to check the latest nightly version of C::B from Nightly builds, it is currently rev9660.

There are some bug fixes related to CodeCompletion plugin after rev9501, especially some hang issues are fixed.

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #9 on: February 26, 2014, 04:07:51 pm »
Could NOT duplicate the problem using CB 13.12 and wxFormBuilder\3.x\trunk\src\rad.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #10 on: February 27, 2014, 03:37:48 pm »
The latest nightly build can edit the files of the project normally, but the code completion function can not work, it's always show "too many result"
even if I have set the "maximum allowed code-completion matches" to 64, and only select level 1 and level 2 of the "Keyword sets to additionally include".

The simply work in my wxFormBuilder project is:
Code
wxSize sz = m_rightSplitter->GetClientSize(); 
sz.  //it will shows too many result

There is a mistake I should to fill, I'm so sorry.

the wxFormBuilder project should contains all the files in the 3.x/src directory. not the 3.x/src/rad.

1, create a empty project use C::B.
2, use "Add files recursively" and choose the directory 3.x/src

then open anyone of the files in the project.

if the the problem can't replay, who can give me a email address(use inner message from this furum), and I'll send all my project file in a zip file.


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #11 on: February 27, 2014, 03:52:26 pm »
The latest nightly build can edit the files of the project normally, but the code completion function can not work, it's always show "too many result"
even if I have set the "maximum allowed code-completion matches" to 64, and only select level 1 and level 2 of the "Keyword sets to additionally include".

The simply work in my wxFormBuilder project is:
Code
wxSize sz = m_rightSplitter->GetClientSize(); 
sz.  //it will shows too many result


In my CodeCompletion setting dialog, "maximum allowed code-completion matches" is 16460, which is much bigger than yours.
Can you try to set a big value?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #12 on: February 28, 2014, 07:42:04 am »
Actually, I just set from default value to this little value,  it refuse to pompt the suggestion  list.
I'm trying to upload my whole project to some FTP sever and put the download link here.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #13 on: February 28, 2014, 07:43:56 am »
Actually, I just set from default value to this little value,  it refuse to pompt the suggestion  list.
I'm trying to upload my whole project to some FTP sever and put the download link here.
OK, then I will try your test project.  :) Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #14 on: February 28, 2014, 02:40:37 pm »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #15 on: February 28, 2014, 04:04:54 pm »
Here it is, my whole project files.
https://www.dropbox.com/s/f0lhi9e1y9lvh6q/wxFB_Prj.zip
Works fine here (I'm using the latest svn trunk rev9665), except there are some duplicated DecBy() functions in the suggestion list.
See image shot below:

« Last Edit: February 28, 2014, 04:10:47 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #16 on: February 28, 2014, 04:56:32 pm »
Works fine here (I'm using the latest svn trunk rev9665), except there are some duplicated DecBy() functions [...]
Works fine here, too. The DecBy duplicates might be even OK, if these have different parameters... sure there is potential for an optimisation here.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #17 on: March 01, 2014, 01:43:06 am »
How about the release 13.12? no response somewhere?

Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #18 on: March 01, 2014, 01:52:28 am »
find the issue of rev9660!
code completion setting, if choose "Auto-select, if only one math", then the suggest list is "too many result", otherwise, the suggest list work well.


Offline tyysoft

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #19 on: March 01, 2014, 02:26:47 am »
And a little suggestion about the code completion
Code
wxSize* szPtr = this.GetSize();

I think the code completion thread is know the "this" is a pointer, and when I typing the ".", it should be better to change the "." to "->", is it?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #20 on: March 01, 2014, 10:26:19 am »
The DecBy duplicates might be even OK....
Looking at the screenshot they aren't OK, they are just duplicates.
Ollydbg can you check why they happen, because I've seen it on my own code.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #21 on: March 01, 2014, 12:40:06 pm »
The DecBy duplicates might be even OK....
Looking at the screenshot they aren't OK, they are just duplicates.
Ollydbg can you check why they happen, because I've seen it on my own code.
Using the CC debug tool(dialog), I just lookup the keyword "DecBy", and I get four entries, I found that they are all overload functions.
See image shot below:

So, if they have different documents, those document will shown in the right side of the suggestion list. While we move the caret in the suggestion list, the document will change accordingly.

My suggest would be: Merge the same entry in the suggestion list, but we need also merge the document. :)
Or, we can just leave it as it is.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #22 on: March 01, 2014, 12:44:47 pm »
And a little suggestion about the code completion
Code
wxSize* szPtr = this.GetSize();

I think the code completion thread is know the "this" is a pointer, and when I typing the ".", it should be better to change the "." to "->", is it?
We have such discussion already, but some people will complain such automatic change. Also, such change may be wrong (not the "this" case, but a pointer variable). Another case is when you are editing a C source file, then "this" is not a C language keyword.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #23 on: March 01, 2014, 12:47:29 pm »
ollydbg: So the problem with the duplicates is that the list of parameters is not displayed for every entry?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #24 on: March 01, 2014, 01:01:21 pm »
ollydbg: So the problem with the duplicates is that the list of parameters is not displayed for every entry?
You can enable this code completion option: Show token's details even it hasn't documentation.
(see image shot below)


You will see their function prototypes even they don't have doxygen style document, see image shot below:
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #25 on: March 01, 2014, 01:17:37 pm »
Okay, so they are different, but to me they look the same so we have to do one of these (or do both with an option) :
1. merge them together (the doc popup must show info for all versions in this case)
2. display the parameters, so the user know they are different
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #26 on: March 01, 2014, 01:25:43 pm »
2. display the parameters, so the user know they are different
We had removed this because the parameter list might get that large, that the CC windows won't fit on the screen.

If you want to try, in codecompletion.cpp, method CodeCompletion::CodeComplete() replace:
tmp << _T("(): ") << token->m_FullType;
...with:
tmp << token->GetFormattedArgs() << _T(": ") << token->m_FullType;

...the documentation is responsible for the details and should always be shown in the short version.
« Last Edit: March 01, 2014, 01:29:20 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #27 on: March 01, 2014, 01:31:11 pm »
Have you tried some string length limiting?
If yes then option 1 should be implemented. There is no point in having multiple copies of the same string in this list.
Probably this merging should be done in the CCManager in the cc_branch and not by the CC plugin.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #28 on: March 01, 2014, 01:37:54 pm »
The idea was to have a scrollable list of methods on the left and if you scroll through them the docs window always shows the details on the right. This is as minimalistic as it gets and if you take them as a combined information then thats already option 1.

In the past (w/o docs windows) we only had the plain CC window that showed the (formatted) args as well.
Whats missing IMHO is the use case, if the docs are disabled in the CC options. Then the CC windows should return to its old behaviour and show the args as well.

I think this would be most simple and clear.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #29 on: March 01, 2014, 01:45:32 pm »
Whats missing IMHO is the use case, if the docs are disabled in the CC options. Then the CC windows should return to its old behaviour and show the args as well.
I've comitted this to trunk. Play with it.

There should only be 2 cases:
1.) A short list of methods and always the docs on the right
2.) A long list of methods including args if the docs are disabled.

Every other state is invalid and we need to dig into it.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #30 on: March 01, 2014, 01:48:57 pm »
There should only be 2 cases:
1.) A short list of methods and always the docs on the right
2.) A long list of methods including args if the docs are disabled.

Every other state is invalid and we need to dig into it.
Totally agree about this :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #31 on: March 01, 2014, 03:40:02 pm »
@Morten:
Code
Index: trunk/src/plugins/codecompletion/codecompletion.cpp
===================================================================
--- trunk/src/plugins/codecompletion/codecompletion.cpp (revision 9667)
+++ trunk/src/plugins/codecompletion/codecompletion.cpp (revision 9668)
@@ -1004,8 +1004,10 @@
 
                 if (token->m_TokenKind & tkAnyFunction)
                 {
-                    //tmp << token->GetFormattedArgs();
-                    tmp << _T("(): ") << token->m_FullType;
+                    if (m_DocHelper.GetOptions().m_Enabled)
+                        tmp << _T("(): ") << token->m_FullType;
+                    else
+                        tmp << token->GetFormattedArgs() << _T(": ") << token->m_FullType;
                 }
                 else if (token->m_TokenKind == tkVariable)
                     tmp << _T(": ") << token->m_FullType;

Is it m_DocHelper.GetOptions().m_ShowAlways instead of m_DocHelper.GetOptions().m_Enabled? or both of them?
I mean in my post: Re: C::B 13.12 Can't work with big project which have more than 100 files.
I need to check on Show token's details even it hasn't documentation. to let the documentation tip window shown in the case there is no Doxygen styled document associated with the token.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #32 on: March 01, 2014, 03:44:50 pm »
As far as I'm concerned this m_DocHelper.GetOptions().m_ShowAlways should be removed from the interface and should be set to always be true.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #33 on: March 01, 2014, 03:47:25 pm »
Is it m_DocHelper.GetOptions().m_ShowAlways instead of m_DocHelper.GetOptions().m_Enabled? or both of them?
Yeah - that's tricky. If you disable "Always show" than you've a "mixed mode". It means if the method is not documented you'll stick with the mini view w/o arguments and unclear duplicates. If the method is documented its OK.

There is no good solution to this case because you cannot fill the CC list in a "mixed mode" - it would become too large again.

The only feasible solution I see is to remove this option and always show what the docs have to offer by default.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #34 on: March 01, 2014, 03:47:46 pm »
As far as I'm concerned this m_DocHelper.GetOptions().m_ShowAlways should be removed from the interface and should be set to always be true.
Our posts crossed - I've just posted the same. :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #35 on: March 01, 2014, 04:04:00 pm »
The only feasible solution I see is to remove this option and always show what the docs have to offer by default.
I've implemented that (see SVN) - it makes the code even easier... which is good. :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #36 on: March 01, 2014, 04:08:13 pm »
The only feasible solution I see is to remove this option and always show what the docs have to offer by default.
I've implemented that (see SVN) - it makes the code even easier... which is good. :-)
Good work, you are quicker than my reply.

Below is what I want to post.

Quote
I'm OK to remove the m_ShowAlways option.

Reasons:
For overloaded function tokens with no doxygen comment, if m_Enabled == true, and m_ShowAlways == false, we can still see duplicated "DecBy" entries but no document window shown, too bad! Also, it is too large (information duplicated) when both showing function arguments in the suggestion list and document window.

BTW: I found that the document window is very useful even we don't have much doxygen style document for a token. I can navigate on the suggestion list entries by click on the "goto declaration/implementation".
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #37 on: March 01, 2014, 04:17:32 pm »
@morten, rev 9669.

Code
 src/plugins/codecompletion/cctest/cctest_frame.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/codecompletion/cctest/cctest_frame.cpp b/src/plugins/codecompletion/cctest/cctest_frame.cpp
index f0c008e..d2aa4bc 100644
--- a/src/plugins/codecompletion/cctest/cctest_frame.cpp
+++ b/src/plugins/codecompletion/cctest/cctest_frame.cpp
@@ -242,6 +242,7 @@ CCTestFrame::CCTestFrame(const wxString& main_file) :
                             gcc_base + mingwver + _T("\\include")                                                   + _T("\n"));
 
     m_HeadersCtrl->SetValue(_T("<_mingw.h>,<cstddef>,<w32api.h>,<winbase.h>,<wx/defs.h>,<wx/dlimpexp.h>,<wx/toplevel.h>,<boost/config.hpp>,<boost/filesystem/config.hpp>,\"pch.h\",\"sdk.h\",\"stdafx.h\""));
+//  m_HeadersCtrl->SetValue(_T("           <cstddef>,<w32api.h>,            <wx/defs.h>,<wx/dlimpexp.h>,<wx/toplevel.h>,<boost/config.hpp>,<boost/filesystem/config.hpp>,\"pch.h\",\"sdk.h\",\"stdafx.h\""));
 
     CCLogger::Get()->Init(this, idCCLogger, idCCLogger, idCCAddToken);
     m_StatuBar->SetStatusText(_("Ready!"));
@@ -364,7 +365,7 @@ void CCTestFrame::Start()
         m_StatuBar->SetStatusText(m_CurrentFile);
 
         // This is the core parse stage for files
-        // m_NativeParser.Parse(m_CurrentFile);
+        m_NativeParser.Parse(m_CurrentFile);
 
         // Here we are going to test the expression solving algorithm
         m_NativeParser.BatchTest(m_CurrentFile);
m_NativeParser.BatchTest(m_CurrentFile) will internally parse the file, so I think m_NativeParser.Parse(m_CurrentFile) is not necessary.
What m_NativeParser.BatchTest(m_CurrentFile) do is:
1, parse the file
2, run the test (suggestion list test)


(I'm going to bed now  :)..)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re:
« Reply #38 on: March 01, 2014, 10:11:27 pm »
Well actually not. If you comment the line cctest does simply nothing. At least not on my pc...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #39 on: March 02, 2014, 01:10:59 am »
Well actually not. If you comment the line cctest does simply nothing. At least not on my pc...
I will check it later.

BTW, current trunk build failed:
Code
-------------- Build: Code-completion in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler)---------------

[  5.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -iquote.objs\include -I.objs\include -I. -IE:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\include -IE:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c plugins\codecompletion\ccoptionsdlg.cpp -o .objs\plugins\codecompletion\ccoptionsdlg.o
plugins\codecompletion\ccoptionsdlg.cpp: In constructor 'CCOptionsDlg::CCOptionsDlg(wxWindow*, NativeParser*, CodeCompletion*, DocumentationHelper*)':
plugins\codecompletion\ccoptionsdlg.cpp:180:84: error: 'class DocumentationHelper' has no member named 'GetOptions'
plugins\codecompletion\ccoptionsdlg.cpp:181:84: error: 'class DocumentationHelper' has no member named 'GetOptions'
plugins\codecompletion\ccoptionsdlg.cpp: In member function 'virtual void CCOptionsDlg::OnApply()':
plugins\codecompletion\ccoptionsdlg.cpp:287:22: error: 'class DocumentationHelper' has no member named 'GetOptions'
plugins\codecompletion\ccoptionsdlg.cpp:288:22: error: 'class DocumentationHelper' has no member named 'GetOptions'
Process terminated with status 1 (0 minute(s), 55 second(s))
4 error(s), 0 warning(s) (0 minute(s), 55 second(s))
Do you forget to commit the change of GetOptions?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B 13.12 Can't work with big project which have more than 100 files.
« Reply #40 on: March 02, 2014, 01:42:41 am »

BTW, current trunk build failed:
Code
-------------- Build: Code-completion in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler)---------------

[  5.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -iquote.objs\include -I.objs\include -I. -IE:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\include -IE:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c plugins\codecompletion\ccoptionsdlg.cpp -o .objs\plugins\codecompletion\ccoptionsdlg.o
plugins\codecompletion\ccoptionsdlg.cpp: In constructor 'CCOptionsDlg::CCOptionsDlg(wxWindow*, NativeParser*, CodeCompletion*, DocumentationHelper*)':
plugins\codecompletion\ccoptionsdlg.cpp:180:84: error: 'class DocumentationHelper' has no member named 'GetOptions'
plugins\codecompletion\ccoptionsdlg.cpp:181:84: error: 'class DocumentationHelper' has no member named 'GetOptions'
plugins\codecompletion\ccoptionsdlg.cpp: In member function 'virtual void CCOptionsDlg::OnApply()':
plugins\codecompletion\ccoptionsdlg.cpp:287:22: error: 'class DocumentationHelper' has no member named 'GetOptions'
plugins\codecompletion\ccoptionsdlg.cpp:288:22: error: 'class DocumentationHelper' has no member named 'GetOptions'
Process terminated with status 1 (0 minute(s), 55 second(s))
4 error(s), 0 warning(s) (0 minute(s), 55 second(s))
Do you forget to commit the change of GetOptions?

Fixed in trunk now.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: no need to run m_NativeParser.Parse(m_CurrentFile) in cctest
« Reply #41 on: March 02, 2014, 03:33:37 pm »
Well actually not. If you comment the line cctest does simply nothing. At least not on my pc...
That was strange, I just comment the line
Code
m_NativeParser.Parse(m_CurrentFile);
But if you look at the code:
Code
bool NativeParserTest::TestParseAndCodeCompletion(wxString filename)
{
    Clear();//clear the tree
    bool parseResult = false;
    parseResult = Parse(filename);
    if(!parseResult)
        return false;
    int passCount = 0;
    int failCount = 0;

    wxString testResult;
    wxString message = wxString::Format(_T("********************************************************\n  Testing in file: %s\n********************************************************"),filename.wx_str());
    wxLogMessage(message);
    testResult<<message<<wxT("\n");


    // read the test cases of CodeCompletion test
    wxTextFile source;
    source.Open(filename);
    wxString str;

    for ( str = source.GetLastLine();
          source.GetCurrentLine() > 0;
          str = source.GetPrevLine() )
    {

        // a test case should be put in a line, and start with the double slash
        if (str.StartsWith(_T("//")))
        {
            // do tests here, example of line is below
            // tc.St    //StaticVoid
            // remove the beginning "//"
            str.Remove(0,2);

            // find the second "//", the string after the second double slash are the
            // the result should be listed
            wxString expression;
            wxString match;
            int pos = str.Find(_T("//"));
            if (pos == wxNOT_FOUND)
                break;
            expression = str.Mid(0,pos);
            match = str.Mid(pos+2);// the remaining string

            expression.Trim();
            expression.Trim(true);
            match.Trim();
            match.Trim(true);

            wxArrayString suggestList;
            // the match can have many items, like: AAA,BBBB
            wxStringTokenizer tkz(match, wxT(","));
            while ( tkz.HasMoreTokens() )
            {
                wxString token = tkz.GetNextToken();
                suggestList.Add(token);
            }

            TokenIdxSet searchScope;
            searchScope.insert(-1);
            TokenIdxSet result;
            TestExpression(expression,searchScope,result);

            // loop the suggestList to see it is in the result Tokens
            for (size_t i=0;i<suggestList.GetCount();i++)
            {
                wxString element = suggestList[i];
                bool pass = false; // pass the test?
                for (TokenIdxSet::const_iterator it = result.begin();
                     it != result.end();
                     ++it)
                {
                    const Token* token = m_Parser.GetTokenTree()->at(*it);
                    if (!token || token->m_Name.IsEmpty())
                        continue;
                    if (element.IsSameAs(token->m_Name))
                    {
                        message = wxString::Format(_T("-PASS: %s  %s"),expression.wx_str(),element.wx_str());
                        testResult<<message<<wxT("\n");
                        wxLogMessage(message);
                        pass = true;
                        passCount++;
                    }

                }
                if (pass == false)
                {
                    message = wxString::Format(_T("*FAIL: %s  %s"),expression.wx_str(),element.wx_str());
                    testResult<<message<<wxT("\n");
                    wxLogMessage(message);
                    failCount++;
                }
            }
            // wxLogMessage(_T("Result have %lu matches"), static_cast<unsigned long>(result.size()));
        }
        else
            break; // if the line is not started with //, then we just stop testing
    }

    // report the test result here again in the last stage, further more, we can show this in another text control

    wxLogMessage(wxT("--------------------------------------------------------\nTotal %d tests, %d PASS, %d FAIL\n--------------------------------------------------------"), passCount+failCount, passCount, failCount);

    return true;
}

You see, the steps of NativeParserTest::TestParseAndCodeCompletion is:
1, clear the TokenTree
2, parse the file
3, run tests
4, report fail and pass results.

BTW: Here is the log message I see:
Code
000001. --------------M-a-i-n--L-o-g--------------


000002. -----------I-n-t-e-r-i-m--L-o-g-----------
********************************************************
  Testing in file: C:\DOCUME~1\zyh23\LOCALS~2\Temp\cc125.h
********************************************************
*FAIL:  vt[1].  GetInt
-PASS:  g_S.  i
-PASS:  g_  g_S
-PASS:  tc.Vo  Void
-PASS:  tc.St  StaticVoid
-PASS:  tc.GetC  GetClass
-PASS:  tc.GetI  GetInt
-PASS:  str.  size
-PASS:  str.  length
--------------------------------------------------------
Total 9 tests, 8 PASS, 1 FAIL
--------------------------------------------------------


Note that I remove CC_PARSER_TEST macro definition in rev9644 (see the bold text below), since it run our test much faster, in the future, we can run many tests in a single run(we can have many cc_xxxxx files which contains many kinds of tests, then our cctest project test them one by one)

Quote
SHA-1: 40c5a4c8323e26aad488c536d426d1ab34cc66a5

* * cctest: add a framework of codecompletion test, the details are listed in C::B forum topic (batch codecompletion test framework - http://forums.codeblocks.org/index.php/topic,17538.msg120196.html#msg120196)
1, remove the file cctest.h and cctest.cpp, because those standalone classes/functions were moved to NativeParserTest class (derived from NativeParserBase), so a lot of functions can be reused from NativeParserBase.
2, remove CC_PARSER_TEST definition to reduce parser log messages, only show codecompletion test result and the show fail and pass testing counts. If the user need to see the full parser log messages, they should define them, which will plot a log of log messages.
3, redirect the wxLogMessage to the text ctrl of the frame.
4, fix typo in comments, and add some comments.
5, project target setting change, make it a gui app instead of console app, and redirect the wxLogMessage to the wxTextCtrl.
6, set the default parsing file to testing/cc_function_decls.cpp, not the default test.h
7, add the wxsmith file to cbp, so it can be opened quickly from the project manager.
8, by default, Token tree structure is not logged, but it can be logged by click the "Print Tree" button.
9, add some string variable to the wx and gcc search path, avoid the hard-coded path.

git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@9644 2a5c6006-c6dd-42ca-98ab-0921f2732cef
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: no need to run m_NativeParser.Parse(m_CurrentFile) in cctest
« Reply #42 on: March 02, 2014, 03:45:04 pm »
BTW: Here is the log message I see:
Code
000001. --------------M-a-i-n--L-o-g--------------


000002. -----------I-n-t-e-r-i-m--L-o-g-----------
********************************************************
  Testing in file: C:\DOCUME~1\zyh23\LOCALS~2\Temp\cc125.h
********************************************************
*FAIL:  vt[1].  GetInt
-PASS:  g_S.  i
-PASS:  g_  g_S
-PASS:  tc.Vo  Void
-PASS:  tc.St  StaticVoid
-PASS:  tc.GetC  GetClass
-PASS:  tc.GetI  GetInt
-PASS:  str.  size
-PASS:  str.  length
--------------------------------------------------------
Total 9 tests, 8 PASS, 1 FAIL
--------------------------------------------------------
Yes, the verbose part of how the parser works is missing there, too. But thats the part (at least) I am usually interested.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: no need to run m_NativeParser.Parse(m_CurrentFile) in cctest
« Reply #43 on: March 02, 2014, 03:53:57 pm »
BTW: Here is the log message I see:
Code
000001. --------------M-a-i-n--L-o-g--------------


000002. -----------I-n-t-e-r-i-m--L-o-g-----------
********************************************************
  Testing in file: C:\DOCUME~1\zyh23\LOCALS~2\Temp\cc125.h
********************************************************
*FAIL:  vt[1].  GetInt
-PASS:  g_S.  i
-PASS:  g_  g_S
-PASS:  tc.Vo  Void
-PASS:  tc.St  StaticVoid
-PASS:  tc.GetC  GetClass
-PASS:  tc.GetI  GetInt
-PASS:  str.  size
-PASS:  str.  length
--------------------------------------------------------
Total 9 tests, 8 PASS, 1 FAIL
--------------------------------------------------------
Yes, the verbose part of how the parser works is missing there, too. But thats the part (at least) I am usually interested.
You can simply add the CC_PARSER_TEST, then every verbose log messages are returned, but parsing a file (specially have many #include files) will takes for a long time.  ;)
Maybe, we can add an option?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re:
« Reply #44 on: March 02, 2014, 07:25:59 pm »
Well the default case for me is that I have a small code snippet to reproduce a certain error. Then it will be very fast and the information is essential to track down parser errors. So yes, please make it an option which imho should be enabled by default.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re:
« Reply #45 on: June 19, 2014, 03:48:23 pm »
Well the default case for me is that I have a small code snippet to reproduce a certain error. Then it will be very fast and the information is essential to track down parser errors. So yes, please make it an option which imho should be enabled by default.
FYI:
I add  CC_PARSER_TEST back to the cbp in rev9816. It was not simple to add this as an option I think.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.