Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Code Completion failure
(1/1)
killerbot:
CC fails often, too often, but always hard to pinpoint/reproduce issues.
I think however I stumbled upon one.
CB was open with 1 project which had been parsed. Outside CB I created a new project and then dragged and dropped the cbp file into the Projects tab within CB ==> in the Code::Blocks log tab, no sign to be found that it would be parsed, guessing it was not parsed.
--- Code: ---NativeParser::CreateParser(): Finish creating a new parser for project 'Asio4-Dns'
NativeParser::OnParserEnd(): Project 'Asio4-Dns' parsing stage done!
Opening /home/killerbot/Projects/Boost/Asio/Asio5-Buffers/Project/Asio5-Buffers.cbp //<===== just load, no parsing
Done.
--- End code ---
Then I click right click on the project and choose "Reparse project" ==> again no parsing traces to be found in the CB log tab.
Then I closed the first project (in this case the Asio4) and then we see parsing happening on the Asio5. ==> new entries in the log :
--- Code: ---NativeParser::DeleteParser(): Deleting parser for project 'Asio4-Dns'!
NativeParser::CreateParser(): Finish creating a new parser for project 'Asio5-Buffers'
NativeParser::OnParserEnd(): Project 'Asio5-Buffers' parsing stage done!
--- End code ---
Note : clicking reparse project does show traces now in the log.
Extra info : Use one parser for the whole workspace
NOte : Concurrently parsing threads is on 1 (unable to change it, so what's the purpose ?)
Jenna:
Similar issues after enabling CC (if it was disabled formerly).
ollydbg:
If you set one parser for the workspace, it means only one parser instance will be created for all the projects, so in you case, I think no "new parser created log message" is by design, but the new added project should still be parsed, so this may be a bug. About the concurrent parthread number, because wxString is not thread safe, so this number is forsed to be one.
jens' reported bug is another bug, CC should start parse on already opened projects if it(the plugin itself) was enabled.
I will test you issue tomorrow morning, it is midnight here.
ollydbg:
--- Code: ---Index: nativeparser.cpp
===================================================================
--- nativeparser.cpp (revision 9094)
+++ nativeparser.cpp (working copy)
@@ -558,13 +558,15 @@
return nullptr;
}
- // Easy case for "one parser per workspace" that has already been created:
+ // In the case of "one parser per workspace", the project is not include in the common parser
+ // we need to insert it, in other cases, a new Parser instance is needed
+ ParserBase* parser;
if (m_ParserPerWorkspace && !m_ParsedProjects.empty())
- return m_ParserList.begin()->second;
+ parser = m_ParserList.begin()->second; // reuse the common parser
+ else
+ parser = new Parser(this, project); // create a new Parser instance
TRACE(_T("NativeParser::CreateParser(): Calling DoFullParsing()"));
-
- ParserBase* parser = new Parser(this, project);
if ( !DoFullParsing(project, parser) )
{
CCLogger::Get()->DebugLog(_T("NativeParser::CreateParser(): Full parsing failed!"));
--- End code ---
This patch should fix the problem reported by killerbot, please test and give some feedback.
The reason is: when you have a.cbp already opened, and in one_parser_for_whole_workspace mode, when you drag/drop another b.cbp, the CC did not run the "DoFullParsing" for the b.cbp but just return the common parser by "return m_ParserList.begin()->second;".
Navigation
[0] Message Index
Go to full version