Skip to content

Fix indentation in generated step definition classes#144

Merged
304NotModified merged 4 commits intosupport-file-scoped-namespacesfrom
copilot/sub-pr-140-again
Dec 16, 2025
Merged

Fix indentation in generated step definition classes#144
304NotModified merged 4 commits intosupport-file-scoped-namespacesfrom
copilot/sub-pr-140-again

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

Generated step definition classes had closing braces incorrectly concatenated on the same line, producing malformed code like } } for block-scoped namespaces and }} for file-scoped namespaces.

Root cause: The code generator used StringBuilder.Append() instead of AppendLine() when appending the step definition snippet, causing the class closing brace to appear on the same line as the method's closing brace.

Changes:

  • DefineStepsCommand.cs: Changed template.Append(adjustedSnippet) to template.AppendLine(adjustedSnippet) in GenerateStepDefinitionClass()
  • Updated approval test expectations to reflect corrected formatting

Before:

        throw new PendingStepException();
    }    }  // Block-scoped: extra spaces between braces
}

    }}  // File-scoped: concatenated braces

After:

        throw new PendingStepException();
    }
    }  // Block-scoped: proper line break and indentation
}

    }
}  // File-scoped: proper line break

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 16, 2025 20:06
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 16, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add support for file scoped namespace declarations Fix indentation in generated step definition classes Dec 16, 2025
Copilot AI requested a review from 304NotModified December 16, 2025 20:11
@304NotModified 304NotModified marked this pull request as ready for review December 16, 2025 20:12
@304NotModified 304NotModified merged commit 7107c99 into support-file-scoped-namespaces Dec 16, 2025
@gasparnagy gasparnagy deleted the copilot/sub-pr-140-again branch December 17, 2025 16:41
gasparnagy added a commit that referenced this pull request Jan 27, 2026
* Support csharp_style_namespace_declarations = file_scoped

* Update CHANGELOG.md

* extract GenerateStepDefinitionClass and add snapshot tests

* Fix indentation in generated step definition classes (#144)

* Initial plan

* Fix indentation in generated step definition classes

Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>

* Complete indentation fix - all checks passed

Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>

* Remove accidentally committed nuget.exe binary

Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>

* Remove nuget.exe from .gitignore

Remove nuget.exe from .gitignore

* Fix typo in CHANGELOG for namespace support

* refactor

* fix changelog

* small cleanup

* fix: load the editor config through the right project

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Gáspár Nagy <gaspar.nagy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants