![]() ReSharper provides several ways to reformat existing code.įor C# for example, clear the corresponding check-boxes on the Text Editor | C# | Code Style | Formatting | General options page. In short, you can always use Control+Alt+L, but there are a few details and alternatives described below. ![]() Select the scope where you want to reformat code: If reformatting C# code is not an option, you can enable Virtual Formatter and view reformatted code without actually changing the sources. Make a selection in the editor to reformat code in the selection. Set the caret anywhere in the file to reformat code in the file. ![]() Select one or more items in the Solution Explorer to reformat code in files under these items and their child items. Press Control+Alt+L or choose ReSharper | Edit | Reformat Code from the main menu. Alternatively, you can press Control+Shift+A, start typing the command name in the popup, and then choose it there. You can reformat code in the current selection right from the Alt+Enter list. In the editor, select a block of code that you want to reformat. Press Alt+Enter and choose Reformat and cleanup | Reformat selection.Īlternatively, you can use code cleanup to reformat code in any scope. Code cleanup may be helpful if you want to combine code reformatting with applying other code styles.Ĭode cleanup is not applied to generated code. VISUAL STUDIO CODE FORMAT DOCUMENT DOES NOT WORK WINDOWSīy default, ReSharper provides the list of file masks and regions for generated code typically produced by Visual Studio (for example, Windows Form Designer-generated code). If necessary, you can edit the list of generated items on the Code Inspection | Generated Code page of ReSharper options ( Alt+R, O). Press Control+Alt+F or choose ReSharper | Edit | Cleanup Code. Right-click anywhere in the text editor or right-click the selection and choose Cleanup Code in the context menu.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |