src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts/ExtensionEnablementService/setEnablement
class ExtensionEnablementService:	async setEnablement(extensions: IExtension[], newState: EnablementState): Promise<boolean[]> {

		const workspace = newState === EnablementState.DisabledWorkspace || newState === EnablementState.EnabledWorkspace;
		for (const extension of extensions) {
			if (workspace) {
				this.throwErrorIfCannotChangeWorkspaceEnablement(extension);
			} else {
				this.throwErrorIfCannotChangeEnablement(extension);
			}
		}

		const result = await Promises.settled(extensions.map(async e => {
			if (this.getEnablementState(e) === EnablementState.DisabledByTrustRequirement) {
				const trustState = await this.workspaceTrustRequestService.requestWorkspaceTrust();
				return trustState ?? false;
			} else {
				return this._setUserEnablementState(e, newState);
			}
		}));

		const changedExtensions = extensions.filter((e, index) => result[index]);
		if (changedExtensions.length) {
			this._onEnablementChanged.fire(changedExtensions);
		}
		return result;
	}