mmanela / SnippetDesigner

The Snippet Designer is a plugin which enhances the Visual Studio IDE to allow a richer and more productive code snippet experience.
Apache License 2.0
344 stars 85 forks source link

Snippets not recognized outside of default folder #116

Open bigteejay opened 8 years ago

bigteejay commented 8 years ago

Tools... Options... General Options... IndexedSnippetDirectories, expand the collection with the ellipses button on the right of the field. Then click the Add button, then set the path to my own preferred snippet folder for the value on the right... "C:\Users{USERNAME}\OneDrive for Business\Code\SnippetsDesigner\Snippets" ...(tried enclosed in quotes too.)

Go back to my .js file, type the shortcut, no autocomplete/suggestion pops up (not recognized.) Also tried the rebuild index button.

If I copy the exact same file, no alterations, to the default snippet path (currently "D:{USERNAME}\Documents\Visual Studio 2015\Code Snippets\JavaScript\My Code Snippets" on my system) and go back to VS (without rebuilding the index or restarting or anything) it will instantly recognize/suggest the snippet as I start to type the shortcut.

Ideas?

mmanela commented 8 years ago

Did you try restarting VS after the change?

bigteejay commented 8 years ago

I have, several times. Even (unrelated) restarted my PC a couple of times now.

The entry made it into the index xml file without my adding it manually (at the very end, but appears)...

C:\Users{MY-USER-NAME}\OneDrive for Business\Code\SnippetsDesigner\Snippets\JS-Self Executing Function.snippet JsSelfExFunc {MY-USER-NAME} js function javascript // $fileName$.js (function $functionName$() { ``` "use strict"; //START HERE ``` })(); $

...yet, it still won't show if it's in my custom folder.

bigteejay commented 8 years ago

Interestingly, none of the SnippetIndexItem items in the index xml appear to contain the shortcut value (or equivalent) that triggers the snippet. Is that expected?

mmanela commented 8 years ago

They should contain shortcut if you set it in the snipper designer

bigteejay commented 8 years ago

It doesn't, and moving it to the system default location enables it (without editing the snippet file or rebuilding the index.)

None of the system generated/identified snippets that appear in the index file have it either.

gokussx4 commented 8 years ago

I have the same problem. Add my folder, that contains .snippet files, to IndexedSnippetDirectories and it will not load. Also, if I create a new snippet file from visual studio and just save the snippet in the default location that pops up in the save dialog that doesn't show up in the snippet explorer either. I have tried rebuilding the index, opening and closing visual studio.