Visual Studio - Custom Add-in/Code generation Development assistance

Messugga

Honorary Master
Joined
Sep 4, 2007
Messages
13,051
Reaction score
3,203
Location
Pretoria
Hi guys,

I'm getting a bit fed up with having to write (Or copy/paste when applicable) certain snippets of code that I use often, between projects. I'd also like to add some functionality and wrap it up in a nice package so that the library or whatever may end up getting used, can easily be imported by another developer for use.
Part of the functionality would include dynamically generating code such as for example an enum, based on what the developer's writing. I've seen some frameworks and tools doing this when you compile, which is fine, although not neat in my opinion.
What I would prefer to do, however, is have the add-in generate the code while the developer is writing, allowing him to make effective use of Intellisense, should he or she choose to do so, without having to compile the code first.

Now, since this would be the first time I'd approach something like this, how on earth would I go about doing that? As I said, I'd prefer to go the add-in route as that would probably allow me to avoid the having to compile issue, but if that's going to be impractically complex, then code generation at compile-time would be acceptable.

Advice would be appreciated.
 
ReSharper comes to mind - thats the only thing I can think of that could generate a snippet across projects. Otherwise investigate code template tools like T4 - they can be used to spit out code based on a template. But T4 is not a cross project tool, its meant for generating boilerplate code.
 
ReSharper comes to mind - thats the only thing I can think of that could generate a snippet across projects. Otherwise investigate code template tools like T4 - they can be used to spit out code based on a template. But T4 is not a cross project tool, its meant for generating boilerplate code.

I recall ReSharper being thought of as a very nifty tool to have but haven't looked at it in years. I'll look into it, thanks.
 
Top
Sign up to the MyBroadband newsletter
X