NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
NativeParser::DoFullParsing(): Adding cpp/c files to batch-parser
NativeParser::DoFullParsing(): Added 1 source file(s) for project 'cb_module' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'cb_module'
NativeParser::OnParserStart(): Starting batch parsing for project 'cb_module'...
NativeParser::OnParserEnd(): Project 'cb_module' parsing stage done!
Project 'cb_module' parsing stage done (9748 total parsed files, 272 tokens in 0 minute(s), 0.196 seconds).
NativeParser::DeleteParser(): Deleting parser for project 'cb_module'!
NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
NativeParser::DoFullParsing(): Adding cpp/c files to batch-parser
NativeParser::DoFullParsing(): Added 1 source file(s) for project 'cb_module' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'cb_module'
NativeParser::OnParserStart(): Starting batch parsing for project 'cb_module'...
NativeParser::OnParserEnd(): Project 'cb_module' parsing stage done!
Project 'cb_module' parsing stage done (9748 total parsed files, 272 tokens in 0 minute(s), 0.177 seconds).
NativeParser::OnParserStart(): Starting add file parsing for project 'cb_module'...
... Lots of :
ReadVarNames() : Unexpected token '((packed))' for 'v4l2_event_vsync', file '/usr/src/linux-headers-4.4.0-130/include/uapi/linux/videodev2.h', line 2046.
ReadVarNames() : Unexpected token '((packed))' for 'v4l2_dbg_match', file '/usr/src/linux-headers-4.4.0-130/include/uapi/linux/videodev2.h', line 2143.
ReadVarNames() : Unexpected token '((packed))' for 'v4l2_dbg_register', file '/usr/src/linux-headers-4.4.0-130/include/uapi/linux/videodev2.h', line 2150.
ReadVarNames() : Unexpected token '((packed))' for 'v4l2_dbg_chip_info', file '/usr/src/linux-headers-4.4.0-130/include/uapi/linux/videodev2.h', line 2161.
...
Project 'cb_module' parsing stage done (9935 total parsed files, 494443 tokens in 0 minute(s), 34.161 seconds).
Reparsing when typing for editor /home/jl/Modules/cb_module/mod1.c
NativeParser::OnParserStart(): Starting re-parsing for project 'cb_module'...
Project 'cb_module' parsing stage done (9935 total parsed files, 494444 tokens in 0 minute(s), 0.005 seconds).
NativeParser::DeleteParser(): Deleting parser for project 'cb_module'!
NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
NativeParser::DoFullParsing(): Adding cpp/c files to batch-parser
NativeParser::DoFullParsing(): Added 1 source file(s) for project 'cb_module' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'cb_module'
NativeParser::OnParserStart(): Starting batch parsing for project 'cb_module'...
NativeParser::OnParserEnd(): Project 'cb_module' parsing stage done!
Project 'cb_module' parsing stage done (9748 total parsed files, 272 tokens in 0 minute(s), 0.150 seconds).
if ((ft == ParserCommon::ftSource) || (ft==ParserCommon::ftHeader)) // parse source files and Headers Files
NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
Is there a raison why .h are not parsed on project load or project reparse (but parsed when added to the project ?).
#include "a.h"
#include "b.h"
...
#include "a.h"
#include "b.h"
...
The reason (probably) is that C/C++ are based on translation units and header files are not translation unit.Ok, but are they parsed when files are added to project.
Are those headers you need parsed included in some .c file?Not directly, but project builds ok. So they are found by some way, it's mystery for me ;o)
I doubt this is the correct solution. A header file has meaning only when it is included in a .c/cpp file.Probaly not, but i try to undestrand ;o)
NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
a.c
b.c
a.h
b.h
c.h
3, Please note there is an option named "Enable headers code-completion", which means when user hit the "<" after he typed the "#include", the header file names will be prompted for auto suggestion. This is not the same thing was we discussed in this thread. ;)OK I was totally wrong ! I use this option to implement header parsing ... sorry, i have to revert now !
1, It looks like you forgot to add the file changes of "plugins\codecompletion\resources\settings.xrc" in the patch?It is not modified, reason above.
2, About how the add the files to the batch parser(the thread pool), which will parse the files in FIFO(first in first out) mode as they added.OK, it's the right way. I'll try find where and then I'll propose another patch.
Is the option useful? Is it really annoying to parse the header files that have been added to the project?I still think that you're solving the wrong problem.
Your problem is that a header is not parsed because it is included behind some complex macro logic which our parser doesn't understand or something similar.
Hello,First, this reply comes a little late, I understand what this patch try to solve, thanks!
So, here's a new version of the patch.
An option has been added to "settings -> editor -> code completion -> C/C+++ Parser"
This time, "settings.xrc" is well handled in the patch.
If "Parse headers" is selected, the project header files are added at the end of the list of files to be parsed.
Otherwise, we find the old behavior.
Is the option useful? Is it really annoying to parse the header files that have been added to the project?
Returns are welcome.
Have a good day.
Translated with www.DeepL.com/Translator
Ouille.
...This is true, and I think this may cause some problems as your said. I remember we have such behaviour in our CC, and later, we just parse the translation files, and only follow the "#include" statement, so that only header files included in a cpp files or other parsed header files will be parsed.
However, there is still a slight inconsistency, since these headers files are parsed when they are added to the project.