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

Multi-Root task provider (Add root-directory and workspace-name properties to Task) #120133

Closed
elahehrashedi opened this issue Mar 29, 2021 · 5 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@elahehrashedi
Copy link

elahehrashedi commented Mar 29, 2021

This issue is related to task provider behaviour in a multi-root workspace set up.
Consider this multi-root workspace:
image

and let's say I want to configure a new task for a .cpp file in Root3. This is what I get by running "Configure Task" (the other root's tasks will be shown as well).
image

A similar issue arises when trying to set a default task in Root3. there can be other defaults in every root. but the default is picked from root1.
image

@alexr00 I know you are tracking this issue already. Just for having it all in one place, I put the related issues here:
#111037
#99276 (possibly showing the tasks for the working directory on the top of the list of the tasks, e.g. #89448).
#35312

The same issue may need to be resolved if multiple workspaces is going to be supported:
#43188

@alexr00
Copy link
Member

alexr00 commented Mar 30, 2021

@elahehrashedi you can provide a WorkspaceFolder as the Task scope. Does that solve this for you?

vscode/src/vs/vscode.d.ts

Lines 6576 to 6577 in 02d3809

constructor(taskDefinition: TaskDefinition, scope: WorkspaceFolder | TaskScope.Global | TaskScope.Workspace, name: string, source: string, execution?: ProcessExecution | ShellExecution | CustomExecution, problemMatchers?: string | string[]);

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Mar 30, 2021
@elahehrashedi
Copy link
Author

elahehrashedi commented Mar 30, 2021

@alexr00 kindly, no, that doesn't solve the issue. I have tried both WorkspaceFolder and TaskScope.Workspace.
It partially solves the problem for "Configure Task". but not the "Configure default build task" (It only works if the previous folders don't include a tasks.json file, and don't have a default already)
I have a question as well, were WorkspaceFolder and TaskScope.Workspace added to solve this issue? What is the expected behaviour for each of these scopes?

@elahehrashedi
Copy link
Author

elahehrashedi commented Apr 8, 2021

@alexr00 I modified the report above to show the results when using WorkspaceFolder instead of TaskScope.Workspace.
The problem is still unresolved. :)

@alexr00
Copy link
Member

alexr00 commented Jun 4, 2021

let's say I want to configure a new task for a .cpp file in Root3. This is what I get by running "Configure Task" (the other root's tasks will be shown as well).

It is expect that we show all tasks from all sources when you run "Configure Task". I think this is the correct behavior, though the grouping/sorting could be improved as said in the issue linked (#89448).

The issue you show with default build task is definitely a deficiency. Tracked by #35312, which I will investigate fixing for the June release. Thank you @elahehrashedi for bringing it to my attention!

@alexr00 alexr00 closed this as completed Jun 4, 2021
@alexr00 alexr00 added *duplicate Issue identified as a duplicate of another issue(s) and removed info-needed Issue requires more information from poster labels Jun 4, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants