Looking for design patterns by static analysis of C # code by creating a plugin for Resharper?

I wanted to test several design patterns in C # code by static analysis. I found that by creating a plugin for Resharper, I can check the templates on the fly while I code. But I did not find good documentation related to its open APIs. Are there any links where I can find suitable documentation.

I use the MVVM pattern, so I want to check that the View-Model classes have no dependency on classes or user interface elements (WPF elements).

+4
source share
3 answers

This article looks as if it could help. There is a walkthrough for creating a context-oriented plugin. He continued here .

I think the second article is most important to you, as it covers using the visitor template to connect to the ReSharper daemons and do some useful work.

This page is the root of the Open API documentation.

NTN

+2
source

ReSharper 5 introduced the AKA Structural Search and Replace template catalog. This makes it easy to create quick fixes and contextual actions without writing your own ReSharper plugin. I would recommend checking it out to make sure that this is enough for your needs before delving into the creation of the plugin. You can find a review here:

http://blogs.jetbrains.com/dotnet/2010/04/introducing-resharper-50-structural-search-and-replace/

JetBrains also provides a sample directory that demonstrates some interesting things you can do on the download page:

http://www.jetbrains.com/resharper/download/index.html

+3
source

The documentation is currently somewhat fragmented. To get started, check out the ReSharper Extensibility Guide , which I think is aimed at version 4.5, but is still a good start. As another poster mentioned, the Hadi Hariri blog is a good source for finding information about a ReSharper plugin entry. Also, check out ReSharper PowerToys for sample code.

Finally, there are (so far very few) articles on developing the ReSharper 6 plugin here . More content will be added soon.

+2
source

Source: https://habr.com/ru/post/1343703/


All Articles