cucumber / language-server

Cucumber Language Server
MIT License
33 stars 19 forks source link

Getting undefined step while using nvim with mason #103

Closed kenken17 closed 4 months ago

kenken17 commented 4 months ago

Hi, I have installed the languages server via mason. And getting undefined step. Anyone having the same issue? I assume is my setup issue, I can see the LS is running when i fire up my .feature file. But getting the undefined steps for all the steps.

Any help is welcome. :D

kieran-ryan commented 4 months ago

Hey @kenken17, thanks for your interest in this project and for raising an issue.

Would it be possible to provide a Minimum Reproducible Example, in terms of any settings, a step definition (and path where is stored), a feature file (and path where is stored); and any supporting information (such as logs from the Cucumber Language Server, screenshots, etc.), tool and operating system versions; programming language of the step definitions; and so forth - anything that may support debugging the issue.

Some areas that can cause issues with steps being marked 'undefined' can include:

kenken17 commented 4 months ago

Hey @kenken17, thanks for your interest in this project and for raising an issue.

Would it be possible to provide a Minimum Reproducible Example, in terms of any settings, a step definition (and path where is stored), a feature file (and path where is stored); and any supporting information (such as logs from the Cucumber Language Server, screenshots, etc.), tool and operating system versions; programming language of the step definitions; and so forth - anything that may support debugging the issue.

Some areas that can cause issues with steps being marked 'undefined' can include:

  • Are your feature files and step definitions stored in a path relative to those specified in reasonable default settings? If not, you may need to configure these settings.
  • Is the language you are using supported by the Language Server (see default settings)? In some languages, there can be issues or variations in detecting the step definitions.

Hi thanks for the reply. I think it would be hard for me to reproduce a subset of the project. Since i dont have much knowledge on the project setup.

Regards the feature and steps location, I have checked the default setting, both are in proper location, 'src/test/**/*.feature', and 'src/test/**/*.java',. We are using java.

But now i found out, not all the steps are undefined. I found out all the steps in /global folder are undefined, tough this global/ folder is still within the default paths. i.e src/test/gloabl/reusable/*.java

kieran-ryan commented 4 months ago

Thanks @kenken17, so if I understand correctly, some of the step definitions are getting detected.

Would you be able to provide an example of a step definition which is not getting detected? What decorators are used with these step definitions e.g. we presently only detect @Given, @When and @Then for Java. If you can construct a small example or provide examples that would be great. Would need more information to debug this.

kenken17 commented 4 months ago

Hi @kieran-ryan, the step is like @Then("^I should see the title of landing page is \"(.*)\"$"). weird that only steps in this folders are not detected.

kieran-ryan commented 4 months ago

@kenken17, potentially looks related to an existing issue with handling escaped quotations in Java (cucumber/language-service#172), rather than where it is located. Interested to know whether there is any output log you have observed.

For instance, if you modify the above definition to @Then("^I should see the title of landing page$") and have a step Then I should see the title of landing page, is it considered 'defined' (not underlined)?

kenken17 commented 4 months ago

Yup! I have tried that. without any escape sequences. But too bad, still undefined step. that lead me to think it is folder specific... thanks @kieran-ryan. I will give it a pass now, while keep an eye looking around. Appreciate your help. Can make this as close. Bless.