Home > Code Generation > Code Generation – Add Missing Constructors code provider

Code Generation – Add Missing Constructors code provider

April 26th, 2011

The Add Missing Constructors code provider from CodeRush allows you to add constructors from the ancestor class to the current class or structure, which are not implemented.

Imagine you are creating a descendant of the System.Exception class:

CodeRush - New Exception descendant (CS)

Show Visual Basic code… »

CodeRush - New Exception descendant (VB)

The Add Missing Constructors is available when the editor caret is located on the name of the class or its ancestor:

CodeRush Add Missing Constructors - Popup menu

After the code provider is applied, all constructors from the base class are added to your implementation:

CodeRush Add Missing Constructors result (CS)

Show Visual Basic code… »

CodeRush Add Missing Constructors result (VB)

Constructors will call the appropriate base type constructors and have a marker inside of their bodies to navigate between them easily.

This feature is a code fix for the corresponding CodeRush code issues:

—–
Products: CodeRush Pro
Versions: 10.2 and up
VS IDEs: any
Updated: Apr/26/2011
ID: C091

Similar Posts: