drweb86 / Gherkin-Beautifier-VS-Code-Plugin

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

Custom keywords and symbols #30

Open reikolydia opened 2 months ago

reikolydia commented 2 months ago

I have a couple of custom keywords and symbols. But i dont see a way to add these.

Two of them: Meta: There is a space after these 3 symbols, and there are text afterwards. Basically comments for JIRA's user stories. !--

Would be nice if i can add custom keywords and symbols in the settings.json file.

drweb86 commented 2 months ago

Block comments

Gherkin does not support block comments. If you need block comments, it's out of scope of feature files. Because you are basically creating a new file format. You can use # character for comments. Add # before each line of comment. If you need support for single line comments it - i can add it.

Use case then might look like this. You paste story, then select it and press Ctrl+K+V - and vs code will append # chars in theory. Then you press save and they will be with some delimiter.

Meta:

I propose for this scenario use tags. Tags start with @ character. Like @JIRA-XXX . Tags allow to control which scenarios to execute if you use cucumber for example. Another suggestion is to use comments, like # https://app.jira.com/XXX-111 In this case VS code can show link and u will have code navigation via mouse clock.

In general

Regarding comments and stories I see you are using features files as kind of more than just scenarios - like knowledge base. For your usage scenario Cucumber offers markdown file with built-in scenarios support. See this link

https://github.com/cucumber/gherkin/blob/main/MARKDOWN_WITH_GHERKIN.md

I propose for you to investigate if it suits this project better, because apart from proper formatting you will have better visual experience with VS Code markdown previoew extensions (u will never read markdown source). Also major VCS like Azure DevOps - provide efficient way to preview markdown files. So your markdown files can be viewed by even business people.

What do you think about it.