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

'Run Build Task' activating many extensions #185960

Closed
ulugbekna opened this issue Jun 23, 2023 · 5 comments · Fixed by #187505
Closed

'Run Build Task' activating many extensions #185960

ulugbekna opened this issue Jun 23, 2023 · 5 comments · Fixed by #187505
Assignees
Labels
debt Code quality issues insiders-released Patch has been released in VS Code Insiders on-testplan tasks Task system issues
Milestone

Comments

@ulugbekna
Copy link
Contributor

ulugbekna commented Jun 23, 2023

Description

Running the command Tasks: Run Build Task is activating various unnecessary extensions

TRACE KeybindingService#dispatch ⇧⌘B [ Will dispatch command workbench.action.tasks.build ]
TRACE CommandService#executeCommand workbench.action.tasks.build
TRACE onWillActivateByEvent:  onTaskType:grunt
TRACE onWillActivateByEvent:  onTaskType:gulp
TRACE onWillActivateByEvent:  onTaskType:jake
TRACE onWillActivateByEvent:  onTaskType:npm
TRACE onWillActivateByEvent:  onTaskType:typescript
TRACE onWillActivateByEvent:  onTaskType:eslint
TRACE onWillActivateByEvent:  onTaskType:docker-build
TRACE onWillActivateByEvent:  onTaskType:docker-run
TRACE onWillActivateByEvent:  onTaskType:docker-compose
TRACE onWillActivateByEvent:  onTaskType:dune
TRACE onWillActivateByEvent:  onTaskType:cargo

Version

Version: 1.80.0-insider
Commit: a5727468f373af49f785a94e13e7a2890a1097af
Date: 2023-06-23T05:59:29.272Z
Electron: 22.3.13
ElectronBuildId: 21803499
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.5.0
@ulugbekna ulugbekna changed the title 'Run Build Task 'Run Build Task' activating many extensions Jun 23, 2023
@meganrogge
Copy link
Contributor

This is by design - we have to activate any extensions which contribute tasks to fetch the build tasks, if any, that they contribute.

@ulugbekna
Copy link
Contributor Author

ulugbekna commented Jun 25, 2023

we have to activate any extensions which contribute tasks to fetch the build tasks, if any, that they contribute.

is that the case even if there's a default task configured?

I have a suspicion something has changed because building, for example, vscode repo or just a new extension repo with cmd+shift+b didn't use to activate, e.g., ocaml extension (and there weren't any changes on the ocaml ext side). I would imagine we in general don't need to activate many extensions if there's a default build task?

Screen.Recording.2023-06-25.at.12.50.09.mov

@ulugbekna ulugbekna reopened this Jun 25, 2023
@meganrogge meganrogge added tasks Task system issues debt Code quality issues labels Jun 26, 2023
@meganrogge meganrogge added this to the July 2023 milestone Jun 26, 2023
@meganrogge
Copy link
Contributor

Note to self - this was happening before the change where we resolve workspace tasks

@meganrogge
Copy link
Contributor

This is happening because we check for glob tasks as the default - since we aren't sure which it might be, we have to call getWorkspaceTasks with no args and that activates all task providers

if (absoluteURI) {
const workspaceFolder = this._contextService.getWorkspaceFolder(absoluteURI);
// fallback to absolute path of the file if it is not in a workspace or relative path cannot be found
const relativePath = workspaceFolder?.uri ? (resources.relativePath(workspaceFolder.uri, absoluteURI) ?? absoluteURI.path) : absoluteURI.path;
taskGroupTasks = await this._findWorkspaceTasks((task) => {
const currentTaskGroup = task.configurationProperties.group;
if (currentTaskGroup && typeof currentTaskGroup !== 'string' && typeof currentTaskGroup.isDefault === 'string') {
return (currentTaskGroup._id === taskGroup._id && glob.match(currentTaskGroup.isDefault, relativePath));
}
return false;
});
}
const handleMultipleTasks = (areGlobTasks: boolean) => {

const tasks = await this.getWorkspaceTasks();

@meganrogge
Copy link
Contributor

this originated here #141230

seems like not worth it in most cases. this should probably behind a setting

meganrogge added a commit that referenced this issue Jul 7, 2023
meganrogge added a commit that referenced this issue Jul 10, 2023
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 10, 2023
@meganrogge meganrogge mentioned this issue Jul 24, 2023
3 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues insiders-released Patch has been released in VS Code Insiders on-testplan tasks Task system issues
Projects
None yet
3 participants