SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

ILSpy Visual Studio Plugin / Add-In - SourceFly

Last post 05-01-2012 2:22 AM by cateyes. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-22-2011 7:30 PM

    • EricCarr
    • Not Ranked
    • Joined on 05-23-2011
    • Minnesota, USA
    • Posts 4

    ILSpy Visual Studio Plugin / Add-In - SourceFly

    Hello everyone,

    First off, to the ILSpy team - great job on ILSpy! I've been following it for a while now and it just keeps getting better.

    Over the past few months (as time allows) I have been working on an add-in for Visual Studio (2005, 2008, and 2010), mostly out of personal need. It's currently named "SourceFly."

    Its use is simple:

    When the cursor is over a class, property, or method and you press a hot key, SourceFly will determine the correct assembly and fully qualified type/signature and open ILSpy to that object.


    It's not 100% complete but it works for most cases. I think it's at a state where others could benefit from it and report feedback.

    I have created a MSI installer that does the following:

    • Installs the SourceFly Add-In for Visual Studio 2005, 2008, and 2010 in a folder of your choice.
    • Copies patched ILSpy v1.0 files into a sub-folder*.
    • Optionally adds windows shell integration for ILSpy (right click on a .dll or .exe and open in ILSpy).

    Check it out and let me know what you think!

    Installer: http://public.carr-designs.com/releases/SourceFlySetup.msi

    Thanks,
    Eric

    EDIT: *I patched ILSpy to auto expand loading of single assemblies, for use with shell integration. You can view the patch code here: http://github.com/icsharpcode/ILSpy/issues/266

    Filed under:
  • 08-23-2011 6:02 PM In reply to

    • dennyr
    • Not Ranked
    • Joined on 08-23-2011
    • Posts 1

    Re: ILSpy Visual Studio Plugin / Add-In - SourceFly

    I'd like to try it out.  Let me know where to get it, and I'll give it a whirl.  This sounds like a really great way to get back the functionality of .Net Reflector's integration.  (stupid redgate).

    -Denny

  • 08-25-2011 10:26 PM In reply to

    • EricCarr
    • Not Ranked
    • Joined on 05-23-2011
    • Minnesota, USA
    • Posts 4

    Re: ILSpy Visual Studio Plugin / Add-In - SourceFly

    Hi Denny,

    I've updated my initial post with a link to the installer.

    Let me know if you have any questions or issues. Thanks for testing it out!

     

    Eric

  • 09-02-2011 11:45 AM In reply to

    Re: ILSpy Visual Studio Plugin / Add-In - SourceFly

    Hello Eric

    You should release the plugin as open source on GitHub or similar. It works great! Thanks :)

    One suggestion: Maybe you should add a right click context menu in the code editor instead of just the "Tools -> Browse source" button.

    /Andreas

  • 10-26-2011 6:45 AM In reply to

    • daughtkom
    • Not Ranked
    • Joined on 04-22-2011
    • Milwaukee
    • Posts 3

    Re: ILSpy Visual Studio Plugin / Add-In - SourceFly

    This is just what I was looking for.

    Two suggestions:

    • Simple and low priority: instead of Browse Source, perhaps something like "Browse with ILSpy" so it's more clear
    • Please consider a config file (or Tools -> Options seteting) where I can specify the path to ILSpy.  Your addition to automatically navigate to an assembly is slick, but if ILSpy receives a significant update, and your forked version does not, then I can't use it.  Perhaps an alternative (making this up as I type) is to have your splash wrapper /navigateTo the first Type found in the specified assembly?  It's not the same as just highlighting the assembly node as you have done, but highlighting something at the top of that node's subtree is pretty close.  Plus it will allow your users to continue to use the official ILSpy distribution.  Ideally, ILSpy source would add navigateTo options for (A)ssembly and (N)amespace in addition to the ones it already has.
    You mentioned that this isn't 100% complete.  Do you have plans to implement other features?
    Thanks for saving me the work of having to write this for myself.

     

  • 10-26-2011 10:46 AM In reply to

    Re: ILSpy Visual Studio Plugin / Add-In - SourceFly

    Navigate to namespace is already implemented on the ILSpy master branch. (/navigateTo:N:...)

    Calling "ILSpy.exe SomeAssembly.dll" without any /navigateTo argument will navigate to the assembly node once I get around to implementing that.

  • 10-26-2011 4:55 PM In reply to

    • EricCarr
    • Not Ranked
    • Joined on 05-23-2011
    • Minnesota, USA
    • Posts 4

    Re: ILSpy Visual Studio Plugin / Add-In - SourceFly

    Thanks for the suggestions! 

    I was thinking of keeping things generic with "Browse Source" since, in theory, my plugin can be used to call any program that navigates assemblies. In practice, the only program is ILSpy, so I'll change it to "Browse with ILSpy" like you suggested.

    Regarding the path to ILSpy, I was thinking of having the user choose the path to ILSpy during installation. This path would be stored in the registry or a config file like you mentioned.

    The forked version is temporary until the official distro includes this feature. However, if someone has a newer version of ILSpy, nothing will break - it just will not auto navigate to that node when opening. I am not calling ILSpy with non standard parameters.

    By "not 100% complete" I mean there are some outstanding issues in parsing the code and determining correct assemblies:

    1. In some instances of code I am not correctly determining the type. So, you may come across some code where ILSpy says the type cannot be found. For example, I am parsing Method(int param1, int param2) but if there is a Method(int param1, out int param2) I may not have coded how to handle the "out" yet.

    2. Different versions of Visual Studio, in different types of projects (web, assembly, winforms, silverlight, etc) allow me to determine the correct assembly to load to varying degrees of success. This still needs work.

    Eric

  • 10-26-2011 4:58 PM In reply to

    • EricCarr
    • Not Ranked
    • Joined on 05-23-2011
    • Minnesota, USA
    • Posts 4

    Re: ILSpy Visual Studio Plugin / Add-In - SourceFly

    DanielGrunwald:

     

    Calling "ILSpy.exe SomeAssembly.dll" without any /navigateTo argument will navigate to the assembly node once I get around to implementing that.

    Daniel, I posted the code I used to accomplish this at http://github.com/icsharpcode/ILSpy/issues/266 .

    It's about 5 lines of code. Feel free to use it..

    Eric

  • 05-01-2012 2:22 AM In reply to

    Re: ILSpy Visual Studio Plugin / Add-In - SourceFly

    Thanks for this. Does it work for the latest ILSpy 2? :)

Page 1 of 1 (9 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.