LazowskiAnton · Extensions

TidySmith

C# code put in the order your team wants: members sorted and grouped with a preview and one Undo, regions by your rules, comments wrapped to your line length — and gray dots in the editor where something can be tidied.

Free · Visual Studio 2022 and 2026 · 14 UI languages · no telemetry

Why TidySmith

A class before and after Order Members: constants and fields first, then the constructor, properties and methods

Safe by design

Built on the Roslyn syntax tree: members move with their comments, documentation and attributes; #if and #region blocks are never crossed; classes that cannot be ordered safely are left alone. A preview shows the diff first, and Apply is one Undo.

Your team's order

The order of the groups, access, static members, names — set it on the options page or put it in .editorconfig, so everyone gets the same result. Presets for StyleCop and CodeMaid are built in.

Found without a manual

Gray dots under a class that is out of order or a comment that is too long; Ctrl+. offers the fix next to the Visual Studio actions. Once you know the commands, turn the hints off.

Free, without strings attached

No subscriptions, no "pro" version, no data collection, no messages in the Output window or at startup. The only thing we will ever ask — after you have used it for a while — is a rating on the Marketplace. Works on Visual Studio 2022 and 2026, x64 and ARM64.

Features

Every command is in Edit › TidySmith and in the context menu of the code editor (right-click › TidySmith); Order Members also in the context menu of files, folders and projects in Solution Explorer.

Order members

Order Members… sorts the members of a class by kind (constants, fields, constructors, properties, methods…), then by access (public first), static before instance, and by name if you want — in the order set on the options page or in .editorconfig.

Presets to start from: TidySmith (overloads and interface implementations kept together), StyleCop (SA1201, SA1202, SA1204 — strictly by access) and CodeMaid (the CodeMaid default, for teams moving from it).

Hints in the editor

Where TidySmith can help, the name gets three gray dots — the way Visual Studio marks its own suggestions. The pointer on them says what; Ctrl+. offers the fix, with a preview of the change.

Gray dots under a class name and a long comment; the light bulb with Order members and its preview
Caret onCtrl+. offers
The name of a classOrder members of the class or the file, add regions by your rules, remove the regions of the class, open in the Structure window
A comment longer than the line lengthWrap the comment
A #region lineRemove this region (the code stays)
Several selected linesSort lines (only a flat list), join lines

Dots appear for a class out of order, a comment longer than the line length and regions that differ from your rules — nothing else. The dots and the light bulb actions have separate switches; “Only in files I have changed” keeps old code quiet.

Regions by your rules

Add Regions to This File… puts #region lines where your rules say, after a preview. Regions are a team decision, so the default is no regions: the command opens the settings until you choose.

Region rules and a class with Fields, Methods and IDisposable regions

StyleCop rule SA1124 forbids regions; that is why the default is no regions — and why tidy on save removes them with that setting.

Comments that fit

Format Comment wraps the // or /// comment at the caret (or every comment of the file) to your line length — max_line_length from .editorconfig, or 120. Long lines are broken, short ones joined, a long <summary> gets its own lines. Code samples (<code>), lists, separator lines and commented-out code stay as they are.

A documentation comment before and after Format Comment

Tidy on save

When a C# file is saved, TidySmith can order its members, put regions as the rules say, wrap comments and remove trailing spaces and extra blank lines — each step has its own switch. Only the file being saved, never generated files; the status bar says what changed, and Ctrl+Z takes it back. Tidy This File runs the same steps on demand.

Off by default. Turn it on once Order Members gives the result your team wants — otherwise the first save of an old file reorders it all.

Structure window

View › Other Windows › TidySmith Structure: the types and members of the active C# file. It follows the caret, a click goes to the member, search filters, and a member dragged onto another moves there — the same safe move as Order Members. Methods show their length and cyclomatic complexity; past the limits on the options page they turn orange.

The Structure window with the members of a class and a long method in orange

Small helpers

The commands people missed from CodeMaid, in Edit › TidySmith and the context menu of the editor.

Switch File

Opens the file that belongs to the current one — markup and its code, a resource file and its designer, code and its tests — without looking for it in Solution Explorer.

