Author Topic: codecompletion parser stops parsing  (Read 11830 times)

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: codecompletion parser stops parsing
« Reply #15 on: November 23, 2012, 12:57:32 pm »
I have changed my message.

Martin

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: codecompletion parser stops parsing
« Reply #16 on: November 23, 2012, 01:30:55 pm »
I have changed my message.
Did it work after the adjustment I proposed?
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 Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: codecompletion parser stops parsing
« Reply #17 on: November 23, 2012, 03:01:16 pm »

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: codecompletion parser stops parsing
« Reply #18 on: November 26, 2012, 03:00:04 pm »
I have another example attached.

One Workspace, two projects. Both projects are sharing the source file "together.cpp".

Start Code::Blocks, activate the log tab "Code::Blocks".
Open the workspace "ccproblem.workspace".

The logpane shows:
Opening C:\codeblocks\ccproblem\project1.cbp
Done.
Opening C:\codeblocks\ccproblem\project2.cbp
Done.
Create new parser for project 'project1'
Project 'project1' parsing stage done!

expand all Workspace nodes by clicking at the plus signs.
Now open project1s file together.cpp by double clicking at "together.cpp". The editor opens the source file. A look at the symbols browser shows the global functions "project1" and "together".
Now open together.cpp in project2, only by double clicking at the filename. The editor window don't change and even the symbol browser don't change. It still displays "project1" and "together" as available functions.

OK, another try:
open the file "project1.cpp". The editor shows this file and the symbol bwrowser shows "project1" and "together"
open the file "project2.cpp" and now something happens in the codeblocks log pane: The parser starts to parse project2. The symbol browser showas "project2" and "together" as available function.

Do you see the difference in the behaivour of the cc parser? It ignores the project when it decides if and when to parse something. Maybe this is a projectmanager problem (there is a function "GetProjectFromFile" or so, and this function can't handle this situation).

Any ideas on this?

Martin

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: codecompletion parser stops parsing
« Reply #19 on: November 26, 2012, 03:32:38 pm »
I have another example attached.

One Workspace, two projects. Both projects are sharing the source file "together.cpp".

Start Code::Blocks, activate the log tab "Code::Blocks".
Open the workspace "ccproblem.workspace".

The logpane shows:
Opening C:\codeblocks\ccproblem\project1.cbp
Done.
Opening C:\codeblocks\ccproblem\project2.cbp
Done.
Create new parser for project 'project1'
Project 'project1' parsing stage done!

expand all Workspace nodes by clicking at the plus signs.
Now open project1s file together.cpp by double clicking at "together.cpp". The editor opens the source file. A look at the symbols browser shows the global functions "project1" and "together".
Now open together.cpp in project2, only by double clicking at the filename. The editor window don't change and even the symbol browser don't change. It still displays "project1" and "together" as available functions.

To here, I can't see any issue.

Quote
OK, another try:
open the file "project1.cpp". The editor shows this file and the symbol bwrowser shows "project1" and "together"
This is the correct behavior, cc create a parser for "project1".

Quote
open the file "project2.cpp" and now something happens in the codeblocks log pane: The parser starts to parse project2. The symbol browser showas "project2" and "together" as available function.
If you CC setting "max allowed parsers" number >=2, and CC detect that a file belong to another C::B project is opened, so it will create another parser for "project2", this is also correct behavior.

Quote
Do you see the difference in the behavior of the cc parser?
Yes, but I don't think cc has some problems in those steps.
Quote
It ignores the project when it decides if and when to parse something.
What does this sentence means? I can't understand this.
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 Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: codecompletion parser stops parsing
« Reply #20 on: November 26, 2012, 04:15:06 pm »
I have tried to explain it so easy as possible. But it seem to me, that it doesn't explain the problem.

Think a step further: The same constellation, but "together.cpp" includes (for example) windows.h and uses struct _finddata_t. In the next step, project1 uses the Visual C++ 6.0 compiler and project2 uses MSVC2010. both compiler have their own sdk include files and the definition of "struct _finddata_t" has changed a lot. To which definition will me point code completion when it only parses together.cpp for one project?
I use "one parser per project" and the maximum number of allowed parser is set to 25.

Martin