Skip to content

Conversation

@304NotModified
Copy link
Member

@304NotModified 304NotModified commented Dec 14, 2025

🤔 What's changed?

Generated file scoped namespaces when set in .editorconfig

Normally "create" generates this:

namespace MyNamespace.StepDefinitions
{
    [Binding]
    public class CalculatorStepDefinitions
    {
        [Given("the first number is {int}")]
        public void GivenTheFirstNumberIs(int p0)
        {
            throw new PendingStepException();
        }

With

# C# files
[*.cs]
csharp_style_namespace_declarations = file_scoped:suggestion

We get this:

namespace MyNamespace.StepDefinitions;

[Binding]
public class CalculatorStepDefinitions
{
    [Given("the first number is {int}")]
    public void GivenTheFirstNumberIs(int p0)
    {
        throw new PendingStepException();
    }

In VS config:
image

⚡️ What's your motivation?

Keep the code style from the editorconfig.

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "[vNext]" section of the CHANGELOG, linking to this pull request & included my GitHub handle to the release contributors list.

This text was originally taken from the template of the Cucumber project, then edited by hand. You can modify the template here.

@304NotModified 304NotModified changed the title Support csharp_style_namespace_declarations = file_scoped Support file_scoped namespace declarations when generating code Dec 14, 2025
@304NotModified 304NotModified marked this pull request as ready for review December 16, 2025 19:19
@reqnroll reqnroll deleted a comment from Copilot AI Dec 16, 2025
Copilot AI and others added 2 commits December 16, 2025 21:13
* 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
@304NotModified 304NotModified changed the title Support file_scoped namespace declarations when generating code Support file scoped namespace declarations when generating code Dec 17, 2025
@304NotModified 304NotModified marked this pull request as draft December 17, 2025 01:30
@reqnroll reqnroll deleted a comment from Copilot AI Dec 17, 2025
@304NotModified 304NotModified marked this pull request as ready for review December 17, 2025 21:42
@304NotModified
Copy link
Member Author

This is ready for review. I tested it locally and added snapshot tests :)

Copy link
Contributor

@gasparnagy gasparnagy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've scanned it through and it looks cool! I'll make a more detailed review during my holidays.

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.

3 participants