SnippetDesigner icon indicating copy to clipboard operation
SnippetDesigner copied to clipboard

Snippets not recognized outside of default folder

Open bigteejay opened this issue 9 years ago • 6 comments

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?

bigteejay avatar Dec 14 '15 09:12 bigteejay

Did you try restarting VS after the change?

mmanela avatar Dec 14 '15 19:12 mmanela

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

})();</Code> <Delimiter>$</Delimiter> </SnippetIndexItem>

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

bigteejay avatar Dec 15 '15 20:12 bigteejay

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?

bigteejay avatar Dec 15 '15 22:12 bigteejay

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

mmanela avatar Dec 15 '15 23:12 mmanela

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.

bigteejay avatar Dec 16 '15 01:12 bigteejay

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.

gokussx4 avatar Oct 28 '16 16:10 gokussx4