domenica 24 aprile 2005 09:44
I have two problems. First, I added a subdirectory to MyCodeSnippets called Exceptions. However, no 'plus' sign appears to the left of the MyCodeSnippets Folder. How can I get subdirectories to produce a plus sign next to the mysnippets directory?
Second, if I want to add my own code to this Exceptions folder, how do I do it. Imports wants a file that contains a 'CodeSnippets' type. I copied my code to a text file, navigated to it, but of course it doesn't appear. I typed in *.*. Then it appeared. I selected it but the code snippet manager rejected it because it wasn't a code snippet file.
So how can I import my own code?
Tutte le risposte
mercoledì 27 aprile 2005 09:20
The first problem is because of the vb build in snippets are maintained in an XML file under <vb installation folder>\snippets\<language id>\SnippetIndex.xml
For the second, you can create a vb code snippet file thru the code editor window using the context menu->create snippet
mercoledì 27 aprile 2005 12:38Thank you Muthu,
Is there a workaround for problem number 1?
mercoledì 27 aprile 2005 12:46I'm afraid that when I select code, the context menu only says insert snipped, not create snippet. No matter what I tried, I couldn't get the context menu to offer create snippet
giovedì 28 aprile 2005 17:57Moderatore
In Beta 2 we are not properly registering the My Code Snippets folder, you should see an exclamation mark next to that folder in the Code Snippet Manager. To correct this you'll need to remove and re-add that folder by:
1) Open the Code Snippet Manager and select the My Code Snippets folder
2) Click Remove
3) Click Add and navigate to the proper folder \My Documents\Visual Studio 2005\Code Snippets\Visual Basic\My Code Snippets
Now you'll be able to add sub-folders and snippets to your My Code Snippets folder and have them appear in the Insert Snippet dialod and the Code Snippet Manager.
To create your own code snippets you'll need to author a .snippet file and can do this using the Code Snippet Editor we've just released today on MSDN (http://msdn.microsoft.com/vbasic/downloads/2005/tools/snippeteditor/). This editor will allow you to copy/paste the VB code and define the replacements and other attributes of your snippet without diving into the underlying XML format.
Hope this helps,
venerdì 29 aprile 2005 07:57thank you very much. I was just about to keep my snippets in a clipboard extender. That still might be an easier way.
edit: I tried several times to download it. The dialog window comes on the screen. I click save. Nothing further happens. It's not in the process window, not in the internet explorer group in the bottom, not in the application tab in the task manager.
sabato 30 aprile 2005 11:13
Im using VS.NET 2005 Beta 1. I dont know its availability on beta 2 (may be removed). Anyway try that again with a selected code. I got these on the context menu.
View In Diagram Cut
Breakpoint > Run to Cursor Go to Definition
Synchronize Class View
sabato 30 aprile 2005 11:19I am able to download the snippet editor for vs.net 2005 beta 2. shall i send you that by mail?.
sabato 30 aprile 2005 11:21thanks muthu,
I was able to download it myself.