ReSharper 2018.2 Help

Generating Partial Methods

ReSharper | Edit | Generate Code | Partial Methods
Alt+Insert | Partial Methods
ReSharper_GeneratePartialMethods

Partial methods are defined in different parts (different files) of a partial type - one part contains the signature of the method while the other part contains its implementation.

The Generate partial methods command will help you create implementation stubs for not implemented partial methods.

To generate implementations of partial methods in a partial type

  1. In the editor, position the caret within a partial type at the line where you want to insert implementations of partial methods.

  2. Press Alt+Insert or choose ReSharper | Edit | Generate Codeā€¦ from the main menu. Alternatively, you can press Ctrl+Shift+A, start typing the command name in the pop-up, and then choose it there.

  3. In the Generate pop-up menu, select Partial Methods.

  4. In the Generate dialog that appears, select partial methods to create implementation stubs for.

    Generating partial members

  5. Click Finish to complete the wizard.
    You can also click Options to review or modify common code generation preferences on the Code Editing | Members Generation page of ReSharper options.

Depending on your settings, in the bodies of generated implementations ReSharper throws new NotImplementedException(), returns default value, or puts code that will not compile. You can configure your preferences on the Code Editing | Members Generation page of ReSharper options.

This feature is supported in the following languages and technologies:

Language: C#

Language: VB.NET

Language: C++

Language: HTML

Language: ASP.NET

Language: Razor

Language: JavaScript

Language: TypeScript

Language: CSS

Language: XML

Language: XAML

Language: Resx

Language: Build Scripts

Language: Protobuf

Language: JSON

Feature is available

Feature is available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

Feature is not available

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.

Last modified: 5 October 2018

See Also