FromTo (and back)
MainWindow.xamlMainWindow.xaml.cs
Order.razorOrder.razor.cs
Index.cshtmlIndex.cshtml.cs
Strings.resxStrings.Designer.cs
MainForm.csMainForm.Designer.cs
OrderService.csOrderServiceTests.cs — also in a test project of the solution; …Test.cs and ….Tests.cs too

The menu names the target (“Switch to OrderServiceTests.cs”) and is off when there is nowhere to go. It shines with a key of your own — see below.

Sort Selected Lines

Sorts usings, enum members or the items of a list; the commas stay where the list needs them. Only a flat list is sorted — one item per line, the same indent, no blank lines, no statements — so a method or a whole file selected by mistake is never scrambled; the status bar says why.

Join Lines

Joins the selected lines into one, or the line at the caret with the next one.

Find This File in Solution Explorer

Selects the file of the editor in Solution Explorer.

Collapse and Expand All Regions

Collapses or expands only the #region blocks; methods stay as they are. Unlike Ctrl+M, Ctrl+O (which collapses methods too) and Ctrl+M, Ctrl+L (everything).

No shortcut is taken by default — the keys of Visual Studio stay as they are. Bind any command in Tools › Options › Environment › Keyboard: type TidySmith. in “Show commands containing”.

Settings

Tools → Options → SmithWorks → TidySmith. Every option has a description.

OptionDefault
TidySmith actions in the light bulb (Ctrl+.)on
Gray dots where something can be tidiedon
Member orderTidySmith preset
Preview before orderingon
Regionsno regions
Comment line length120
Tidy on saveoff
Long method (lines) · complex method60 · 10
Ask for a rating on the Marketplaceon

Settings are stored in %LocalAppData%\TidySmith; .editorconfig wins where it has a value.

TidySmith options page
The options page.

Per repository: .editorconfig

Put the rules next to the code, and the whole team gets the same result; a value in .editorconfig wins over the options page (unless “Use the order from .editorconfig” is off).

[*.cs]
tidysmith_member_order = stylecop
tidysmith_regions = kind
tidysmith_region_min = 2
max_line_length = 120
KeyValues
tidysmith_member_ordertidysmith, stylecop, codemaid, or the groups in order: constants, fields, constructors, properties, methods…
tidysmith_regionsnone, kind, access, kind_access
tidysmith_region_minThe fewest members a region is made for: 2
max_line_lengthThe line length comments are wrapped to

FAQ

How is it different from CodeMaid?

TidySmith works on the Roslyn syntax tree instead of the old code model, so #if, comments and attributes stay where they belong; it shows a preview and is one Undo; the order can live in .editorconfig; it runs on Visual Studio 2022 and 2026 on x64 and ARM64. It covers C# only, and leaves out what Visual Studio does on its own now (code cleanup, build progress).

Why was a class not ordered?

TidySmith leaves a class alone when ordering it could break or garble it: a syntax error, a member on the line of a brace, two members on one line. Members inside #if or #region move only within their block. Generated files are never touched.

Can I take a change back?

Yes: every command and every save is one edit, so one Ctrl+Z takes it back. In Solution Explorer, files that are not open are written to disk — use your version control there.

Why did Sort Selected Lines do nothing?

It sorts only a flat list, so a selection that is code — statements, blocks, lines with different indents or blank lines in between — is never scrambled. The status bar says so.

Add Regions does nothing.

The default rules are no regions. Choose how to split them in the Regions group of the settings (the command opens it), or set tidysmith_regions in .editorconfig.

What about VB, C++ or XAML?

TidySmith is for C#. Other languages may follow if they are asked for — tell us in the Feedback repository.

Does TidySmith send any data?

No. Everything runs inside Visual Studio on your files; nothing is sent anywhere — no telemetry, no requests.

Where do I report a problem or suggest a feature?

Open an issue in the Feedback repository on GitHub — there are forms for bugs and ideas (please change private names). You can also use the Q&A tab on the Marketplace.

Changelog

1.0.2

1.0.1

1.0.0