Author Topic: several issues with "open #include file ..."  (Read 18464 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5242
Re: several issues with "open #include file ..."
« Reply #30 on: November 27, 2005, 04:20:20 pm »
my simple solution suggestion is, don't return if no parser, search the parser includes only if there's a parser pointer.

And eventually (even in the case, there's no parser) we end up at the search in the same dir, which does not use a parser).

Lieven

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5242
Array
« Reply #31 on: November 30, 2005, 10:07:26 pm »
Yiannis,

Attached zip file contains the changed code files (checked against the latest svn version to see the changes).
This is what happened/changed

1) Changes to parser.h/cpp
 - no longer uses wxPathList, but again wxArrayString : to allow to return several hits, for the case the searched include files exists in several include directories --> a wxArrayString is returned with all this hits ; no hits => GetCount will return 0
 - const function
2) CodeCompletion.cpp
 - in case no parser, continue so we can still look in the same directory as the file were the open include was generated (see post above explaining the bug)
 - check the return set (found set) : if more then 1 hit -> show dialog box with the list that let's the user select the header file he actually wants, if 1 hit don't show dialog box, also don't show it if no hits and continue search (same directory)

3) new files :
 - SelectInclude.wxs/xrc -> wxSmith for creating the dialog
 - SelectInclude.h/cpp generated and implemented code for the dialog box, setting the hits, and selecting the 'use choicen' hit

4) nativeparser.cpp
 - add include path of all compilers (project compiler/ target compilers)
 - in case one of those is the gnu compiler, to the special trick to find out the other includes paths (internal ones of the gnu compiler -> so c++ header files can be found -> see also above post for more details)

That's it : this has solved the 3 bugs, it works on my installation.

5) action.jpg : snapshot of the dialog with the selections on the project attached in an above post (with gnu and digital mars compiler), when include open the cstdio from the source file codec.cpp.

kind regards,
Lieven


[attachment deleted by admin]