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

Default glue paths should support multi-root and nested workspaces #117

Open
zohnannor opened this issue Oct 19, 2022 · 2 comments
Open
Labels
⚑ enhancement Request for new functionality

Comments

@zohnannor
Copy link

zohnannor commented Oct 19, 2022

πŸ‘“ What did you see?

When I open a workspace that has tests/features/* structure somewhere in it, every step is marked as Undefined.

image

βœ… What did you expect to see?

Should the extension use the settings...

{
    "cucumber.glue": [
        "src/test/**/*.java",
        "features/**/*.ts",
        "features/**/*.tsx",
        "features/**/*.php",
        "features/**/*.py",
        "tests/**/*.py",
        "tests/**/*.rs",
        "features/**/*.rs",
        "features/**/*.rb",
        "*specs*/**/.cs"
    ]
}

...to find the specified structure across the opened workspace and associate .feature files with corresponding matchers? Users currently have to tune their local workspace settings:

// in a local .vscode/settings.json
{
    "cucumber.glue": [
        "path/to/dir/tests/**/*.ext"
    ]
}

... so that extension can find the matchers.

πŸ“¦ Which tool/library version are you using?

Name: Cucumber
Id: CucumberOpen.cucumber-official
Description: Cucumber for Visual Studio Code
Version: 1.5.1
Publisher: Cucumber
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=CucumberOpen.cucumber-official

πŸ”¬ How could we reproduce it?

Move the tests/features/ dir (and possibly re-configure your build system for this change) in some nested dir, not in the top-level dir, observe the Undefined step and no goto definition in the editor for every step in the .features files. Default VScode settings.

MRE: https://github.com/zohnannor/cucumber-vscode-mre/tree/workspace


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

@zohnannor zohnannor changed the title workspace Nested file structure Oct 19, 2022
@aslakhellesoy
Copy link
Contributor

Are you suggesting we add ./**/ to the beginning of every cucumber.glue glob? While it might fix your problem without having to change any settings, it might also slow down the scanning if there are many files in your workspace. It's primarily limited by how fast the globbing library works, which I haven't benchmarked.

Not sure what to do about this one...

@kieran-ryan kieran-ryan added the ⚑ enhancement Request for new functionality label Dec 30, 2023
@kieran-ryan kieran-ryan changed the title Nested file structure Default glue paths should support multi-root and nested workspaces Dec 30, 2023
@kieran-ryan
Copy link
Sponsor Member

kieran-ryan commented May 14, 2024

Benchmarked the fast-glob globbing library used by the Language Server through the node-glob benchmark.

Starting glob patterns with **/ is about 10x times slower (0.074s -> 0.732s) for synchronous operations and 16x times slower (0.067s -> 1.101s) running asynchronously.

This benchmark suite contains significantly more files than would be contained within a typical Cucumber environment repository, so would not be as drastic in practice. Although it should be possible to support this request, we would first need to optimise existing performance (#152) - particularly how we watch and read files; allowing us to offset the slower globbing and provide a better out-of-the-box experience.

--- pattern: 'features/**/*.js' ---
~~ sync ~~
node fast-glob sync             0m0.074s  0
node globby sync                0m0.093s  0
node current globSync mjs       0m0.093s  0
node current glob syncStream    0m0.076s  0
~~ async ~~
node fast-glob async            0m0.067s  0
node globby async               0m0.088s  0
node current glob async mjs     0m0.068s  0
node current glob stream        0m0.069s  0

--- pattern: './**/features/**/*.js' ---
~~ sync ~~
node fast-glob sync             0m0.732s  0
node globby sync                0m0.685s  0
node current globSync mjs       0m0.966s  0
node current glob syncStream    0m1.103s  0
~~ async ~~
node fast-glob async            0m1.101s  0
node globby async               0m1.275s  0
node current glob async mjs     0m1.008s  0
node current glob stream        0m1.302s  0

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

3 participants