views:

248

answers:

6

If you had to create a plugin like ReSharper for Visual Studio, where would you start?
(not talking about each and every feature, but I am trying to just get a skeleton of it going).

+2  A: 

I'd start by digging around in one of the open source alternatives, such as TytanNET. Obviously, if you were interested in a specific feature of Resharper, then there may be a more direct option.

dommer
+4  A: 

I certainly wouldn't try to reverse engineer Resharper using, say, Reflector. No sir, not me. Never.

James L
Yeah, right. ;)
Fredrik Mörk
+4  A: 

As of beginning of 2007, JetBrains guys estimated ReSharper to be around 30 man-years (this is a Google Translated version of a post on a Russian forum). They also say that it's not enough to be proficient in building compilers: they consider the most complex parts to be caches, AST transactions, AST contexts, etc. Visual Studio integration was not the most sophisticated thing technically: it was just a matter of reading tons of docs.

So this is basically it: Visual Studio integration and AST managements will be the most complex parts to implement to get a skeleton of ReSharper.

Anton Gogolev
30 man years? c'mon! What is AST managements?
Blankman
@Blankman Well, ReSharper parses the whole solution into an Abstract Syntax Tree, which has to be efficiently kept in memory. Moreover, to support Refactoring, the changes to an AST has to be made in an all-or-nothing fashion. And even more, the AST is constantly changing while the programmer is doing her job. This also hast to be accounted for.
Anton Gogolev
I'd believe that. If they were wise, ReSharper is based in large part on older versions of IDEA, and that product has seen 8 years of very active development.
Alex Feinman
+1  A: 

I would probably start by making sure I had an understanding of which specific refactorings were to be supported by my tool. "Something like resharper" is a little general to know "where to begin" from a technical standpoint.

So, as I said, I would start by trying to make sure I understood the business requirements. From there, it gets easier to break the project down into smaller and more manageable sub-problems.

Paul Morie
+2  A: 

I had the pleasure of writing some plugins for ReSharper to make additional changes to the code layout and style (as per coding guidelines of a company I work at). It's not very easy, but the API is fairly rich, albeit very poorly documented, so using Reflector will be mandatory.

I would suggest looking at the source code for great existing plugins, such as Agent Johnson and StyleCop for ReSharper. You can also try to get help at the ReSharper Open API forums at JetBrains.

EDIT: Apparently I can't read. I thought you meant plugins for ReSharper. In that case I would begin by starting with the Visual Studio SDK, learning how to interact with the code, build the AST, etc. There are many examples provided in the SDK.

hmemcpy
Still a good point, maybe the original poster can solve their problems with just a plugin and save some time.
Frank Schwieterman
+2  A: 

File -> New -> Project

Other Project Types -> Extensibility -> Visual Studio Add-in

ck