Skip to content

Scope paths where step definition snippets are generated #242

Open
@ibrahimBeladi

Description

🤔 What's the problem you've observed?

When using a package that provides a list of gherkins, and when having custom gherkin, then the step definition will suggest both the package's step definition files and the local files. Where it should be only the local files, or a specified list of files.

"cucumber.glue": [
    // writable
    "uuv/cucumber/**/*.ts",

    "node_modules/@uuv/*/src/cucumber/step_definitions/*/unsafe/**/_en-*.ts",
    "node_modules/@uuv/*/src/cucumber/step_definitions/*/generated/en/*.ts",
    "node_modules/@uuv/*/src/cucumber/step_definitions/*/generated/enriched/*/*.ts"
  ],

image

✨ Do you have a proposal for making it better?

I am thinking of 2 solutions:

  • Split the glue property into 2 properties
  • Make the glue property allow having object syntax, where we can add a key called showInAutoCompletion or something similar

📚 Any additional context?

I am using uuv, so this issue is not wide spread yet

Activity

changed the title Seperating the glue into 2 properties, when with only read-only, the other can be written into Seperating the glue into 2 properties (one with only read-only, the other can be written into) on Jul 14, 2024
kieran-ryan

kieran-ryan commented on Jul 15, 2024

@kieran-ryan
SponsorMember

Thanks for your interest in the project @ibrahimBeladi! To ensure clarity on your feature request, could you advise whether I am correct in stating that the request is to: scope paths where step definition snippets can be generated.

changed the title Seperating the glue into 2 properties (one with only read-only, the other can be written into) Scope paths where step definition snippets are generated on Jul 15, 2024
ibrahimBeladi

ibrahimBeladi commented on Jul 16, 2024

@ibrahimBeladi
Author

Hello @kieran-ryan, I think yes. But let me further clarify just in case.

In the image that I included in the original post, you can see that there are many paths that are suggested to write into, however some of them are unhealthy to write into (the ones in node_modules). The tops ones will not be written into, and only the last 3 will be writable, or I can configure which ones of the 3 are writable in the configuration.

So, what I am suggesting some paths to be writable, and some paths are not. In this case, when I set a path to be not writable, then it would be shown in the auto-completion of snippets, but not shown in the generation/creation of new step definition.

kieran-ryan

kieran-ryan commented on Jul 16, 2024

@kieran-ryan
SponsorMember

Perfect, is clear @ibrahimBeladi.

In that case, would suggest we keep the 'glue' section as-is and provide additional configuration to scope the paths for snippet generation (which should default to the configured 'glue' paths). Are you aware of any libraries or extensions with similar path configuration that we could take a look at as a point of reference?

Support would need to be implemented in the Cucumber Language Server. If this is an implementation you would be interested to open a PR on (even partially) I would be happy to support you with it. Otherwise feel free to drop any relevant information here that you feel would be useful for someone if they were to pick up this issue. Appreciate the support!

ibrahimBeladi

ibrahimBeladi commented on Jul 16, 2024

@ibrahimBeladi
Author

Unfortunately I don't know of a similar path configuration. What would you recommend the key/name for the new property?

I think I can work on it, but I don't have enough time. If no one picks this up, then I might eventually create a PR for it.

kieran-ryan

kieran-ryan commented on Jul 16, 2024

@kieran-ryan
SponsorMember

Potentially snippet.paths: [] or snippetPaths: [], though we can return to the naming once we have a solution.

I think I can work on it, but I don't have enough time. If no one picks this up, then I might eventually create a PR for it.

No worries, if you pick it up at any stage and raise a PR, will support you on it - thanks again, good to have this captured!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Scope paths where step definition snippets are generated · Issue #242 · cucumber/vscode