vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Snippet generation does not respect configuration

Open Nautigsam opened this issue 2 years ago • 3 comments

👓 What did you see?

I have a cucumber.json file with the snippetInterface setting set to async-await. When I run cucumber the snippets outputed for undefined steps show the use of async function.

When I generate a step from the feature file via the plugin, the step generated uses a synchronous arrow function.

✅ What did you expect to see?

The generated step should use an async function with the function keyword, just as cucumber does in its output.

📦 Which tool/library version are you using?

cucumber-js v8.10.0

🔬 How could we reproduce it?

  1. Create a cucumber.json file with this content:
{
  "default": {
    "formatOptions": {
      "snippetInterface": "async-await"
    }
  }
}
  1. Open vscode with the cucumber plugin loaded.
  2. Write a feature file with undefined steps.
  3. Generate a step from the feature file via the plugin.
  4. See the generated step.

📚 Any additional context?


This text was originally generated from a template, then edited by hand. You can modify the template here.

Nautigsam avatar Apr 01 '23 07:04 Nautigsam

Thanks! Linking the associated Cucumber JS configuration documentation. This will require a change to the Cucumber Language Service to support snippet configuration - see the JavaScript snippet implementation in the language service.

kieran-ryan avatar Dec 30 '23 16:12 kieran-ryan

Any news regarding that ?

despellhtb avatar Mar 28 '24 10:03 despellhtb

@despellhtb, issue is reflective of status. Accommodation has been made in the Cucumber Language Server to configure custom snippet templates, though this setting is not yet fully integrated nor available from the extension; and of course would duplicate the aforementioned configuration - though might be a satisfactory mitigation if implemented.

Hope to see this implemented.

Any PRs or suggested code changes would be of great assistance.

kieran-ryan avatar Apr 01 '24 11:04 kieran-ryan