Closed papipsycho closed 6 months ago
Oh ok i understood how is work, so you first check if the function is written or not,
there is anyway to implement a simple linter with getGherkinDiagnostics ?
Hi @papipsycho, welcome 👋
Oh ok i understood how is work, so you first check if the function is written or not,
there is anyway to implement a simple linter with getGherkinDiagnostics ?
The functionality is perhaps clearer when used through the VSCode extension - as we can see the step definitions being matched against; but effectively with this Monaco demo, it demonstrates the functionality of being able to mark steps as undefined or not; though one could replace the diagnostics with a call to another linter for example - providing it adhered to the same API. The diagnostics implementation for Cucumber Monaco is implemented in the Cucumber Language Service.
So in summary, you could replace getGherkinDiagnostics
with a call to another linter. Could you advise what functionalities or linting rules you would desire?
Thanks for your answer.
i want to check if the gherkin written by the user is correct or not, which is not necessarily linked with the step definition
For instance, I want to show an error in case of :
Scenario Outline: login with user and password
When i on login page
Then i set the user and password
Then i click on the button sign in
this should give an error cause is Scenario Outline without example
and I checked deeply in the function getGherkinDiagnostics which unfortunately doesn't have an option to disable the check into the step definition
Gotcha. Configuration for disabling diagnostics is presently unsupported - though could be turned off by overriding that API to not return any diagnostics.
Likewise on listing whether a Scenario Outline does not contain an examples table. There are gherkin linters that support this functionality which could be integrated through some effort; but functionality is not integrated in the Language Service.
You raise valid requests - if something you'd like see, would welcome a PR if you have a direction to resolve. Thanks for your interest in the project! 👍
Closing as behaviour was clarified. Feel free to raise an issue for any feature requests - thanks for your interest in the project @papipsycho!
👓 What did you see?
the linter return When something as en error when it shouldn't be
✅ What did you expect to see?
i shouldn't considair as an error
📦 Which tool/library version are you using?
you can do the test on the live demo
🔬 How could we reproduce it?
go on the live demo and you will see And this is an undefined step, i f you want you can replace it with anything else everytime this line will appear in error
📚 Any additional context?
No response