src/vs/workbench/api/common/extHostExtensionService.ts/AbstractExtHostExtensionService/_deactivate
class AbstractExtHostExtensionService:	private _deactivate(extensionId: ExtensionIdentifier): Promise<void> {
		let result = Promise.resolve(undefined);

		if (!this._readyToRunExtensions.isOpen()) {
			return result;
		}

		if (!this._activator.isActivated(extensionId)) {
			return result;
		}

		const extension = this._activator.getActivatedExtension(extensionId);
		if (!extension) {
			return result;
		}

		// call deactivate if available
		try {
			if (typeof extension.module.deactivate === 'function') {
				result = Promise.resolve(extension.module.deactivate()).then(undefined, (err) => {
					this._logService.error(err);
					return Promise.resolve(undefined);
				});
			}
		} catch (err) {
			this._logService.error(`An error occurred when deactivating the extension '${extensionId.value}':`);
			this._logService.error(err);
		}

		// clean up subscriptions
		try {
			dispose(extension.subscriptions);
		} catch (err) {
			this._logService.error(`An error occurred when deactivating the subscriptions for extension '${extensionId.value}':`);
			this._logService.error(err);
		}

		return result;
	}