vscode icon indicating copy to clipboard operation
vscode copied to clipboard

'Run Build Task' activating many extensions

Open ulugbekna opened this issue 2 years ago • 5 comments

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 avatar Jun 23 '23 08:06 ulugbekna

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

meganrogge avatar Jun 23 '23 15:06 meganrogge

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?

https://github.com/microsoft/vscode/assets/16353531/f8b6dc0d-dde9-4b84-a529-7a9fa5501245

ulugbekna avatar Jun 25 '23 10:06 ulugbekna

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

meganrogge avatar Jun 26 '23 15:06 meganrogge

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

https://github.com/microsoft/vscode/blob/e55c82224d9a0b3c89226f81c1f29c87bbd561e9/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts#L2942-L2957

https://github.com/microsoft/vscode/blob/e55c82224d9a0b3c89226f81c1f29c87bbd561e9/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts#L696

meganrogge avatar Jul 07 '23 20:07 meganrogge

this originated here https://github.com/microsoft/vscode/pull/141230/

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

meganrogge avatar Jul 07 '23 21:07 meganrogge