Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

SourceSwitch 0.6 Released

Dave A
2012-09-18
2012-11-14
  • Dave A
    Dave A
    2012-09-18

    SourceSwitch 0.6

    Source Switch is a plugin for Notepad++ that allows an easy switch between project source and header files.

    - Switch between header and source files using a keyboard shortcut.
    - Open header files directly from the source file, rather than performing a switch.
       For example:

    #include "header.h"
            #include "inc_header.h"
    include ("../file1.php");

    etc

       Simply place the cursor on the desired line and hit the shortcut key (default F10).
    The code then attempts to work out what header you're looking for, and opens it. You
    can also select the header name directly within Notepad++ and hit the shortcut key to
    open the header. Doing this bypasses the header parsing code.

    - Supports additional user specified include directories outwith project directory.

    Changes in this release:

    - Added support for specifying additional directories to be searched during file switch (Thanks zaytsev1981 for the feature request).
       For example:

    SourcePath=C:\my_directory

    - Added support for reloading the configuration from within Notepad++.

    - Added full paths for files displayed in multiple files window.

    - Added DLL version information to SourceSwitch (Thanks davegb3 for the great blog post, I learned a few things)

    Project page - https://sourceforge.net/projects/sourceswitch/

    Please post on my project page if you find any issues, or if you have any feature requests. Latest version is currently on SourceForge, but I'm updating Plugin Manager now, so it should show up there soon.

    MD5: 20f967490a3b5682544568cfd0093e48 (For DLL file)

    Cheers,
    Dave

     
  • Zaytsev Artem
    Zaytsev Artem
    2012-11-01

    Thanks a lot but I have some problems.

    Can't understand, what I'm doing wrong.
    I've written these strings in "SourceSwitch.ini":

    SourcePath=c:\Program Files\CodeGear\RAD Studio\6.0\include
    But when I press F10 for #include "winnt.h" or #include <winnt.h> (this file really exists in my "..\6.0\include" path) — it doesn't work.
    By "doesn't work" I mean that I get the message "Header file not found".

    Also there are such problems, which existed also for plugin version 0.5:
    1)
    F10 works fine for #include "SomeFolder/SomeFile.h".
    But not for #include "SomeFolder\SomeFile.h".
    2)

    include ("../file1.php");

    F10 for #include "..\SomeFile.h" or #include "..\SomeFolder\SomeFile.h" or #include "../SomeFile.h" also doesn't work.

    Maybe these are not a bugs but just a features?

    JIC, here is my whole "SourceSwitch.ini" file:

    topLevel=

    SourcePath=c:\Program Files\CodeGear\RAD Studio\6.0\include

     
  • Dave A
    Dave A
    2012-11-08

    Hi zaytxev1981,

    Sorry for the late reply, for some reason I didn't get an email notification that you had replied. Let me try and recreate the issue using your report above and I'll try and see whats going on.

    I'll try and get it fixed asap.

    Cheers,
    ViZioN

     
  • Dave A
    Dave A
    2012-11-10

    Hi zaytsev1981,

    Both of these issues are now resolved. I need to do some further testing but I'm hoping I can get a new version released tomorrow.

    Cheers,
    ViZIoN

     
  • Dave A
    Dave A
    2012-11-11

    Hi zaytsev1981,

    I've now updated SourceSwitch to 0.7.

    You can download the new version from:

    http://downloads.sourceforge.net/project/sourceswitch/SourceSwitch/bin/SourceSwitch_0.7.zip

    I've also updated the plugin version via Plugin Manager, but that change won't go live until davegb3 updates the XML that plugin uses.

    Hopefully this fixes the issues you've been having. Any other issues, let me know.

    Cheers,
    ViZioN

     
  • Zaytsev Artem
    Zaytsev Artem
    2012-11-11

    Hi! Thank you very much! SourcePath and backslash symbols processing are functioning great in this version.
    But there are still some problems.
    1) like I said in the 2nd clause of my previous message: #include "..\OtherDir\Otherfile.h" or #include "../OtherDir/OtherFile.h" still doesn't work.
    2) #include "File" - doesn't work. I mean that the file has not extension, but it is a c++ header file. For example the base STL files (like "vector" or "algorithm") in my version of library have not extensions.
    3) If the module found a file with the same name in current dir and in the "SourcePath" dir, it shows a message box "Choose file…" with a choosing opportunity. This is a good idea, but:
    3.1) Somehow the window has not keyboard input focus initially: I have to use my mouse.
    3.2) Just an advice,which could be usefull: what if add in the ini-file a parameter "SameFileNamesAction" (or any other name), which could have these values: a) SameFileNamesAction=SourceFile - the current directory file is opened. b) SameFileNamesAction=DirFile - the "SourcePath" directory file is opened. c) SameFileNamesAction=Choose - user chooses the file by himself (the "Choose file" window).
    4) If I call "About" window or make the window "Choose file" to become visible and then I press "Esc" (I don't remember if this is my own "Notepad++" key mapping or native shortcut for Exit command), - logically it is intended only to close the message window but in reality Notepad totally exits. I checked out other plugins to compare - they don't have such problem.
    5) This is only a question (I don't need this for now, just curious): Is there a possibility to set more than one source path in ini-file (as the section is called ""), or only the one. I tried to add another path just for a test (I tried "SourcePath" and "SourcePath2" parameter names), and it didn't work.

    Sorry to bother you with my annoying complaints.

     
  • Zaytsev Artem
    Zaytsev Artem
    2012-11-11

    Oops.
    3.2)
    b) SameFileNamesAction=SourcePath - I guess this variant sounds more logical.
    And some other algorithm branch appeared in my brain.
    d) NearestPath=on/off - if the same files exist in "SomePath" directory and in "SomePath\SomeElseDirectory" directory, and the parameter state = "on" - then the nearest directory ("SomePath") is chosen. Otherwise (if the parameter state = "off") the "Choose file" window is appearing.
    If the same file exists in "SomePath\SomeElseDirectoryA" and in "SomePath\SomeElseDirectoryB" - then "SourcePath\SomeElseDirectoryA" is chosen because it's the nearest by alphabet.

    Not so important. Like I said, 3.2) - is just a suggestion.
    In addition maybe my variant of algorithm is not very well thought-out.
    If you will ever add multiple source paths possibility, then the algorithm could become more complicated, because there will be an undefined situation - which one of the source paths to choose.

     
  • Dave A
    Dave A
    2012-11-11

    Hi zaytsev1981,

    They're not annoying at all. I want to try and fix any issues that are found and add some new useful functionality. It's nice to know that the plugin is useful to you in some aspect.

    Thanks for the constructive comments, I'll have a look at them soon.

     
  • Dave A
    Dave A
    2012-11-11

    5) This is only a question (I don't need this for now, just curious): Is there a possibility to set more than one source path in ini-file (as the section is called ""), or only the one. I tried to add another path just for a test (I tried "SourcePath" and "SourcePath2" parameter names), and it didn't work.

    Yes you can add more than one source path, but it uses the same name, it doesn't have an increment at the end. So for example, my ini file looks like this:

    topLevel=R:\Backup\SourceSwitchTests\Test 1

    SourcePath=C:\test
    SourcePath=C:\Program Files\CodeGear\RAD Studio\6.0\include
    SourcePath=C:\cygwin\home\vizion\testdir

     
  • Zaytsev Artem
    Zaytsev Artem
    2012-11-11

    I realized what was the problem.
    When I edit "SourceSwitch.ini" with Notepad++, I add a new SourcePath=c:\Test, then press "Save". I open the file with a text viewer and I see that the new string exists. But when I close Notepad++ - the string disappears, because your plugin saves an old ini-file state on unload. I must first "Reload configuration" to make the new state to be properly saved. I understand all the logic, but the situation is a little funny and confusing if you don't know the real reason.

     
  • Zaytsev Artem
    Zaytsev Artem
    2012-11-11

    By the way, what does the "" section mean?

     
  • Dave A
    Dave A
    2012-11-13

    By the way, what does the "" section mean?

    It was a piece of functionality I added for 0.5 where you 'default' to switching to a particular extension. It's not that useful for that many file types but it was intended to help switching between say a .h, and a .c or .cpp.

    I removed it in 0.6 though as it wasn't really that useful.

    I've made a few changes to address some of your comments but I'm pretty busy at work right now, so I'll work on it when I can.