#7 Add multiple top levels support

open
nobody
None
5
2013-09-24
2013-09-05
No

Can you add support for multiple top level folders? This is especially useful if you commonly pass many folders to gcc as the top level (http://gcc.gnu.org/onlinedocs/gccint/Top-Level.html).

Discussion

  • Dave A

    Dave A - 2013-09-08

    Hi Joshua,

    Thanks for the feature request. Can you indicate how you might see this feature working?

    I'm thinking something along the lines of a menu option called 'Manage Top Level Directories'. Within that you could add/edit/delete entries, as well as selecting the active top level directory.

    Would this be useful to you?

    Dave

     
  • Joshua Holland

    Joshua Holland - 2013-09-24

    Hi Dave,

    Sorry about the late response. The solution you proposed is quite what I was expecting. Sometimes I include files and reference them based on the way I configure my top level folders in gcc. For instance, I may have two directory structures like so:

    -GameImplementation
     -trunk
      -source
       -folder
        -header1.h
    -GameEngine
     -trunk
      -source
       -uniquefolder
        -uniqueheader.h
    

    In header1.h, I can do #include "uniquefolder/uniquefolder.h" and it will include the GameEngine header file indicated above, as long as I configure gcc to also treat \GameEngine\trunk\source as an addition top level directory.

    I work with a lot of situations like this, so I was hoping that if I tried to do an open include file from header1.h, it would find uniqueheader.h. I envisioned this happening by setting two top level directories: \GameImplementation\trunk\source;\GameEngine\trunk\source\

    Thanks,
    Joshua

     
  • Dave A

    Dave A - 2013-09-24

    Hi Joshua,

    No problem. I understand what you're trying to accomplish now and you should be able to do this using the 'SourcePaths' feature. It's my fault for being lax with documentation. Basically, the additional SourcePath directories will be searched in the event that the 'Open included file' functionality doesn't find the file within the top level directory tree.

    I set up my directory structure as follows:

        -Joshua 
         -GameImplementation
          -trunk
           -source
            -folder
             -header1.h
         -GameEngine
          -trunk
           -source
            -uniquefolder
             -uniqueheader.h
    

    I then set my top level directory as C:\Joshua\GameImplementation and added the GameEngine as an additional source directory so that my configuration looks like the following:

    [TopLevel]
    topLevel=C:\Joshua\GameImplementation
    [DefaultSwitch]
    [SourcePaths]
    SourcePath=C:\Joshua\GameEngine
    

    The SourcePath settings have to be added manually, as there's no explicit menu option to do this. You'll also need to manually reload the SourceSwitch configuration (Plugins->SourceSwitch->Reload configuration) or restart Notepad++ for the additional SourcePaths to be read.

    My header1.h and uniqueheader.h look like this:

    header1.h

    /*
     * Header 1
     */
    
    #include "uniquefolder/uniqueheader.h" 
    

    uniqueheader.h

    /*
     * My Unique header.
     */
    
    #include "header1.h"
    

    From within header.h, if I place the cursor on the #include line, selecting 'Open included file' (or whatever short cut key is set up), this opens uniqueheader.h. Conversely I can do the same with header1.h from within uniqueheader.h

    Hopefully this helps solve the issue you're having. If this isn't clear, or this still doesn't do what you're looking for, let me know.

    Cheers,
    Dave

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks