Search code examples
visual-studiovisual-studio-2015resharpercode-snippetsresharper-10.0

How do R# live templates interact with VS code snippets?


R# has a feature called "live templates" that seems to duplicate the "Code Snippets" feature in built into VS, although it's probably more featureful.

How do the 2 features interact? E.g. I see R# has imported its templates from VS's snippets. What if I edit a VS snippet, that also already exists as a R# template?

VS version: 2015
R# version: 10


Solution

  • They don't interact at all, they're completely separate features. The imported tag that ReSharper uses is a bit of a misnomer. They're not really imported, just copied from the default set of VS snippets. The tag is intended to show that they provide the same functionality as VS snippets, but are separate.

    If you edit a VS snippet, it won't affect a ReSharper template, and vice versa. ReSharper will use ReSharper templates in code completion and the editor, but will also expand a VS snippet if you type it and hit Tab. You can also use the keyboard shortcuts or VS menu items to invoke the default VS snippet insertion UI and insert VS snippets that way.