VS Code - Cucumber - 导航单击功能命令以进行步骤定义

VS Code - Cucumber - navigate clicking the feature command to step definition

在 VS Code 中,我安装了 Full Cucumber 支持插件,但我无法通过单击功能命令跳转到功能文件中的步骤定义。

我所有的功能文件都在以下子文件夹中:

cypress/integration/features/folderName1/feature1.feature
cypress/integration/features/folderName2/feature2.feature

等等

我所有的步骤定义文件都在:

cypress/support/step_definitions/folderName1/stepdef1.js
cypress/support/step_definitions/folderName2/stepdef2.js

等等

在 settings.json 我有这个:

 "cucumberautocomplete.steps": [
        "cypress/support/step_definitions/**/*.js"
    ],
    "cucumberautocomplete.syncfeatures": "cypress/integration/features/**/*.feature",
    "cucumberautocomplete.strictGherkinCompletion": true

但它不适用于功能文件中的任何步骤,例如:无法找到“当我单击 link 时”的步骤

好的,终于找到问题所在了。我有一个工作区,其中包含 2 个在 VS Code 中创建的项目。仅当 cypress 项目在工作区中位于第一位时,扩展才有效。

所以我更改了工作区中项目的顺序,现在单击功能命令跳转到步骤定义!