-
Notifications
You must be signed in to change notification settings - Fork 11
Add 'and' keyword autoformatting #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
gasparnagy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx. It is generally good and works well - thank you.
I have noted a few smaller issues - see the separate comments for that.
Besides those I have one more request:
Please add a test to the specs project to the Editor/Commands/AutoFormatDocumentCommand.feature file. I have checked and adding this to the end of the file would be fine and enough:
Rule: Auto format should replace repeated keywords with "And"
Scenario: Repeating keywords are replaced with "And"
Given there is a Reqnroll project scope
And the following feature file in the editor
"""
Feature: Addition
Scenario: Add two numbers
Given I have entered 50 into the calculator
Given I have entered 70 into the calculator
When I add them
When I check the result
Then there should be no error
Then the result should be 120
"""
When I invoke the "Auto Format Document" command without waiting for the tag changes
Then the editor should be updated to
"""
Feature: Addition
Scenario: Add two numbers
Given I have entered 50 into the calculator
And I have entered 70 into the calculator
When I add them
And I check the result
Then there should be no error
And the result should be 120
"""
Reqnroll.VisualStudio/Editor/Services/Formatting/GherkinDocumentFormatter.cs
Outdated
Show resolved
Hide resolved
Reqnroll.VisualStudio/Editor/Services/Formatting/GherkinDocumentFormatter.cs
Outdated
Show resolved
Hide resolved
Reqnroll.VisualStudio/Editor/Services/Formatting/GherkinFormatSettings.cs
Outdated
Show resolved
Hide resolved
Reqnroll.VisualStudio/ProjectSystem/Configuration/ProjectScopeDeveroomConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
e5b8024 to
da3ebbe
Compare
1ff799f to
15b8379
Compare
gasparnagy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super, thx.
|
Dear Reqnroll Team, First of all, I’d like to sincerely thank you for the incredible work and dedication you’ve put into this project — it’s truly appreciated. I’m reaching out to kindly ask if you could provide some guidance on how to disable the feature that automatically replaces repeated step keywords (like Given, When, Then) with And during formatting. I’d love to preserve the original keywords in my .feature files. So, far I have unsuccessfully explored all the configs of Any help or direction you could offer would be greatly appreciated! |
|
@EuSiUnicredit This is currently not possible. We have infrastructure for this, see GherkinFormatSettings and how it is used, but no particular setting for this. Would you be willing to try adding this feature and send a PR for it? |
|
@gasparnagy I've checked files and seems not that hard. |
🤔 What's changed?
Update auto formatting to replace sequential equivalent keywords with the
Andkeyword⚡️ What's your motivation?
New feature
🏷️ What kind of change is this?
📋 Checklist: