Menu

#692 Intellisense not working unless include paths provided plus CB slash auto-conversion in paths

Undefined
open
nobody
Bug_Report
2018-08-11
2018-05-13
Jannick
No

Windows10/nightly build svn 11400:

The extremely helpful intellisense feature does not work out of the box, i.e. CB seems not to be able to search for symbols in the header files of the chosen compiler without additional config work. It does not work either if the header search paths are saved with backslashes in the following dialogues:

  1. global compiler settings, i.e. settings > compilers > (select compiler) > search directories > compiler.
  2. the project or target settings, i.e. Project > build options > (select project or a target) > search directories > compiler

In both cases:

  • if the path is manually entered with forward slashes, CB tacitly converts them to backslashes after config is saved and the intellisense information are not available in the IDE any more
  • when picked from the path find dialog the path is provided with backslahes. Hence the user is left a little bit in the dark that the default path convention should make the configuration work.

Current work around to prevent CB to convert slashes to backslashes in the file paths, but required for each configured compiler:

  • define paths as global variable (with forward slashes).
  • define the compiler search directories in the project settings in terms of the global variables. NOTE: This does not work if the include path is entered as global variable in the global compiler settings.

Potentially linked to this issue:

Feature requests:

  • determine include path from compiler (exe) information => no additional config needed for intellisense
  • prevent CB to convert (back)slashes in (include) paths with detremental effect
  • use appropriate path convention (slashes or backslashes) when paths are chosen in the path pick dialogue
  • make use of global variables in global compiler settings (here: include paths) effective

Apologies for the lengthy posting, but I wanted to get the messages across in any event. Thanks.

Discussion

  • Teodor Petrov

    Teodor Petrov - 2018-05-14

    Can you post the compiler and its version you're using?
    Can you post the exact steps needed to reproduce the problem?

     
  • Jannick

    Jannick - 2018-05-14

    Compiler: i686-w64-mingw32-gcc/g++ (GCC) 6.4.0 (latest shipped by cygwin).
    NB: I am not sure if there is a path separator confusion between Windows and Cygwin, but I don't know anything as to how the include paths are retrieved from the compiler exe.

    Steps to reproduce (cf. pics attached):

    1. Configure i686-w64-mingw32-gcc/g++ as default compiler (cf. attached pic 1). If nothing else is configured, no symbol is intellisensed, and no symbol defined by the compiler's system headers, in particular.

    2. If the path to the compiler c system headers is entered as global variable (with forward slashes, cf. pic 2 + 3) in the project config, then the symbols of the c headers are intellisensed. c++ symbols are not intellisensed.

    Please see config variations in the first posting.

    Here two questions from my side:

    • Is it fair to say that CB automatically converts forward slashs in paths entered into the compiler config dialogue and and into the project config to backslashs once it regularly checks them?
    • Should I expect symbols incl. preprocessor #defines to be displayed in the sub-frame 'FSymbols'? This is list empty, whereas in previous CB versions (I cannot remember which one) the symbols (incl. structure information) were displayed and could be searched.
     
  • Teodor Petrov

    Teodor Petrov - 2018-05-14

    Oh, you're talking about cygwin...
    If you can reproduce it with some of the mingw compilers I can take a look...

     
  • ollydbg

    ollydbg - 2018-08-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -7,7 +7,7 @@
    
     In both cases:
    
    - *   if the path is manually entered with forward slashes, CB tacitly converts them to backslashes after config is safed and the intellisense information are not available in the IDE any more 
    + *   if the path is manually entered with forward slashes, CB tacitly converts them to backslashes after config is saved and the intellisense information are not available in the IDE any more 
      *   when picked from the path find dialog the path is provided with backslahes. Hence the user is left a little bit in the dark that the default path convention should make the configuration work.
    
     **Current work around** to prevent CB to convert slashes to backslashes in the file paths, but required for *each*   configured compiler:
    
     
  • ollydbg

    ollydbg - 2018-08-11
    • labels: --> CodeCompletion
     
  • ollydbg

    ollydbg - 2018-08-11

    The extremely helpful intellisense feature does not work out of the box, i.e. CB seems not to be able to search for symbols in the header files of the chosen compiler without additional config work.

    Normally, the CodeCompletion plugin(CC) will run the "gcc -E" command to fetch all the default search include paths in your specified compiler, you don't need to manually config those paths. But in your case of using cygwin gcc, it looks like CC failed to fetch the search include paths.

    EDIT:
    This is your already mentioned feature request:

    determine include path from compiler (exe) information => no additional config needed for intellisense

     

    Last edit: ollydbg 2018-08-11
  • ollydbg

    ollydbg - 2018-08-11

    Should I expect symbols incl. preprocessor #defines to be displayed in the sub-frame 'FSymbols'? This is list empty, whereas in previous CB versions (I cannot remember which one) the symbols (incl. structure information) were displayed and could be searched.

    I think the "FSymbols" is wrong, this is for "Fortran code completion plugin". The native c++ symbol browser could show the #defines, can you give a simple example?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.