提交 e6f7c49d 编写于 作者: B Benjamin Pasero

💄

上级 73ccd28b
......@@ -57,7 +57,7 @@ enum Storage {
CENTERED_LAYOUT_ENABLED = 'workbench.centerededitorlayout.active',
}
export class Layout extends Disposable implements IWorkbenchLayoutService {
export abstract class Layout extends Disposable implements IWorkbenchLayoutService {
_serviceBrand: ServiceIdentifier<any>;
......@@ -186,15 +186,6 @@ export class Layout extends Disposable implements IWorkbenchLayoutService {
this.initLayoutState(accessor.get(ILifecycleService));
}
protected getPart(key: Parts): Part {
const part = this.parts.get(key);
if (!part) {
throw new Error(`Unknown part ${key}`);
}
return part;
}
private registerLayoutListeners(): void {
// Storage
......@@ -495,6 +486,15 @@ export class Layout extends Disposable implements IWorkbenchLayoutService {
this.parts.set(part.getId(), part);
}
protected getPart(key: Parts): Part {
const part = this.parts.get(key);
if (!part) {
throw new Error(`Unknown part ${key}`);
}
return part;
}
isRestored(): boolean {
return this.lifecycleService.phase >= LifecyclePhase.Restored;
}
......@@ -1138,6 +1138,4 @@ export class Layout extends Disposable implements IWorkbenchLayoutService {
this.disposed = true;
}
//#endregion
}
......@@ -1134,7 +1134,6 @@ export class SimpleSearchService implements ISearchService {
}
// Don't support other resource schemes than files for now
// todo@remote
// why is that? we should search for resources from other
// schemes
else if (resource.scheme !== Schemas.file) {
......
......@@ -37,7 +37,6 @@ import { registerNotificationCommands } from 'vs/workbench/browser/parts/notific
import { NotificationsToasts } from 'vs/workbench/browser/parts/notifications/notificationsToasts';
import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { setARIAContainer } from 'vs/base/browser/ui/aria/aria';
import { restoreFontInfo, readFontInfo, saveFontInfo } from 'vs/editor/browser/config/configuration';
import { BareFontInfo } from 'vs/editor/common/config/fontInfo';
......@@ -82,7 +81,7 @@ export class Workbench extends Layout {
setUnexpectedErrorHandler(error => this.handleUnexpectedError(error, logService));
// Inform user about loading issues from the loader
(<any>self).require.config({
(<any>window).require.config({
onError: err => {
if (err.errorCode === 'load') {
onUnexpectedError(new Error(localize('loaderErrorNative', "Failed to load a required file. Please restart the application to try again. Details: {0}", JSON.stringify(err))));
......@@ -140,7 +139,7 @@ export class Workbench extends Layout {
this.initLayout(accessor);
// Registries
this.initRegistries(accessor);
this.startRegistries(accessor);
// Context Keys
this._register(instantiationService.createInstance(WorkbenchContextKeysHandler));
......@@ -185,17 +184,15 @@ export class Workbench extends Layout {
serviceCollection.set(contributedService.id, contributedService.descriptor);
}
const instantationServie = new InstantiationService(serviceCollection, true);
const instantiationService = new InstantiationService(serviceCollection, true);
// Wrap up
instantationServie.invokeFunction(accessor => {
instantiationService.invokeFunction(accessor => {
const lifecycleService = accessor.get(ILifecycleService);
// TODO@Ben TODO@Sandeep TODO@Martin debt around cyclic dependencies
// TODO@Ben TODO@Sandeep debt around cyclic dependencies
const fileService = accessor.get(IFileService);
const instantiationService = accessor.get(IInstantiationService);
const configurationService = accessor.get(IConfigurationService) as any;
const themeService = accessor.get(IWorkbenchThemeService) as any;
if (typeof configurationService.acquireFileService === 'function') {
configurationService.acquireFileService(fileService);
......@@ -205,18 +202,14 @@ export class Workbench extends Layout {
configurationService.acquireInstantiationService(instantiationService);
}
if (typeof themeService.acquireFileService === 'function') {
themeService.acquireFileService(fileService);
}
// Signal to lifecycle that services are set
lifecycleService.phase = LifecyclePhase.Ready;
});
return instantationServie;
return instantiationService;
}
private initRegistries(accessor: ServicesAccessor): void {
private startRegistries(accessor: ServicesAccessor): void {
Registry.as<IActionBarRegistry>(ActionBarExtensions.Actionbar).start(accessor);
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).start(accessor);
Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories).start(accessor);
......@@ -347,7 +340,7 @@ export class Workbench extends Layout {
logService: ILogService,
lifecycleService: ILifecycleService
): Promise<void> {
const restorePromises: Promise<any>[] = [];
const restorePromises: Promise<void>[] = [];
// Restore editors
mark('willRestoreEditors');
......
......@@ -141,7 +141,7 @@ export class OutputPanel extends AbstractTextResourceEditor {
}
protected createEditor(parent: HTMLElement): void {
// First create the scoped instantation service and only then construct the editor using the scoped service
// First create the scoped instantiation service and only then construct the editor using the scoped service
const scopedContextKeyService = this._register(this.contextKeyService.createScoped(parent));
this.scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, scopedContextKeyService]));
super.createEditor(parent);
......
......@@ -70,8 +70,6 @@ export interface IColorCustomizations {
export class WorkbenchThemeService implements IWorkbenchThemeService {
_serviceBrand: any;
private fileService: IFileService;
private colorThemeStore: ColorThemeStore;
private currentColorTheme: ColorThemeData;
private container: HTMLElement;
......@@ -99,7 +97,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
@IConfigurationService private readonly configurationService: IConfigurationService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
@IWindowService private readonly windowService: IWindowService,
@IEnvironmentService private readonly environmentService: IEnvironmentService
@IEnvironmentService private readonly environmentService: IEnvironmentService,
@IFileService private readonly fileService: IFileService
) {
this.container = document.body;
......@@ -204,10 +203,6 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
}
}
});
}
acquireFileService(fileService: IFileService): void {
this.fileService = fileService;
this.fileService.onFileChanges(async e => {
if (this.watchedColorThemeLocation && this.currentColorTheme && e.contains(this.watchedColorThemeLocation, FileChangeType.UPDATED)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册