开发者

Replacing/Extending Visual Studio's Generate Stub in Visual Studio 2010

开发者 https://www.devze.com 2022-12-30 17:41 出处:网络
When we write the name of a method that doesn\'t exist, Visual Studio 2010 asks us if we\'d like to generate a method stub with that name. What I\'d like to know if is it possible to replace that same

When we write the name of a method that doesn't exist, Visual Studio 2010 asks us if we'd like to generate a method stub with that name. What I'd like to know if is it possible to replace that same code stub generating command with one made by myself. I never did any kind of extensibility programming for Visual Studio so I have a couple of questions:

  1. How hard is 开发者_JAVA技巧it? Is it something I can learn in a couple of nights, or is it something that'll make me "lose" a lot of time?

  2. It seems to me that there isn't a lot of support for that kind of programming, as generally people are not that interested in developing solutions that extend the Visual Studio IDE. I searched on SO and it doesn't appear to have many threads about extending Visual Studio.

  3. I don't know how the generate method stub thing works in Visual Studio, but I just wanted to turn it into something a bit more flexible and useful. Has anyone dealt with these kind of things before, that can give me a pointer to where to start? I know of MS VSX site but that has a lot of resources and can be overwhelming for someone new to the subject as I am.
  4. What technology will I need to use? T4? Maybe I'll need to know a lot about the code, like Visual Studio does, so I can know other method's type arguments, names, etc. Is that what T4 is for?

Thanks


I searched the web a bit and I don't see anything about customizing the "Suggested Fix." Your thought in #2 is probably spot-on.

You can modify the VS editor by reading through http://msdn.microsoft.com/en-us/library/dd885242.aspx.

0

精彩评论

暂无评论...
验证码 换一张
取 消