Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>GAMESMAYER DiagnosticsNew to Visual Studio Code? Get it now.
GAMESMAYER Diagnostics

GAMESMAYER Diagnostics

GAMESMAYER

|
2 installs
| (0) | Free
Apply diagnostic-based fixes from Roslyn and GAMESMAYER Diagnostics.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GAMESMAYER Diagnostics

GAMESMAYER Diagnostics extension applies diagnostic-based code fixes from Roslyn and GAMESMAYER Diagnostics.

Setup

Add the following to your .vscode/settings.json:

{
  "[csharp]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "GAMESMAYER.gamesmayer-diagnostics"
  }
}

And that's it!

Save a C# file and see how the issues are fixed.

Formatting Rules

Name Diagnostics Description Default Value
removeUnusedUsings GM0140 Removes unused using directives true
removeUnusedVariables CS0219, IDE0059, CS0168 Removes or discards unused variable assignments true
useExplicitBuiltInTypes IDE0008 Replaces var with the explicit type true
removeBlankLines GM0001, GM0003, GM0006, GM0008, GM0010, GM0011, GM0012, GM0015, GM0030, GM0031, GM0035, GM0044, GM0050, GM0052, GM0055, GM0057, GM0074, GM0075, GM0112, GM0119, GM0120, GM0121, GM0134, GM1505, GM1508 Fixes blank line violations around braces, usings, parameters, declaration-to-parenthesis layout, empty parentheses placement, single-line parameter or argument lists that must stay on the declaration line, blank lines between fluent-chain segments, blank lines between the => token and the lambda body, blank lines between wrapped multi-line operator-expression items, blank lines between return and its returned expression, blank lines between consecutive where constraint clauses, blank lines between a declaration and its first where constraint clause, blank lines after #if/#else/#elif directives (GM0074), blank lines before #endif/#else/#elif directives (GM0075), blank lines between consecutive variable declarations (GM0112), blank lines between array initializer items (GM0119), blank lines between object initializer members (GM0120), blank lines around the constructor initializer colon (GM0121), and blank lines around the inheritance-clause colon (GM0134) true
collapseStatements GM0009, GM0014, GM0016, GM0017, GM0018, GM0019, GM0021, GM0036, GM0037, GM0039, GM0047, GM0048, GM0051, GM0056, GM0059, GM0060, GM0111, GM0118, GM0128, GM0136, GM0137, GM0138, GM0139 Collapses multi-line declarations, attributes, control structure clauses, and empty braces onto a single line, collapses variable and parameter declaration headers while preserving multiline assigned/default values, moves trailing fluent-chain dots to the next identifier line, moves multiline assignment values, expression bodies, and return expressions to start on the same line as =, =>, and return respectively, collapses multi-line where constraint clauses onto a single line, removes whitespace between named argument parameter names and their :, collapses property/field access chains split across multiple lines onto a single line, moves statement-closing semicolons onto the same line as the statement when they appear on their own line, moves commas to the end of the previous line when they appear at the start of the next line or on their own line, moves the type in an object creation expression to the same line as the new keyword, collapses generic type argument lists spanning multiple lines onto a single line, moves the operand of a cast expression to the same line as the closing parenthesis of the cast, moves the => token to the same line as the lambda parameters when they appear on different lines, and collapses type expressions (generic names, array types, nullable types, pointer types, qualified names, tuple types, and alias qualified names) spanning multiple lines onto a single line true
collapseAutoProperties GM0002 Collapses auto-implemented properties with expanded accessor blocks onto a single line true
addNewLines GM0004, GM0007, GM0022, GM0025, GM0026, GM0027, GM0029, GM0034, GM0040, GM0042, GM0043, GM0053, GM0063, GM0065, GM0066, GM0067, GM0068, GM0069, GM0070, GM0071, GM0072, GM0073, GM0080, GM0117, GM0123, GM0133 Adds missing new lines after attributes, between class members, before opening braces, between arguments/parameters in multi-line lists, before a multiline list's closing parenthesis, enforces first-item next-line placement while keeping ( on the declaration line (GM0027), moves ( to the next line for Allman-style multiline lists (GM0029), moves a multi-line list's first item below ( when needed (GM0034), moves fluent-chain segments onto their own lines for mixed multiline chains (GM0040), inserts a blank line between the last using directive and the next declaration (GM0042), moves each operand in a multi-operand logical expression onto its own line (GM0043), places each generic where constraint clause on its own line (GM0053), expands single-line brace block bodies in methods and lambda expressions across multiple lines (GM0063), expands single-line property accessor lists with non-autoimplemented accessors across multiple lines (GM0069), moves each accessor in a non-autoimplemented property onto its own line (GM0070), inserts a blank line between accessors in non-autoimplemented properties (GM0071), inserts a blank line before a #if directive when it is not the first statement in its block (GM0072), inserts a blank line after a #endif directive when it is not the last statement in its block (GM0073), inserts a blank line before a return statement when it is not the only statement in its block (GM0065), inserts a blank line before block-producing control flow statements (if, switch, for, foreach, while, do, try, lock, using) when they are not the first statement in their enclosing block (GM0066), inserts a blank line after such statements when they are not the last statement in their enclosing block (GM0067), moves each statement onto its own line when multiple statements appear on the same line (GM0068), inserts a blank line before a break statement when it is not the first statement in its block (GM0080), moves each item in multi-line array initializers onto its own line (GM0117), moves each item in multi-line object initializers onto its own line (GM0123), and moves constructor initializer clauses (base(...)/this(...)) onto their own line (GM0133) true
fluentChainLayout GM0041 Moves fluent chain segments onto their own lines when the invocation count meets the threshold (split), or collapses them back to the declaration line when below it (collapse). Threshold is read from dotnet_diagnostic.GM0041.threshold in .editorconfig (default 2). true
parameterArgumentListLayout GM0032, GM0126, GM0127 Handles parameter and argument list layout: for large lists (GM0126/GM0127), moves each parameter/argument onto its own line; for under-threshold lists (GM0126/GM0127) that are split across lines, collapses the entire list back to a single line; for lists on separate lines (GM0032), collapses and moves the list to the same line as the declaration. true
separateAttributes GM0005 Splits comma-separated attributes into one section per line true
addBraces IDE0011, GM0013 Adds braces to control flow statements missing them and wraps switch case block statements in braces true
fixIndentations GM0023, GM0024, GM0028, GM0033, GM0038, GM0045, GM0049, GM0054, GM0077, GM0078, GM0081, GM0115, GM0116, GM0122 Applies correct indentation to lines in multiline argument and parameter lists, to parent types in multiline inheritance clauses (one indent step from the class or interface declaration), to Allman-style opening parenthesis lines in multiline lists, to closing parentheses in multiline lists, to leading dots in multiline fluent-chain segments (one indent step right from the chain start token column), to lambda expression bodies on separate lines from the => token, to wrapped binary operator-expression items (one indent step from the expression start line), to where constraint clauses (one indent step from the containing declaration), to statements inside block bodies (one indent step from the declaration line containing the opening brace), to opening and closing block braces (aligned to the declaration indentation level), to switch case labels (one indent step from the switch keyword line), to constructor initializers (base(...) / this(...)) when split across lines (one indent step from the constructor declaration), to array initializer braces (aligned to the containing declaration indentation level), to array initializer items (one indent step from the containing declaration indentation level), to object initializer braces (aligned to the object instantiation indentation level), and to object initializer members (one indent step from the object instantiation line) true
moveTokens GM0046, GM0058 Moves binary operators reported at the beginning of continuation lines to the end of the previous line, and moves : in inheritance clauses, constructor initializers, and where constraints to the declaration line true
spacing GM0079, GM0082, GM0083, GM0084, GM0085, GM0086, GM0087, GM0088, GM0089, GM0090, GM0091, GM0092, GM0093, GM0094, GM0095, GM0096, GM0097, GM0098, GM0099, GM0100, GM0101, GM0102, GM0103, GM0104, GM0105, GM0106, GM0107, GM0108, GM0109, GM0110, GM0113, GM0114, GM0125 Fixes spacing between adjacent tokens (GM0079), after cast expressions, after control-flow keywords before (, inside method declaration and invocation parentheses, around inheritance-clause colons, around binary operators, between matching parentheses and their inner tokens, between parentheses of empty method declaration and method call parameter lists, between method declaration and method call names and their opening parenthesis, after commas, before commas, after dots, before dots, before opening square brackets, after and before semicolons in for statements, between empty square brackets, between non-empty square brackets and their inner tokens, before generic < symbols, between generic angle brackets and their inner tokens, around ternary operators ? and :, before =>, after =>, between declaration types and identifiers, before assignment =, after assignment =, spaces inside non-empty single-line block braces and accessor lists (GM0113), space between adjacent accessors in single-line properties (GM0114), and space before opening brace { on the same line as its declaration (GM0125) according to the corresponding .editorconfig enabled option true
ordering GM1210 Sorts using directives alphabetically by namespace, with global usings first and System namespaces before others true
explicitObjectCreation GM0129 Adds or removes the class/struct type name in object creation expressions. Controlled by dotnet_diagnostic.GM0129.enabled in .editorconfig: when enabled (default), changes new(...) to new TypeName(...); when disabled, changes new TypeName(...) to new(...) true
addNames GM0131, GM0135 Adds missing names in declarations and call sites: adds explicit field name assignments to anonymous object member declarations (GM0131, e.g. new { foo.Bar } becomes new { Bar = foo.Bar }), and adds parameter names to unnamed arguments in method/constructor calls where at least one argument already uses named syntax (GM0135, e.g. Foo(bar, name: baz) becomes Foo(x: bar, name: baz)) true
bracesStyle GM0020 Fixes opening and closing brace placement violations. For opening braces, moves them to a new line (Allman) or to the declaration line (K&R) based on dotnet_diagnostic.GM0020.style in .editorconfig (defaults to Allman). Closing braces are always moved to their own line. true
inheritanceLayout GM0132 Applies GM0132 threshold layout to inheritance clauses: when the base type count meets the threshold, moves each base type onto its own line (split); when below the threshold, collapses each base type that is on its own line back onto the declaration line (collapse). Threshold is configurable via dotnet_diagnostic.GM0132.threshold in .editorconfig (default: 2). true
emptyArrayCreation GM0142 Replaces Array.Empty<T>() with new T[0] to enforce the preferred empty array creation style when formatting. true
simplifyNullCheck GM0144 Replaces explicit null-check ternary expressions with the null-conditional operator: x != null ? x.M : null and x == null ? null : x.M become x?.M (GM0144) when formatting. true

Releasing

The extension is published to the VS Code Marketplace by the Publish workflow whenever a v* tag is pushed.

One-time setup

  1. Make sure the GAMESMAYER publisher exists at marketplace.visualstudio.com/manage. It must match the publisher field in package.json.
  2. Create an Azure DevOps Personal Access Token with Organization set to All accessible organizations and Scopes set to Marketplace → Manage.
  3. Add the token to the GitHub repository as an Actions secret named VSCE_PAT (Settings → Secrets and variables → Actions).

Publishing a new version

npm version patch # or minor / major
git push --follow-tags

npm version bumps the version in package.json, commits it and creates the matching vX.Y.Z tag. Pushing the tag triggers the workflow, which checks types, lints, tests, builds, packages and publishes the extension, then attaches the .vsix to a GitHub Release.

The tag must match the version in package.json, otherwise the workflow fails before publishing.

Troubleshooting

  • If publishing fails with an authentication error, the PAT has probably expired. Generate a new one and update the VSCE_PAT secret.
  • To retry a failed publish, re-run the failed job from the repository's Actions tab.

License

GAMESMAYER C# Visual Code Extension source code is made available under the MIT license.

Some of the dependencies are licensed differently, with the BSD license, for example.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft