cucumber / vscode

Official Visual Studio Code Extension for Cucumber
MIT License
66 stars 17 forks source link

@And annotated steps are not see by the autocomplete #147

Closed peterdstone closed 10 months ago

peterdstone commented 1 year ago

👓

@And annotated steps are not see by the autocomplete

✅

auto complete should highlite @And defined steps

📦

io.cucumber:cucumber-java:7.7.0, Java 17, vscode 1.76.1 plugin 1.7.0

🔬 create a java feature file with @And annotated steps

Steps to reproduce the behavior:

  1. add @Annotated method to java class
  2. configure class to be picked up by glue settings
  3. start writing .feature file
  4. try to use step

image

image

📚 Any additional context?

jimmyko commented 1 year ago

@peterdstone I think @And is deprecated https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/docs/faq.md#function-members-and-and-but-are-missing

jeeeem commented 1 year ago

I wanted to this ask too, is this now the current behavior of this as a general standard when working with cucumber, that I have to change all the @And annotated methods to @Given since I cannot use to Go to Definition if I do not did that?

jenisys commented 1 year ago

Mmh, you normally only need @Given, @When and @Then (3 step types). And and But in Gherkin files are only used to state Use the same step-type than before myself. This means, you inherit the step-type from one of the steps before (that is not And or But).

BUT: In the step-implementation, you need to state which step-type is used. This allows you also to change the ordering of steps.

jeeeem commented 1 year ago

Mmh, you normally only need @Given, @When and @Then (3 step types). And and But in Gherkin files are only used to state Use the same step-type than before myself. This means, you inherit the step-type from one of the steps before (that is not And or But).

BUT: In the step-implementation, you need to state which step-type is used. This allows you also to change the ordering of steps.

Okay, so I will take it as yes on my question.

kieran-ryan commented 10 months ago

Closing as per above comments and as the keyword is unsupported in the Cucumber ecosystem by design. However it is possible this support could arrive with an implementation to configure the keywords that the autocompletion matches against (see #146). Thanks for raising!