In visual studio 2010, is there a way to make snippets specific to a single project or solution? I'm interested in doing this so that I might use them to support my architectural decisions (i.e. create a POCO that implements a certain interface in a prescribed manner).
Can I create project specific code snippets?
Asked Answered
I don't know if you can or not, but my instinct says you don't need this. It implies copypasta and lack of DRY. Have you considered using T4 templates or some similar code generation process, or refactoring common methods into a static class? –
Haase
I NEVER do copy paste. I'm just creating all of these POCOs for certain purposes within the application and I like to use my own templates and conventions. Plus I like to use the template pattern quite a bit. I have to type a lot of the same code over and over again. I spend too much time doing that. I started using snippet, but I find that they differ based upon the domain. I have too many snippets. It would make more sense to create them per project. I will look into the things you've suggested. –
Coyle
I'm talking about the structure of the POCO, not its contents. I maintain a consistent polymorphism throughout my application using interfaces for particular functions. Its very decoupled. I'm looking for something just a little bit above the "Implement Interface..." function within Visual Studio's code editor. I used to use that, but it doesn't work exactly as I'd like. Before I begin developing, I layout my POCO's in the form of snippets based upon my design docs. I'm not a college student. –
Coyle
For people willing to pay: Resharper has functionality with their template system (equivalent to snippets) for adding project/solution specific templates. I suspect other refactoring tools like coderush and justcode also has it –
Maeganmaelstrom
Even in VS 2013, this is not possible. Snippets are global in Visual Studio.
© 2022 - 2024 — McMap. All rights reserved.