Поделиться через


Microsoft Code Snippet Designer – Alpha Release

Wow—looks like I'm going to keep going on the "lazy" theme that I've started over the past few weeks, when I blogged about the availability of my team's Power Toy Pack Installer and Resource Refactoring tools. Everyone wants to be able to write code more quickly, and we all know that from app to app, you end up using lots of the same code again and again. How you rewrite that code again and again differs from person to person—maybe you save it in a text file on your desktop, or you go back into the old code file and copy and paste it in, or (gasp) you rewrite the code from scratch. You might even know that Visual Studio supports "Code Snippets", and you might even know how to use the ones that are built in (CTRL+K, CTRL+X is the keyboard shortcut), but adding your own snippets—well, that's a slight challenge.

That because in Visual Studio currently, without the aid of an external tool such as Snippy, to edit or create a code snippet, you need to go in and modify an XML file. Charlie Calvert recently wrote a great blog article on how to do this, but let's face it, that's a lot of work for those of us who are just looking at being nice and lazy! J

Well, lazy .NET developers of the world, the Power Toys for Visual Studio team is off to the rescue again—this time with the alpha release of the Microsoft Code Snippet Designer. The Code Snippet Designer is a Visual Studio Integration Package that will integrate right with your installation of Visual Studio (Standard edition or higher) and allow you to create and edit Code Snippets directly from Visual Studio! It's based on the popular Snippy tool, supports replacements and snippet property editing, and even color codes your code based on the programming language you've selected (VB, C#, J#, and XML are all available!)

To start playing with the tool and trying it out for us, download it from MS Downloads here:

https://download.microsoft.com/download/6/7/7/677b3a55-6a61-433f-ae26-6d55aa16b0f8/Microsoft Snippet Designer (Alpha).msi

Remember, this is an alpha preview release, meaning it has had limited testing, and some stuff just doesn't work yet. Sometimes it doesn't automatically suggest the correct directory to save the new snippet to, and there's currently no way to highlight a section of code that you're working on and automatically export it to a new snippet. Hey though—it's an alpha, and the team wanted to get this in the community's hands sooner rather than later so we can hear from you and get suggestions on what needs to be changed or added to the tool to make it the ideal snippet editing experience.

If you have feedback, just click on the "Send Feedback" button in the Code Snippet Designer. You could even post a comment right here if you're feeling lazy…I'll read it.

Oh, and I'd be remiss to not give props to Matt Manela, the Microsoft intern who created this project this past summer. Matt did a great job on this tool, and I'm excited to work with him as a full-time employee soon. Oh, and Matt, if you want to pick up any of these suggestions or bug reports and get your hands dirty, let me know… J

UPDATE (11/17/06):   If you don't have Visual Studio installed in the default location for the English version (c:\Program Files\Microsoft Visual Studio 8\...) the Snippet Designer will fail when launched, saying that it can't find the snippetformat.xsd file (see comments below.)  An untested workaround for this would be to search your computer for that file, create the directory on your hard disk:  "c:\Program Files\Microsoft Visual Studio 8\Xml\Schemas\1033\" and copy the snippetformat.xsd file into that directory.  I just got into work this morning, and haven't had a chance to install Visual Studio in a different location and actually test this yet, so if anybody who's having the problem could try the fix and post back here if it works, it'd be appreciated!

Comments

  • Anonymous
    November 16, 2006
    Sounds good, this is actually what I want for a long time. But I can't use it on my laptop now, because I installed VisualStudio 2005 in my D: drive, and when I try to open a snippet file, there will comes out a dialog says can't find snippetformat.xsd in "C:Program Files...", seems you guys are hard coding this path? But this is an Alpha version anyway, so just I'm hoping to see you guys release this tool soon. Finally, thanks for your effort to provide so many useful power toys to make we developer's life easy!

  • Anonymous
    November 16, 2006
    Having a german VS opening the tool causes an error: Cannot find a part of the path: C:Program FilesMicrosoft Visual Studio 8XmlSchemas1033snippetforma.xsd My VS is located under C:Programme... So the tool isn't started. Cheers, Thomas

  • Anonymous
    November 17, 2006
    Learn C# Team Video's Interview with Anson Horton Interview with Karen Liu and DJ Park Luca Bolognese:

  • Anonymous
    November 17, 2006
    For those of you who develop with Visual Studio 2005 would know, Code Snippets have you a TON of time.

  • Anonymous
    November 18, 2006
    We Me Joe Morel's Blog Microsoft Code Snippet Designer – Alpha Release Code Snippet을 만들기 위해서는 직접 XML파일을

  • Anonymous
    November 21, 2006
    Welcome to the twelfth Community Convergence . Please go here to post comments. This edition of Community

  • Anonymous
    November 29, 2006
    Have you sorted out the problem with installation on D Like a previous tester I have a laptop and its Booting from D and VS is install;ed on D

  • Anonymous
    December 21, 2006
    sorry! i am a beginner of VC#S 2005 Express version. Could this application cooperate with VC# Express ? THX a lot.

  • Anonymous
    February 08, 2007
    I notice that this is dated November of 2006.  Today is Feb 08, 2007.  Is there a newer release available yet?