Templates and snippets

Feb 25, 2013 at 4:24 PM
Is there a package for stylecop appropriate templates and snippets in visual studio 2012? It makes it really difficult to implement stylecop without those.

Thanks!
Mar 5, 2013 at 3:44 PM
Wow, so like no interest at all....
Apr 10, 2013 at 10:47 AM
Does https://vssnippets.codeplex.com/ works?
In VS2010 there was some magic, when creating a new file, where to add/edit that behaviour?
Apr 10, 2013 at 12:32 PM
File location
  1. Default Visual Studio 2012 Snippets files is found in: %ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC#\Snippets\1033\Visual C#
  2. "My Code Snippets" files is found in: %USERPROFILE%\Documents\Visual Studio 2012\Code Snippets\Visual C#\My Code Snippets
  3. "StyleCop Code Snippets" file is found in StyleCop Compliant Visual Studio Code Snippets
Files to copy
  1. The files that differ(se below), has minor changes to complie to StyleCop rules, so it should be safe to replace them.
  2. The files that is same(se below), do nothing
  3. The added files should be places in "My Code Snippets"
VS2012 files that differ from "StyleCop Code Snippets"
~.snippet
attribute.snippet
checked.snippet
class.snippet
ctor.snippet
do.snippet
enum.snippet
equals.snippet
exception.snippet
for.snippet
forr.snippet
indexer.snippet
interface.snippet
invoke.snippet
iterator.snippet
iterindex.snippet
lock.snippet
namespace.snippet
pp_if.snippet
pp_region.snippet
prop.snippet
propfull.snippet
propg.snippet
sim.snippet
struct.snippet
svm.snippet
try.snippet
unchecked.snippet
unsafe.snippet
VS2012 files that is same as "StyleCop Code Snippets"
cw.snippet
else.snippet
foreach.snippet
if.snippet
mbox.snippet
switch.snippet
tryf.snippet
using.snippet
while.snippet
Apr 10, 2013 at 4:35 PM
Thanks for working that out. Are there things in the 2012 templates that will need to be added to the stylecop templates? like new default imports , etc.?
Apr 10, 2013 at 5:08 PM
So that is the snippets, is there a way to easily merge the templates form 2010 to 2012?
Apr 10, 2013 at 5:53 PM
I went through and manually edited all of the templates I was worried about. It isn't that difficult once you learn what you are doing. The process just took some time. It is interesting that the project templates have their own class1.cs or application.cs rather than using the templates for the file types.
Apr 24, 2013 at 10:20 AM
Hi,
I have used "StyleCop Code Snippets" for a while, and I put them all in the Default Snippets location, and it works ok.
I havent found the magic behawiour, when creating a new file.
Yes i'ts farly simple to edit.
Apr 24, 2013 at 1:53 PM
I went through all the installed templates in every project type and added my headers. I also created some sinppets for adding headers and doc strings to existing code. It took an afternoon to get it all done but I think it was worth my time.