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

Scope paths where step definition snippets are generated #242

Open
ibrahimBeladi opened this issue Jul 14, 2024 · 5 comments
Open

Scope paths where step definition snippets are generated #242

ibrahimBeladi opened this issue Jul 14, 2024 · 5 comments
Labels
⚡ enhancement Request for new functionality

Comments

@ibrahimBeladi
Copy link

🤔 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

@ibrahimBeladi ibrahimBeladi 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) Jul 14, 2024
@kieran-ryan kieran-ryan added the ⚡ enhancement Request for new functionality label Jul 15, 2024
@kieran-ryan
Copy link
Member

kieran-ryan commented Jul 15, 2024

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.

@kieran-ryan kieran-ryan 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 Jul 15, 2024
@ibrahimBeladi
Copy link
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
Copy link
Member

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
Copy link
Author

ibrahimBeladi commented Jul 16, 2024

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
Copy link
Member

kieran-ryan commented Jul 16, 2024

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
Labels
⚡ enhancement Request for new functionality
Projects
None yet
Development

No branches or pull requests

2 participants