Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: riban on December 16, 2017, 12:18:27 am

Title: How to add additional search paths to code completion parser with wizard
Post by: riban on December 16, 2017, 12:18:27 am
I am writing a new project wizard to create a C++ project for the Sming (ESP8266) framework. I would like to add search paths to the project properties C/C++ parser options so that auto complete works for the Sming library functions. I see that this is stored in the <Project><Extensions><code_completion> section of the project file but I cannot figure out how to add paths using wizard scripting.

I have this working using the simple template method but that is not as user friendly, hence my desire to use a wizard.
Title: Re: How to add additional search paths to code completion parser with wizard
Post by: oBFusCATed on December 16, 2017, 02:41:43 am
You could probably use the void cbProject::AddToExtensions(const wxString& stringDesc) method.
Title: Re: How to add additional search paths to code completion parser with wizard
Post by: riban on December 16, 2017, 10:29:18 am
I cannot find any description of what syntax the argument should be for AddToExtensions(wxString). I would need to pass the extension (code_completion) and the data which in the project file is an XML tag with attribute, e.g. <search_path add="my_include_path" />).
Title: Re: How to add additional search paths to code completion parser with wizard
Post by: riban on December 16, 2017, 11:03:01 am
I have found this in the source code of cbproject.cpp:
Code
// sample stringDesc:
// node/+subnode/subsubnode:attr=val

So I have tried adding this to my wizard:
Code
project.AddToExtensions(_T("code_completion/+search_path:add=include_path"));

But this does not work. Any clues?
Title: Re: How to add additional search paths to code completion parser with wizard
Post by: BlueHazzard on December 16, 2017, 11:51:56 am
Look here, maybe you hit the limitations described here:
https://sourceforge.net/p/codeblocks/tickets/513/

I will look into this later....
Title: Re: How to add additional search paths to code completion parser with wizard
Post by: riban on December 17, 2017, 10:06:28 am
I have added a ticket #584 for this to the issue tracking system. Looking at the source code I can't figure out why this isn't working in 16.01 and latest nightly (on Windows 7).