Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with undefined steps on Windows #78

Closed
Kevin-Irias-vectorsolutions opened this issue Jun 1, 2022 · 7 comments · Fixed by cucumber/language-server#57
Closed

Comments

@Kevin-Irias-vectorsolutions
Copy link

Kevin-Irias-vectorsolutions commented Jun 1, 2022

👓 What did you see?

If i have an undefined step using When or Given, and then select the "Define in filepath..." option, when i click that contextual menu option, nothing happens. Also when trying to use the autocomplete, it is not displaying suggestions accordingly. Go to definition doesn;t work as well.

✅ What did you expect to see?

It should add for example a When or Given block to that file and should highlight and navigate correctly to definitions

📦 Which tool/library version are you using?

Typescript 4.x, using cucumber 7.3.1

🔬 How could we reproduce it?

Steps to reproduce the behavior:

  1. Use Windows 11
  2. Use VS Code 1.67.2
  3. Install Cucumber extension
  4. In the workspace settings of a project have the following piece of config:
    "cucumber.glue": [ "steps/**/*.ts", ],
  5. Have a folder structure similar to this:
    --> features/e2e/.feature
    --> steps/e2e/
    .ts'
  6. See error
    image
    The path that is referencing looks like "\\e:**\steps\e2e\login.steps.ts\", and it is being treated by vs code as a directory

📚 Any additional context?

This is the folder structure being used for features and steps being in the root of the project
image


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

@aslakhellesoy
Copy link
Contributor

Hi @Kevin-Irias-vectorsolutions - are you able to share the VSCode output logs for "Cucumber Language Server"?

@Kevin-Irias-vectorsolutions
Copy link
Author

Kevin-Irias-vectorsolutions commented Jun 2, 2022

@aslakhellesoy this is the content i see in the output after performing the Go to definition in a Given line inside a .feature file, also at that point it doesn't highlight the whole line for the step name at all. Also from the server logs i notice that the quantity of features and steps seem to be correct.

[Info  - 5:32:33 PM] Initializing connection from Visual Studio Code 1.67.2
[Info  - 5:32:33 PM] Root path   : d:\Automation\Github\automated-testing-project
[Info  - 5:32:33 PM] Current dir : d:\Automation\Github\automated-testing-project
[Info  - 5:32:33 PM] Registering request handler for workspace/didChangeConfiguration failed.
[Info  - 5:32:33 PM] Client does not support client/registerCapability. This is OK.
[Info  - 5:32:33 PM] Cucumber Language Server 0.12.9 initialized
[Info  - 5:32:33 PM] Scheduling reindexing in 3000 ms
[Info  - 5:32:33 PM] Reindexing...
[Info  - 5:32:33 PM] * Found 22 feature file(s) in ["features/**/*.feature"]
[Info  - 5:32:33 PM] * Found 558 steps in those feature files
[Info  - 5:32:33 PM] * Found 26 glue file(s) in ["steps/**/*.ts"]
[Info  - 5:32:34 PM] * Found 0 parameter types in those glue files
[Info  - 5:32:34 PM] * Found 275 step definitions in those glue files
[Info  - 5:32:35 PM] * Built 265 suggestions for auto complete
[Info  - 5:32:36 PM] Reindexing...
[Info  - 5:32:36 PM] * Found 22 feature file(s) in ["features/**/*.feature"]
[Info  - 5:32:36 PM] * Found 558 steps in those feature files
[Info  - 5:32:36 PM] * Found 26 glue file(s) in ["steps/**/*.ts"]
[Info  - 5:32:37 PM] * Found 0 parameter types in those glue files
[Info  - 5:32:37 PM] * Found 275 step definitions in those glue files
[Info  - 5:32:37 PM] * Built 265 suggestions for auto complete
[Info  - 5:33:52 PM] Scheduling reindexing in 3000 ms
[Info  - 5:33:55 PM] Reindexing...
[Info  - 5:33:55 PM] * Found 22 feature file(s) in ["features/**/*.feature"]
[Info  - 5:33:55 PM] * Found 558 steps in those feature files
[Info  - 5:33:55 PM] * Found 26 glue file(s) in ["steps/**/*.ts"]
[Info  - 5:33:56 PM] * Found 0 parameter types in those glue files
[Info  - 5:33:56 PM] * Found 275 step definitions in those glue files
[Info  - 5:33:56 PM] * Built 265 suggestions for auto complete

@teggr
Copy link

teggr commented Jun 21, 2022

Hi, I'm also seeing this issue with the following configuration for my Java / Maven project.

I'm using the default settings provided by the plugin.

  • Windows 10
  • VS Code 1.68.1
  • Cucumber Plugin v1.2.7

The highlighting in the feature editor works correctly as does the problems window.

However, when navigating from the feature file to the step definitions I also get an error page where the editor path has suffixed a slash to the end \ like `\c:.....\StepDefinitions.java'

image

This also appears to affect the quick fix functionality for creating the step definitions too. No step def is created.

@aslakhellesoy
Copy link
Contributor

Thanks - I'll be able to look into this when I find time to set up a Windows VM on my Mac. I could use some help from people who are already using Windows...

@rbelando
Copy link

rbelando commented Jul 8, 2022

@aslakhellesoy Do you know when this issue is going to be fixed?

@aslakhellesoy
Copy link
Contributor

aslakhellesoy commented Jul 8, 2022

@rbelando I don't know. All I can say I'm probably not going to fix it until August/Sept, but anyone else is free to submit a fix.

@rbelando
Copy link

@rbelando I don't know. All I can say I'm probably not going to fix it until August/Sept, but anyone else is free to submit a fix.

@aslakhellesoy No issues. I've created a PR that fixes the problem.

cucumber/language-service#73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants