提交 3ca69614 编写于 作者: B Benjamin Pasero

debt - deprecate access to configuration from environment service

上级 95efc296
......@@ -810,7 +810,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
};
}
const { filesToOpenOrCreate, filesToDiff } = this.environmentService;
const { filesToOpenOrCreate, filesToDiff } = this.environmentService.configuration;
if (filesToOpenOrCreate || filesToDiff) {
return { filesToOpenOrCreate, filesToDiff };
}
......
......@@ -95,11 +95,6 @@ export class SimpleNativeWorkbenchEnvironmentService implements INativeWorkbench
machineId = this.configuration.machineId;
remoteAuthority = this.configuration.remoteAuthority;
filesToDiff = this.configuration.filesToDiff;
filesToOpenOrCreate = this.configuration.filesToOpenOrCreate;
filesToWait = this.configuration.filesToWait;
windowMaximizedInitially = this.configuration.maximized;
options?: IWorkbenchConstructionOptions | undefined;
logExtensionHostCommunication?: boolean | undefined;
extensionEnabledProposedApi?: string[] | undefined;
......
......@@ -218,7 +218,7 @@ export class NativeWindow extends Disposable {
this._register(this.editorService.onDidVisibleEditorsChange(() => this.onDidVisibleEditorsChange()));
// Listen to editor closing (if we run with --wait)
const filesToWait = this.environmentService.filesToWait;
const filesToWait = this.environmentService.configuration.filesToWait;
if (filesToWait) {
this.trackClosedWaitFiles(filesToWait.waitMarkerFileUri, coalesce(filesToWait.paths.map(path => path.fileUri)));
}
......@@ -265,7 +265,7 @@ export class NativeWindow extends Disposable {
Event.map(Event.filter(this.nativeHostService.onWindowUnmaximize, id => id === this.nativeHostService.windowId), () => false)
)(e => this.onDidChangeMaximized(e)));
this.onDidChangeMaximized(this.environmentService.windowMaximizedInitially ?? false);
this.onDidChangeMaximized(this.environmentService.configuration.maximized ?? false);
// Detect panel position to determine minimum width
this._register(this.layoutService.onPanelPositionChange(pos => {
......
......@@ -229,12 +229,6 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
return `${uri.scheme}://${uri.authority}`;
}
@memoize
get filesToDiff(): IPath[] | undefined { return this.configuration.filesToDiff; }
@memoize
get filesToOpenOrCreate(): IPath[] | undefined { return this.configuration.filesToOpenOrCreate; }
get disableTelemetry(): boolean { return false; }
get verbose(): boolean { return this.payload?.get('verbose') === 'true'; }
......
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IPath, IWindowConfiguration } from 'vs/platform/windows/common/windows';
import { IWindowConfiguration } from 'vs/platform/windows/common/windows';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import type { IWorkbenchConstructionOptions as IWorkbenchOptions } from 'vs/workbench/workbench.web.api';
import { URI } from 'vs/base/common/uri';
......@@ -26,6 +26,13 @@ export interface IWorkbenchEnvironmentService extends IEnvironmentService {
readonly _serviceBrand: undefined;
/**
* @deprecated this property will go away eventually as it
* duplicates many properties of the environment service
*
* Please consider using the environment service directly
* if you can.
*/
readonly configuration: IWorkbenchConfiguration;
readonly options?: IWorkbenchOptions;
......@@ -34,9 +41,6 @@ export interface IWorkbenchEnvironmentService extends IEnvironmentService {
readonly sessionId: string;
readonly filesToOpenOrCreate?: IPath[];
readonly filesToDiff?: IPath[];
readonly logFile: URI;
readonly backupWorkspaceHome?: URI;
......
......@@ -10,7 +10,6 @@ import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { join } from 'vs/base/common/path';
import { IProductService } from 'vs/platform/product/common/productService';
import { IPath, IPathsToWaitFor } from 'vs/platform/windows/common/windows';
export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService implements INativeWorkbenchEnvironmentService {
......@@ -64,18 +63,6 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService
@memoize
get webviewCspSource(): string { return `${Schemas.vscodeWebviewResource}:`; }
@memoize
get filesToDiff(): IPath[] | undefined { return this.configuration.filesToDiff; }
@memoize
get filesToOpenOrCreate(): IPath[] | undefined { return this.configuration.filesToOpenOrCreate; }
@memoize
get filesToWait(): IPathsToWaitFor | undefined { return this.configuration.filesToWait; }
@memoize
get windowMaximizedInitially(): boolean | undefined { return this.configuration.maximized; }
@memoize
get skipReleaseNotes(): boolean { return !!this.args['skip-release-notes']; }
......
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { IWorkbenchConfiguration, IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { INativeWindowConfiguration, IPathsToWaitFor } from 'vs/platform/windows/common/windows';
import { INativeWindowConfiguration } from 'vs/platform/windows/common/windows';
import { INativeEnvironmentService } from 'vs/platform/environment/common/environment';
import { URI } from 'vs/base/common/uri';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
......@@ -19,12 +19,8 @@ export interface INativeWorkbenchConfiguration extends IWorkbenchConfiguration,
*/
export interface INativeWorkbenchEnvironmentService extends IWorkbenchEnvironmentService, INativeEnvironmentService {
readonly configuration: INativeWorkbenchConfiguration;
readonly machineId: string;
readonly filesToWait?: IPathsToWaitFor;
readonly crashReporterDirectory?: string;
readonly crashReporterId?: string;
......@@ -33,9 +29,15 @@ export interface INativeWorkbenchEnvironmentService extends IWorkbenchEnvironmen
readonly log?: string;
readonly extHostLogsPath: URI;
// TODO@sbatten TODO@ben this should be retrieved somehow differently
readonly windowMaximizedInitially?: boolean;
// TODO@ben this is a bit ugly
updateBackupPath(newPath: string | undefined): void;
/**
* @deprecated this property will go away eventually as it
* duplicates many properties of the environment service
*
* Please consider using the environment service directly
* if you can.
*/
readonly configuration: INativeWorkbenchConfiguration;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册