don't disable the current remote resolve when bisect'ing extensions, fixes https://github.com/microsoft/vscode/issues/112473

This commit is contained in:
Johannes Rieken
2020-12-18 10:03:18 +01:00
parent 2c83509a15
commit 63d49f6a13
@@ -21,6 +21,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
import { ILogService } from 'vs/platform/log/common/log';
import { IProductService } from 'vs/platform/product/common/productService';
import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
// --- bisect service
@@ -73,6 +74,7 @@ class ExtensionBisectService implements IExtensionBisectService {
constructor(
@ILogService logService: ILogService,
@IStorageService private readonly _storageService: IStorageService,
@IWorkbenchEnvironmentService private readonly _envService: IWorkbenchEnvironmentService
) {
const raw = _storageService.get(ExtensionBisectService._storageKey, StorageScope.GLOBAL);
this._state = BisectState.fromJSON(raw);
@@ -97,12 +99,26 @@ class ExtensionBisectService implements IExtensionBisectService {
isDisabledByBisect(extension: IExtension): boolean {
if (!this._state) {
// bisect isn't active
return false;
}
if (this._isRemoteResolver(extension)) {
// the current remote resolver extension cannot be disabled
return false;
}
const disabled = this._disabled.get(extension.identifier.id);
return disabled ?? false;
}
private _isRemoteResolver(extension: IExtension): boolean {
if (extension.manifest.enableProposedApi !== true) {
return false;
}
const idx = this._envService.remoteAuthority?.indexOf('+');
const activationEvent = `onResolveRemoteAuthority:${this._envService.remoteAuthority?.substr(0, idx)}`;
return Boolean(extension.manifest.activationEvents?.find(e => e === activationEvent));
}
async start(extensions: ILocalExtension[]): Promise<void> {
if (this._state) {
throw new Error('invalid state');