vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Omit quotations from string parameter suggestions

Open znevrly opened this issue 2 years ago • 2 comments

👓 What did you see?

When there is a step with Cucumber expression {string} then after selecting this suggestion:

  1. all text including double quotes is selected
  2. VS code is suggesting some values for parameter itself (I didn't find out what is mechanism e.g from currently opened file etc)

image

image

✅ What did you expect to see?

  1. only text inside double quotes is selected
  2. default value should be just empty string because there is very little chance to have valid suggestion for parameter

Surprisingly it works for regular expression e.g /^PATCH request to "(.*)" with body:$/ Also it's ok with Cucumber expression {int} because there is no need for double quotes.

📦 Which tool/library version are you using?

Cucumber plugin: v1.7.0, VS code: 1.74.2

🔬 How could we reproduce it?

Steps to reproduce the behavior:

Install Cucumber extension v1.7 onto latest VS Code Have step definition with Cucumber expression {string} Create any feature file Use autocomplete suggestion for this step

znevrly avatar Jan 05 '23 12:01 znevrly

Hi @znevrly, the completions are built from your glue files (where your step definitions are defined) and gherkin steps from your feature files.

Looks like would be a nice developer experience enhancement - will update title to reflect and label accordingly. Thanks!

kieran-ryan avatar Dec 02 '23 15:12 kieran-ryan

As an addendum to this, certainly in my sample Java project, The autocomplete does not seem to add quotes at all.

    @Given("a step uses a {string}")
    public void stringTest(String test){

    }

Image

And even worse, if you type something and hit ENTER, it then replaces it with a ?

Image So you need to type something, hit ESCAPE, then hit enter

evilC avatar Apr 04 '25 11:04 evilC