Refactor C# code

Last modified: 11 February 2024

There are two ways of refactoring code in JetBrains Fleet: apply local code transformations (or context actions) and apply global refactorings which will analyze the entire solution and make sure that all affected references are properly updated.

To list context actions available for the current caret position, press . Press or to pick the desired action, and then press to apply it.

JetBrains Fleet: Local code transformations

In contrast to local transformations, global refactorings have dedicated shortcuts and menu entries. For example, to rename a symbol and all its usages in the current solution, press or choose Code | Refactor | Rename from the menu (you can start either at the declaration or at any usage). JetBrains Fleet will show how many usages there are in the solution, and then you type a new name right over the old one and press to apply the refactoring, or press to cancel it.

JetBrains Fleet: Rename refactoring