drweb86 / Gherkin-Beautifier-VS-Code-Plugin

Gherkin Beautifier VS-Code Plugin
MIT License
0 stars 0 forks source link

Add support for Doc Strings, "*" keyword #29

Closed rc2201 closed 8 months ago

rc2201 commented 8 months ago

If * is used for any step instead of the keyword, the feature file does not get auto-indented. Same behavior is observed for """ (Doc Strings) and # (Comments) symbols.

rc2201 commented 8 months ago

Hi @drweb86, I noticed this project has not had any update in a while. So wanted to check if it is still active and if this issue will be looked into.

Thanks

drweb86 commented 8 months ago

Hi.

I don't understand what's the issue is. What is wrong with """ (Doc Strings) and # (Comments) symbols. Pehaps you can describe it better with example files attached, what's wrong, what is right etc.

rc2201 commented 8 months ago

Hi @drweb86, here is the example code to replicate the issue along with the screenshots.

Feature:

Background:
* url 'https://jsonplaceholder.typicode.com'
Given url 'https://jsonplaceholder.typicode.com'

Scenario: get all posts
Given path 'posts'
When method get
Then status 200
* print response
And print response

Scenario: Create a posts
Given params {postId:1}
Given path 'comments'
And request
"""
{
title: 'foo',
body: 'bar',
userId: 1,
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
},
}
"""
When method Post
Then status 201

In the screenshot before saving, I kept everything indented to the leftmost. After I click on the save, statements starting with * and """ do not get auto-indented as per the value I set in the plugin. All other statements starting with Given, Then, When, And get auto-indented ( Refer to the highlighted statements in screenshot after saving)

Before Saving After Saving

drweb86 commented 8 months ago

I got it. You want to have support for indentation for eature files

a. Doc strings ( https://www.programsbuzz.com/article/doc-strings-cucumber ). b. * Keyword.

And currently you see that they are being ignored.

rc2201 commented 8 months ago

Yes, imo, these should be treated as any other step would be.

drweb86 commented 8 months ago

Added

rc2201 commented 8 months ago

Hi @drweb86 , i tried installing version 2024.1.10 using VSIX but it seems it is not compatible with latest VSCode version. Attaching the screenshot for refrence.

Screenshot 2024-01-10 at 9 17 36 AM
drweb86 commented 8 months ago

@rc2201 Update your VS Code first via Help \ Check for updates, I put into manifest minimum version 1.85.1.

rc2201 commented 8 months ago

Thanks @drweb86 , that resolved the issue. Appreciate the quick turnaround on enhancement request.