ReSharper DevGuide

Edit page

Key Topics

The ReSharper Platform is very large, and very capable, and its size can initially be very daunting. This page is intended to list the key topics that a plugin author would be interested in, and provide quick links to the most common extension points.

Essential concepts

  • Getting Started with extensions and plugins.
  • Architectural overview - a brief tour of the different layers of the ReSharper Platform.
  • Lifetime management - discusses the Lifetime class, which is key to lifetime management and used throughout the Platform.
  • Component Model - ReSharper is very much a component based application. All services and components are exported and must be imported in order to be consumed. This allows for a very loose coupled architecture, and is instrumental to making ReSharper very extensible. To get the most out of it requires some understanding of how the component model works, and how it relates to lifetime management.
  • Zones - the ReSharper Platform’s shared binary distribution raises issues about shipping mechanisms (i.e. how to ship a component that is used by one product configuration but not another). Zones manage this by partitioning components into logical feature sets. Extension providers must understand how this works in order to correctly import and export components.

Also, there is a migration guide for existing extension authors.

The code model

ReSharper’s code model is called the PSI - the Program Structure Index. The key topics here are:

  • Overview
  • Abstract syntax trees - files are parsed and abstract syntax trees are generated, as you type.
  • Declared elements - declared elements are the root interfaces for ReSharper’s semantic view of the code.
  • References - a very powerful mechanism to allow abstract syntax trees to have an outgoing references to a declared element, that is, to link syntax nodes, such as type names, to the semantic item they refer to.
  • Type Systems - modelling type usage, based on the semantic view of the code given by declared elements.

These are the core building blocks of the PSI, although it has more functionality, including caching, searching and control flow analysis. The PSI section has more details.

Common extension points

ReSharper is extremely extensible. It is a heavily component based application, and is designed to follow the Open Closed Principle to allow for such extensibility. Most features and services can be extended, but some common extension points are:

Last modified: 10 July 2017