src/vs/platform/environment/common/environment.ts
165 LOC · 165 covered · 0 uncovered · 1 ranges · 7031 concepts · 1 introducers · 3677 tests
File neighbourhood
The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.
Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.
/*---------------------------------------------------------------------------------------------
environment.ts ×1
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { URI } from '../../../base/common/uri.js';
import { NativeParsedArgs } from './argv.js';
import { createDecorator, refineServiceDecorator } from '../../instantiation/common/instantiation.js';
export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');
export const INativeEnvironmentService = refineServiceDecorator<IEnvironmentService, INativeEnvironmentService>(IEnvironmentService);
export interface IDebugParams {
port: number | null;
break: boolean;
}
export interface IExtensionHostDebugParams extends IDebugParams {
debugId?: string;
env?: Record<string, string>;
}
/**
* Type of extension.
*
* **NOTE**: This is defined in `platform/environment` because it can appear as a CLI argument.
*/
export type ExtensionKind = 'ui' | 'workspace' | 'web';
/**
* A basic environment service that can be used in various processes,
* such as main, renderer and shared process. Use subclasses of this
* service for specific environment.
*/
export interface IEnvironmentService {
readonly _serviceBrand: undefined;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: KEEP THIS INTERFACE AS SMALL AS POSSIBLE.
//
// AS SUCH:
// - PUT NON-WEB PROPERTIES INTO NATIVE ENVIRONMENT SERVICE
// - PUT WORKBENCH ONLY PROPERTIES INTO WORKBENCH ENVIRONMENT SERVICE
// - PUT ELECTRON-MAIN ONLY PROPERTIES INTO MAIN ENVIRONMENT SERVICE
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// --- user roaming data
stateResource: URI;
userRoamingDataHome: URI;
keyboardLayoutResource: URI;
argvResource: URI;
// --- data paths
untitledWorkspacesHome: URI;
workspaceStorageHome: URI;
localHistoryHome: URI;
cacheHome: URI;
appSharedDataHome: URI;
// --- settings sync
userDataSyncHome: URI;
sync: 'on' | 'off' | undefined;
// --- continue edit session
continueOn?: string;
editSessionId?: string;
// --- extension development
debugExtensionHost: IExtensionHostDebugParams;
isExtensionDevelopment: boolean;
disableExtensions: boolean | string[];
skipBuiltinExtensions?: readonly string[];
enableExtensions?: readonly string[];
extensionDevelopmentLocationURI?: URI[];
extensionDevelopmentKind?: ExtensionKind[];
extensionTestsLocationURI?: URI;
// --- logging
logsHome: URI;
logLevel?: string;
extensionLogLevel?: [string, string][];
verbose: boolean;
isBuilt: boolean;
// --- telemetry/exp
disableTelemetry: boolean;
disableExperiments: boolean;
serviceMachineIdResource: URI;
// --- agent sessions workspace
agentSessionsWorkspace: URI;
// --- Policy
policyFile?: URI;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: KEEP THIS INTERFACE AS SMALL AS POSSIBLE.
//
// AS SUCH:
// - PUT NON-WEB PROPERTIES INTO NATIVE ENVIRONMENT SERVICE
// - PUT WORKBENCH ONLY PROPERTIES INTO WORKBENCH ENVIRONMENT SERVICE
// - PUT ELECTRON-MAIN ONLY PROPERTIES INTO MAIN ENVIRONMENT SERVICE
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
/**
* A subclass of the `IEnvironmentService` to be used only in native
* environments (Windows, Linux, macOS) but not e.g. web.
*/
export interface INativeEnvironmentService extends IEnvironmentService {
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: KEEP THIS INTERFACE AS SMALL AS POSSIBLE.
//
// AS SUCH:
// - PUT WORKBENCH ONLY PROPERTIES INTO WORKBENCH ENVIRONMENT SERVICE
// - PUT ELECTRON-MAIN ONLY PROPERTIES INTO MAIN ENVIRONMENT SERVICE
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// --- CLI Arguments
args: NativeParsedArgs;
// --- data paths
/**
* Root path of the JavaScript sources.
*
* Note: This is NOT the installation root
* directory itself but contained in it at
* a level that is platform dependent.
*/
appRoot: string;
userHome: URI;
appSettingsHome: URI;
tmpDir: URI;
userDataPath: string;
// --- extensions
extensionsPath: string;
extensionsDownloadLocation: URI;
builtinExtensionsPath: string;
// --- use in-memory Secret Storage
useInMemorySecretStorage?: boolean;
crossOriginIsolated?: boolean;
exportPolicyData?: string;
exportDefaultKeybindings?: string;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// NOTE: KEEP THIS INTERFACE AS SMALL AS POSSIBLE.
//
// AS SUCH:
// - PUT NON-WEB PROPERTIES INTO NATIVE ENVIRONMENT SERVICE
// - PUT WORKBENCH ONLY PROPERTIES INTO WORKBENCH ENVIRONMENT SERVICE
// - PUT ELECTRON-MAIN ONLY PROPERTIES INTO MAIN ENVIRONMENT SERVICE
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}