alexkrechik / VSCucumberAutoComplete

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

Finding java step definition present inside jar file #325

Closed jnlp007 closed 2 years ago

jnlp007 commented 4 years ago

Describe the bug The extension is able to navigate to step definition present inside the local repo (*.java) file, but could not identify the step definitions present inside jar file (Intellij plugin is able to do it). Please let me know if I have to add additional config settings.

Cucumberautocomplete part of VSCode settings:

    "cucumberautocomplete.steps": [
        "src/main/java/com/xxx/automation/steps/**/*.java"
    ],
    "cucumberautocomplete.syncfeatures": "src/main/resources/features/**/*feature",
    "cucumberautocomplete.gherkinDefinitionPart": "@(Given|When|Then|And)\\(",
alexkrechik commented 4 years ago

Sorry for the long response. If the issue is still valid for you - is jar file compiled? (extension, actually, working with step files text source). Also, does this jar file satisfy "src/main/java/com/xxx/automation/steps/**/*.java" path? The extension will look through them only.

tarendev commented 3 years ago

Hi, Is there any resolution to this issue ? I am also trying to identify step definitions from jar. It is a compiled jar. I used the path from the original solution from which the jar is build but this extension doesn't recognise any of the steps. In past I had used IntelliJ and its cucumber plugin was able to find steps even from jar files. Is there a way to solve this issue? Any help is appreciated.

okrechyk-gb commented 3 years ago

Unfortunately, actually there are no ability to parse compiled jar due to this is Javascript extensions that works with step definition of any language, but in plain text only.

tarendev commented 3 years ago

@okrechyk-gb Thank you for the quick response. Actually, we don't want to provide uncompiled jar to the user who will write the steps. Is there a workaround ? Maybe if we create a text file with just the step names and let the extension read from it. Later we can have the text file populated programmatically from the jar docs.

okrechyk-gb commented 3 years ago

@okrechyk-gb Thank you for the quick response.

Actually, we don't want to provide uncompiled jar to the user who will write the steps. Is there a workaround ? Maybe if we create a text file with just the step names and let the extension read from it. Later we can have the text file populated programmatically from the jar docs.

Text file with just step names (like 'When(/I do something/)' should works.