Skip to content

Commit e6f7c49

Browse files
author
Benjamin Pasero
committed
💄
1 parent 73ccd28 commit e6f7c49

5 files changed

Lines changed: 21 additions & 36 deletions

File tree

src/vs/workbench/browser/layout.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ enum Storage {
5757
CENTERED_LAYOUT_ENABLED = 'workbench.centerededitorlayout.active',
5858
}
5959

60-
export class Layout extends Disposable implements IWorkbenchLayoutService {
60+
export abstract class Layout extends Disposable implements IWorkbenchLayoutService {
6161

6262
_serviceBrand: ServiceIdentifier<any>;
6363

@@ -186,15 +186,6 @@ export class Layout extends Disposable implements IWorkbenchLayoutService {
186186
this.initLayoutState(accessor.get(ILifecycleService));
187187
}
188188

189-
protected getPart(key: Parts): Part {
190-
const part = this.parts.get(key);
191-
if (!part) {
192-
throw new Error(`Unknown part ${key}`);
193-
}
194-
195-
return part;
196-
}
197-
198189
private registerLayoutListeners(): void {
199190

200191
// Storage
@@ -495,6 +486,15 @@ export class Layout extends Disposable implements IWorkbenchLayoutService {
495486
this.parts.set(part.getId(), part);
496487
}
497488

489+
protected getPart(key: Parts): Part {
490+
const part = this.parts.get(key);
491+
if (!part) {
492+
throw new Error(`Unknown part ${key}`);
493+
}
494+
495+
return part;
496+
}
497+
498498
isRestored(): boolean {
499499
return this.lifecycleService.phase >= LifecyclePhase.Restored;
500500
}
@@ -1138,6 +1138,4 @@ export class Layout extends Disposable implements IWorkbenchLayoutService {
11381138

11391139
this.disposed = true;
11401140
}
1141-
1142-
//#endregion
11431141
}

src/vs/workbench/browser/nodeless.simpleservices.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,6 @@ export class SimpleSearchService implements ISearchService {
11341134
}
11351135

11361136
// Don't support other resource schemes than files for now
1137-
// todo@remote
11381137
// why is that? we should search for resources from other
11391138
// schemes
11401139
else if (resource.scheme !== Schemas.file) {

src/vs/workbench/browser/workbench.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { registerNotificationCommands } from 'vs/workbench/browser/parts/notific
3737
import { NotificationsToasts } from 'vs/workbench/browser/parts/notifications/notificationsToasts';
3838
import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/editorService';
3939
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
40-
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
4140
import { setARIAContainer } from 'vs/base/browser/ui/aria/aria';
4241
import { restoreFontInfo, readFontInfo, saveFontInfo } from 'vs/editor/browser/config/configuration';
4342
import { BareFontInfo } from 'vs/editor/common/config/fontInfo';
@@ -82,7 +81,7 @@ export class Workbench extends Layout {
8281
setUnexpectedErrorHandler(error => this.handleUnexpectedError(error, logService));
8382

8483
// Inform user about loading issues from the loader
85-
(<any>self).require.config({
84+
(<any>window).require.config({
8685
onError: err => {
8786
if (err.errorCode === 'load') {
8887
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 {
140139
this.initLayout(accessor);
141140

142141
// Registries
143-
this.initRegistries(accessor);
142+
this.startRegistries(accessor);
144143

145144
// Context Keys
146145
this._register(instantiationService.createInstance(WorkbenchContextKeysHandler));
@@ -185,17 +184,15 @@ export class Workbench extends Layout {
185184
serviceCollection.set(contributedService.id, contributedService.descriptor);
186185
}
187186

188-
const instantationServie = new InstantiationService(serviceCollection, true);
187+
const instantiationService = new InstantiationService(serviceCollection, true);
189188

190189
// Wrap up
191-
instantationServie.invokeFunction(accessor => {
190+
instantiationService.invokeFunction(accessor => {
192191
const lifecycleService = accessor.get(ILifecycleService);
193192

194-
// TODO@Ben TODO@Sandeep TODO@Martin debt around cyclic dependencies
193+
// TODO@Ben TODO@Sandeep debt around cyclic dependencies
195194
const fileService = accessor.get(IFileService);
196-
const instantiationService = accessor.get(IInstantiationService);
197195
const configurationService = accessor.get(IConfigurationService) as any;
198-
const themeService = accessor.get(IWorkbenchThemeService) as any;
199196

200197
if (typeof configurationService.acquireFileService === 'function') {
201198
configurationService.acquireFileService(fileService);
@@ -205,18 +202,14 @@ export class Workbench extends Layout {
205202
configurationService.acquireInstantiationService(instantiationService);
206203
}
207204

208-
if (typeof themeService.acquireFileService === 'function') {
209-
themeService.acquireFileService(fileService);
210-
}
211-
212205
// Signal to lifecycle that services are set
213206
lifecycleService.phase = LifecyclePhase.Ready;
214207
});
215208

216-
return instantationServie;
209+
return instantiationService;
217210
}
218211

219-
private initRegistries(accessor: ServicesAccessor): void {
212+
private startRegistries(accessor: ServicesAccessor): void {
220213
Registry.as<IActionBarRegistry>(ActionBarExtensions.Actionbar).start(accessor);
221214
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).start(accessor);
222215
Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories).start(accessor);
@@ -347,7 +340,7 @@ export class Workbench extends Layout {
347340
logService: ILogService,
348341
lifecycleService: ILifecycleService
349342
): Promise<void> {
350-
const restorePromises: Promise<any>[] = [];
343+
const restorePromises: Promise<void>[] = [];
351344

352345
// Restore editors
353346
mark('willRestoreEditors');

src/vs/workbench/contrib/output/browser/outputPanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export class OutputPanel extends AbstractTextResourceEditor {
141141
}
142142

143143
protected createEditor(parent: HTMLElement): void {
144-
// First create the scoped instantation service and only then construct the editor using the scoped service
144+
// First create the scoped instantiation service and only then construct the editor using the scoped service
145145
const scopedContextKeyService = this._register(this.contextKeyService.createScoped(parent));
146146
this.scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, scopedContextKeyService]));
147147
super.createEditor(parent);

src/vs/workbench/services/themes/browser/workbenchThemeService.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ export interface IColorCustomizations {
7070
export class WorkbenchThemeService implements IWorkbenchThemeService {
7171
_serviceBrand: any;
7272

73-
private fileService: IFileService;
74-
7573
private colorThemeStore: ColorThemeStore;
7674
private currentColorTheme: ColorThemeData;
7775
private container: HTMLElement;
@@ -99,7 +97,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
9997
@IConfigurationService private readonly configurationService: IConfigurationService,
10098
@ITelemetryService private readonly telemetryService: ITelemetryService,
10199
@IWindowService private readonly windowService: IWindowService,
102-
@IEnvironmentService private readonly environmentService: IEnvironmentService
100+
@IEnvironmentService private readonly environmentService: IEnvironmentService,
101+
@IFileService private readonly fileService: IFileService
103102
) {
104103

105104
this.container = document.body;
@@ -204,10 +203,6 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
204203
}
205204
}
206205
});
207-
}
208-
209-
acquireFileService(fileService: IFileService): void {
210-
this.fileService = fileService;
211206

212207
this.fileService.onFileChanges(async e => {
213208
if (this.watchedColorThemeLocation && this.currentColorTheme && e.contains(this.watchedColorThemeLocation, FileChangeType.UPDATED)) {

0 commit comments

Comments
 (0)