Skip to content

GoTestResolver: Limit scope of indexing to the package level instead of entire workspace/module #2504

Closed as not planned
@mnoah1

Description

@mnoah1

Is your feature request related to a problem? Please describe.
When working in a large monorepo, the test explorer indexes indefinitely as it attempts to discover every test in the monorepo. Even after the tests in the currently open package are displayed, it continues to spin and slowly populate other packages which may not be relevant to the user's current work.

Describe the solution you'd like
Adjust the resolve method in GoTestResolver. Add a new configuration setting that optionally skips the step of finding all packages in the workspace, so tests will only get added if part of the user's active package.

Describe alternatives you've considered
Potentially more complex logic that lets a user configure the projects that are relevant to them to be included in indexing.

Additional context
Below is the block of code in goTest/resolve that could go behind a conditional. I can contribute this change if you're good with it.

if (kind === 'module' || kind === 'workspace') {
    await walkPackages(this.workspace.fs, item.uri, async (uri) => {
        await this.getPackage(uri);
    });
}

Metadata

Metadata

Assignees

Labels

FeatureRequestWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.go-testissues related to go test support (test output, test explorer, ...)

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions