A bunch of quality refactorings and code fixes that are going to improve your C# development experience in Visual Studio and remove some common pain. See the change log for changes and road map. NoteAs Visual Studio evolves more features get added to it and some of them start duplicating features from this extension. Duplicate features are disabled/removed from this extension to insure the best user experience possible with a given version of Visual Studio. A special note will be given in affected features' descriptions. Features
Add constructor and initialize fieldCtrl+. on a field and choose Add constructor and initialize field. Add/Remove bracesAllows you to quickly add missing braces to single statements: It works both ways and allows you to remove braces if you prefer so. Change access modifier on type declarationsCtrl+. on a type declaration (either top level or nested) and choose one of proposed options. Field can be made readonlySuggest to declare a field as readonly if it's possible: VS 2017 version 15.7 and above provide a built-in analyzer and a code fix. Generate GUID (nguid)Just type and press TAB: Initialize field from constructor parameterCtrl+. on a constructor parameter and choose Add initialized field. When there is an existing VS 2017 and above provide a similar refactoring out of the box. Initialize field in existing constructorCtrl+. on a field and choose Initialize field in existing constructor. Locate in Solution ExplorerThere is a standard command in Solution Explorer called 'Sync with Active Document'. People coming from ReSharper will appreciate its Shift+Alt+L equivalent. To avoid conflicts with some internal VS commands ALT+L key binding was chosen by default which can be changed in VS settings if needed. The command is available in the code editor either from the context menu or as a shortcut. Make it a constructor (when copied from another class)Sometimes you copy code from another class into a new one and this quick fix allows you to update the constructor name. Namespace vs file path analyzer and code fixAnalyze if a top level namespace does not match the path of the file where it is declared or does not start with the project's default namespace. Note that the code fix currently does not update references. VS2019 and above provide a corresponding code refactoring out of the box, hence only the analyzer part will remain enabled in those versions. Scaffold xunit data driven testsIf you're a fan of Xunit data driven tests this one's going to be a little time saver for you. You can scaffold As well as If your Note that this feature works with Xunit 2.x only. Settings page (ability to enable/disable individual features)All features can be individually enabled or disabled. Analyze if type name matches file nameAnalyzes if a top level type name matches the name of the file where it is declared and displays a warning if not. Visual Studio 2017 and above provide code refactorings to rename types and file names to match each other out of the box. ContributeCheck out the contribution guidelines if you want to contribute to this project. For cloning and building this project yourself, make sure to install the Extensibility Tools extension for Visual Studio which enables some features used by this project. License |