Overwriting Standard Code Snippets

I am making several improvements to the code snippets that are usually built into VS2010. Is there a way to “prefer” certain fragment directories over others or overwrite default values ​​without manually deleting links from the Code Snippets window? I would like to keep the same shortcuts.

This is basically nit-picking, since I can delete .snippet files manually or delete links to folders, but I wonder if there is an easier way if I finish replacing a large number of standard fragments but still want to save others.

There are two problems that arise when using similar labels in code snippets.

  • For some fragments, such as propdp, you will be asked to specify several fragments and ask them to choose which one is suitable.
  • For other fragments, such as ctor, it simply uses the default fragment and pretends that my own does not exist. When viewing fragments using Ctrl + K, Ctrl + X clearly shows that the fragment is working and the shortcut is correct.

The second problem here is of greater concern than the first.

Edit: Further experimentation shows that ctor, in particular, it uses the default fragment, no matter what. I did not try to rewrite the code in the source snippet file, but removing the link to the Visual C # snippets folder still uses the default value and ignores my replacement.

2: , ctor .snippet. Visual Studio. , . ctors, . ctor . ctor, . -, VS2010.

+3
2

, ?

: C:\Program Files (x86)\Microsoft Visual Studio 10.0\V#\Snippets\1033\Visual #

+2

Code Barrel? , .. , , . ~ shrug ~ , , codebarrel.com, .

-1

Source: https://habr.com/ru/post/1771863/


All Articles