Snippet Enumeration Macro

Inspired by my recent post on C# code snippets, I found a little console app by Francesco Balena* that enumerates all the snippets on your system along with their shortcut text.


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2006/03/snippet-enumeration-macro.html

After double-clicking, nothing happens…

Check your “My Documents” folder for a file called “Visual Studio 2005 CSharp Code Snippets.htm”

Add a reference to System.xml in your Macro IDE and then it should work.

I believe these guys are using J#: https://mvp.support.microsoft.com/communities/mvplist.aspx?Product=Visual+Developer±+Visual+J%23

OOOPS, you don’t hide the email address???

Check your “My Documents” folder for a file called “Visual Studio 2005 CSharp Code Snippets.htm”

Actually my system is localized to portuguese and so “My Documents” is so what called “Meus Documentos”. That’s probably one (localization) point.

I tried the console application by Francesco Balena and it worked fine…

so “My Documents” is so what called “Meus Documentos”. That’s probably one (localization) point.

Shouldn’t be, because I query the registry key to get the root path, and I use Environment.GetFolderPath(SpecialFolder.MyDocuments) to fill in the expansion vars in that path.

Unless the registry key names themselves are localized?

I tried the console application by Francesco Balena and it worked fine…

Be careful, because he doesn’t pick up anything from the registry. Which means if you’ve set any snippet paths up in the Snippet Manager (which writes exclusively to the registry), those snippets won’t show up.

Also, I just fixed a bug where only HKLM was checked for snippet paths. Now it checks in both HKCU and HKLM. What’s really aggravating is that the language names are different in each part of the tree:

HKLM\Software\Microsoft\VisualStudio\8.0\Languages\CodeExpansions\CSharp

HKCU\Software\Microsoft\VisualStudio\8.0\Languages\CodeExpansions\Visual C#

I kid you not…

The group of terms “Snippet enumeration macro” confused me at first. Was thinking Snippets + enums + C macros, all working together.

I get it now.

Didn’t work for me. After double-clicking, nothing happens…

I found the guy that uses J#:

http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-csharp/37122/Want-to-switch-from-J-to-C-need-help