How to fix resharper from deleting editable literal in code snippet when pressing <Enter>?
The problem is when I type code snippet shortcut and press <Tab> the snippet expands. There are some editable literals in resulting code which initially are set to defaults. I'm satisfied with default values for literals so then I press <Enter> in order to exit snippet editing context. The cursor jumps to $end$ position but at the same time it erases the default value for the first editable literal.
I've reinstalled my OS recently and encountered this issue. It worked before with VS2015 and some other Resharper version (probably #9). When I disable Resharper it works fine.
Evironment:
- Windows 10
- Visual Studio 2015 (14.0.25431.1.)
- Resharper (10.0.2)
Reproduction steps:
Say I want to use simple "for" snippet for c++
1. Write "for" shortcut in method body
2. Press <Tab> in order to invoke code snippet
3. Press <Enter> in order to confirm suggested defaults
Notice "size_t" default value that was selected on step #2 disappears.
Please sign in to leave a comment.
Thanks for the detailed issue description! This will be fixed in ReSharper 2017.1 (scheduled to be released on Apr 3rd). In ReSharper 10 you can try using ReSharper live templates instead of Visual Studio live templates as a workaround.