debt - reload() to host service

This commit is contained in:
Benjamin Pasero
2019-09-20 09:14:43 +02:00
parent e1f4b03780
commit 1c6938e342
32 changed files with 93 additions and 104 deletions

View File

@@ -14,7 +14,7 @@ import { localize } from 'vs/nls';
import { Action } from 'vs/base/common/actions';
import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
import { IWindowService } from 'vs/platform/windows/common/windows';
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
import { CancellationToken } from 'vs/base/common/cancellation';
import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
@@ -26,7 +26,7 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha
private readonly _extensionService: IExtensionService;
private readonly _notificationService: INotificationService;
private readonly _extensionsWorkbenchService: IExtensionsWorkbenchService;
private readonly _windowService: IWindowService;
private readonly _hostService: IHostService;
private readonly _extensionEnablementService: IExtensionEnablementService;
constructor(
@@ -34,13 +34,13 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha
@IExtensionService extensionService: IExtensionService,
@INotificationService notificationService: INotificationService,
@IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService,
@IWindowService windowService: IWindowService,
@IHostService hostService: IHostService,
@IExtensionEnablementService extensionEnablementService: IExtensionEnablementService
) {
this._extensionService = extensionService;
this._notificationService = notificationService;
this._extensionsWorkbenchService = extensionsWorkbenchService;
this._windowService = windowService;
this._hostService = hostService;
this._extensionEnablementService = extensionEnablementService;
}
@@ -93,7 +93,7 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha
severity: Severity.Error,
message: localize('reload window', "Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?", extName, missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name),
actions: {
primary: [new Action('reload', localize('reload', "Reload Window"), '', true, () => this._windowService.reloadWindow())]
primary: [new Action('reload', localize('reload', "Reload Window"), '', true, () => this._hostService.reload())]
}
});
} else {
@@ -104,7 +104,7 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha
actions: {
primary: [new Action('enable', localize('enable dep', "Enable and Reload"), '', true,
() => this._extensionEnablementService.setEnablement([missingInstalledDependency], enablementState === EnablementState.DisabledGlobally ? EnablementState.EnabledGlobally : EnablementState.EnabledWorkspace)
.then(() => this._windowService.reloadWindow(), e => this._notificationService.error(e)))]
.then(() => this._hostService.reload(), e => this._notificationService.error(e)))]
}
});
}
@@ -120,7 +120,7 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha
actions: {
primary: [new Action('install', localize('install missing dep', "Install and Reload"), '', true,
() => this._extensionsWorkbenchService.install(dependencyExtension)
.then(() => this._windowService.reloadWindow(), e => this._notificationService.error(e)))]
.then(() => this._hostService.reload(), e => this._notificationService.error(e)))]
}
});
} else {

View File

@@ -8,7 +8,7 @@ import { extHostNamedCustomer } from '../common/extHostCustomers';
import { IURLService, IURLHandler } from 'vs/platform/url/common/url';
import { URI, UriComponents } from 'vs/base/common/uri';
import { IDisposable } from 'vs/base/common/lifecycle';
import { IExtensionUrlHandler } from 'vs/workbench/services/extensions/common/extensionUrlHandler';
import { IExtensionUrlHandler } from 'vs/workbench/services/extensions/browser/extensionUrlHandler';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
class ExtensionUrlHandler implements IURLHandler {