Author Topic: How to add additional search paths to code completion parser with wizard  (Read 3350 times)

Offline riban

  • Multiple posting newcomer
  • *
  • Posts: 26
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to add additional search paths to code completion parser with wizard
« Reply #1 on: December 16, 2017, 02:41:43 am »
You could probably use the void cbProject::AddToExtensions(const wxString& stringDesc) method.
(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 riban

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: How to add additional search paths to code completion parser with wizard
« Reply #2 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" />).

Offline riban

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: How to add additional search paths to code completion parser with wizard
« Reply #3 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?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to add additional search paths to code completion parser with wizard
« Reply #4 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....

Offline riban

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: How to add additional search paths to code completion parser with wizard
« Reply #5 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).