The Snippy Reflector add-in

Those of you who’ve read C# in Depth will know about Snippy – a little tool which makes it easy to build complete programs from small snippets of code.

I’m delighted to say that reader Jason Haley has taken the source code for Snippy and built an add-in for Reflector. This will make it much simpler to answer questions like this one about struct initialization, where you really want to the IL generated for a snippet. Here’s a screenshot to show what it does:

This is really cool – if you want to dabble to see what the C# compiler does in particular situations, check it out. It comes as just the DLL, or a zipped version. Thanks for putting in all this work, Jason 🙂

Update: Jason now has his own (more detailed) blog entry too.

7 thoughts on “The Snippy Reflector add-in

  1. Nice. I’m going to try this out now.

    BTW how did you take a screenshot and get the border shadow alpha to come through? Does that happen by default in Vista? Unfortunately I’m at work on XP right now and can’t try it out.

  2. Hi Jon!

    This is an excellent idea. So much so that I’m thinking of adding this feature to LINQPad! LINQPad already has a built-in disassembler, so you can right now do this:

    Guid g = new Guid();

    From here, adding an “IL” tab and writing a lexical parser for syntax coloring should be trivial. What do you think?

    Tell us how it’s going in London with Google!


  3. Aaron: Quite possibly nothing. Bear in mind that they were developed at the same time, while their respective books were being written.

    I haven’t used LINQPad enough to know what it’s capable of and what it’s not capable of.

  4. Jon – Fair enough, I’m not really familiar with your book (I’m another SO drag in :P) and have been a LINQPad user for a long time. I guess the main difference between them is that LINQPad is geared to doing LINQ to SQL snippets without making your own DBML.

    I might have to check out snippy

Comments are closed.