luan / vscode-project-scopes

Project Scopes extension for VSCode
MIT License
7 stars 3 forks source link

Support for multi-project workspaces #5

Open abingham opened 1 year ago

abingham commented 1 year ago

I'm not sure if this extension is supposed to handle multi-project workspaces, so I may just be using it incorrectly. In any event, I can't make it work with multi-project workspaces. When I try to use the extension while using a workspace, I often see this error:

Project Scopes: the selected scope cannot be applied to any workspace, skipping. Root name: 'my-project'; Workspace name: 'Untitled (Workspace)'

When I use the extension without a multi-project workspace, everything works fine.

Honestly, I'm not 100% sure what this extension would be like for multi-project workspaces. It probably doesn't makes sense to have scopes which apply to multiple projects; at least, this doesn't make sense for my particular use of scopes, though perhaps it's useful for others. What I think I want is to have project-specific scopes which I can activate on a per-project basis.

Lockszmith-GH commented 8 months ago

I get the same error as @abingham. Came here to look for a solution.

It comes from this line

It follows the test below:

const root = await this.heuristicDetectScopeWorkspace(this.scope);
    if (!root || !vscode.workspace.name?.includes(root.name)) {

At least for me, this.heuristicDetectScopeWorkspace(this.scope) seems not to work, unclear yet why that is.