alexkrechik / VSCucumberAutoComplete

Cucumber (Gherkin) Full Support Extension for VSCode
https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete
MIT License
331 stars 79 forks source link

'Go to Definition' easily breaks from JS code in version 3.0.1/3.0.0 #493

Open alisher-qa opened 4 weeks ago

alisher-qa commented 4 weeks ago

Describe the bug Go to Definition in versions 3.0.1 and 3.0.0 is easily breaking from JS code and points to incorrect files and lines, compared to 2.15.2 version (which also could break in a large project, but less easily and usually for part of the steps instead of all).

To Reproduce Steps to reproduce the behavior:

  1. Clone repo with everything ready for reproducing https://github.com/alisher-qa/cucumber-full-support-ext-bug
  2. Open features/login.feature
  3. Right-click on any of 3 steps and use Go to Definition
  4. See incorrect position

Expected behavior Go to Definition should not break from JS code like object literals, strings and template strings. If you use Install another version in VSCode to install 2.15.2, Go to Definition will work properly in the cloned repo.

Actual behavior

  1. Without any changes after cloning the repo, extension will point you to the data: "", line in constants.js from any of 3 steps in login.feature.
  2. If you comment/remove this data line in constants.js, or replace empty string to a number, or make a change in .vscode/settings.json from /*.js variant to /*steps.js (making extension ignore constants.js), then you will be pointed to the first template string in custom-steps.js.
  3. If you comment/remove the first template string, then it will point to 2nd, then 3rd, then 4th.
  4. Only after you comment/remove all 4 lines, extension will start to point to the correct step definitions in default-steps.js.

Screenshots image image