src/vs/platform/environment/common/environmentService.ts

329 LOC · 194 covered · 135 uncovered · 28 ranges · 34 concepts · 5 introducers · 34 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.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filesrc/vs/platform/environment/node/argv.ts · 536 LOCnode/argv.tssrc/vs/platform/userDataProfile/common/userDataProfile.ts · 758 LOCcommon/userDataProfile.t…userDataProfileService.test|title=UserDataProfileService (Common) associate workspace to a profile should update workspaces|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfile.ts ×1 · 3 introduced LOCuserDataProfile.ts ×1userDataProfile.ts ×5 · 17 introduced LOCuserDataProfile.ts ×5userDataProfileService.test|title=UserDataProfileService (Common) profiles include default profile with extension resource undefined when transiet prrofile is removed|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfile.ts ×1 · 3 introduced LOCuserDataProfile.ts ×1userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - remove workspace|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - add workspace|occurrence=1, userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - replace workspace|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) persist transient profile|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) update named profile|occurrence=1, userDataProfileService.test|title=UserDataProfileService (Common) update profile using default profile for keybindings|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfile.ts ×1 · 2 introduced LOCuserDataProfile.ts ×1userDataProfileService.test|title=UserDataProfileService (Common) associate same workspace to a profile should not duplicate|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) create transient profile when a normal profile with Temp is already created|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) can create transient and persistent profiles with same name|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfile.ts ×2 · 3 introduced LOCuserDataProfile.ts ×2userDataProfileService.test|title=UserDataProfileService (Common) save transient profile|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfile.ts ×2 · 3 introduced LOCuserDataProfile.ts ×2userDataProfile.ts ×4 · 9 introduced LOCuserDataProfile.ts ×4userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for tasks|occurrence=1, userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for settings|occurrence=1, +5 · 0 introduced LOCuserDataProfileService.t…userDataProfile.ts ×1 · 2 introduced LOCuserDataProfile.ts ×1userDataProfileService.test|title=UserDataProfileService (Common) create transient profiles|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfile.ts ×2 · 4 introduced LOCuserDataProfile.ts ×2userDataProfile.ts ×1 · 11 introduced LOCuserDataProfile.ts ×1userDataProfileService.test|title=UserDataProfileService (Common) create profile with id|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfile.ts ×2 · 3 introduced LOCuserDataProfile.ts ×2userDataProfile.ts ×1 · 3 introduced LOCuserDataProfile.ts ×1userDataProfile.ts ×2 · 12 introduced LOCuserDataProfile.ts ×2userDataProfileService.test|title=UserDataProfileService (Common) default profile|occurrence=1 · 0 introduced LOCuserDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profiles always include default profile|occurrence=1 · 0 introduced LOCuserDataProfileService.t…environmentService.ts ×1 · 7 introduced LOCenvironmentService.ts ×1environmentService.ts ×2 · 4 introduced LOCenvironmentService.ts ×2environmentService.ts ×3 · 12 introduced LOCenvironmentService.ts ×3environmentService.ts ×4 · 22 introduced LOCenvironmentService.ts ×4environmentService.ts ×1 · 4 introduced LOCenvironmentService.ts ×1environmentService.ts ×21 · 174 introduced LOCenvironmentService.ts ×2…environmentService.test|title=EnvironmentService careful with boolean file names|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/environment/test/node/environmentService.test|title=EnvironmentService careful with boolean file names|occurrence=1environmentService.test|…environmentService.test|title=EnvironmentService parseExtensionHostPort when built|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/environment/test/node/environmentService.test|title=EnvironmentService parseExtensionHostPort when built|occurrence=1environmentService.test|…environmentService.test|title=EnvironmentService parseExtensionHostPort when unbuilt|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/environment/test/node/environmentService.test|title=EnvironmentService parseExtensionHostPort when unbuilt|occurrence=1environmentService.test|…environmentService.test|title=EnvironmentService userDataDir|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/environment/test/node/environmentService.test|title=EnvironmentService userDataDir|occurrence=1environmentService.test|…userDataProfileService.test|title=UserDataProfileService (Common) associate same workspace to a profile should not duplicate|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) associate same workspace to a profile should not duplicate|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) associate workspace to a profile should update workspaces|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) associate workspace to a profile should update workspaces|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) associate workspace to another profile should update workspaces|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) associate workspace to another profile should update workspaces|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) can create transient and persistent profiles with same name|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) can create transient and persistent profiles with same name|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) create profile with a workspace associates it to the profile|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) create profile with a workspace associates it to the profile|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) create profile with id, name and transient|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) create profile with id, name and transient|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) create profile with id|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) create profile with id|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) create transient profile when a normal profile with Temp is already created|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) create transient profile when a normal profile with Temp is already created|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) create transient profiles|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) create transient profiles|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) default profile|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) default profile|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) persist transient profile (2)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) persist transient profile (2)|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) persist transient profile|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) persist transient profile|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for extensions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for extensions|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for global state|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for global state|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for keybindings|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for keybindings|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for language models|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for language models|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for settings|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for settings|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for snippets|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for snippets|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for tasks|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profile using default profile for tasks|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profiles always include default profile|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profiles always include default profile|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profiles include default profile with extension resource defined when transiet prrofile is created|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profiles include default profile with extension resource defined when transiet prrofile is created|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) profiles include default profile with extension resource undefined when transiet prrofile is removed|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) profiles include default profile with extension resource undefined when transiet prrofile is removed|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) save transient profile|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) save transient profile|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) unassociate workspace to a profile should update workspaces|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) unassociate workspace to a profile should update workspaces|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) update default profile workspaces - add workspace|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) update default profile workspaces - add workspace|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) update named profile|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) update named profile|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) update profile using default profile for keybindings|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) update profile using default profile for keybindings|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - add workspace|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - add workspace|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - remove workspace|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - remove workspace|occurrence=1userDataProfileService.t…userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - replace workspace|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/userDataProfile/test/common/userDataProfileService.test|title=UserDataProfileService (Common) update profile workspaces - replace workspace|occurrence=1userDataProfileService.t…Focused file · src/vs/platform/environment/common/environmentService.ts · 329 LOCcommon/environmentServic…

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.

1 > /*--------------------------------------------------------------------------------------------- environmentService.ts ×21
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { toLocalISOString } from '../../../base/common/date.js';
7 > import { memoize } from '../../../base/common/decorators.js';
8 > import { FileAccess, Schemas } from '../../../base/common/network.js';
9 > import { dirname, join, normalize, resolve } from '../../../base/common/path.js';
10 > import { env } from '../../../base/common/process.js';
11 > import { joinPath } from '../../../base/common/resources.js';
12 > import { URI } from '../../../base/common/uri.js';
13 > import { NativeParsedArgs } from './argv.js';
14 > import { ExtensionKind, IExtensionHostDebugParams, INativeEnvironmentService } from './environment.js';
15 > import { IProductService } from '../../product/common/productService.js';
16 >
17 > export const EXTENSION_IDENTIFIER_WITH_LOG_REGEX = /^([^.]+\..+)[:=](.+)$/;
18 >
19 > export interface INativeEnvironmentPaths {
20 >
21 > /**
22 > * The user data directory to use for anything that should be
23 > * persisted except for the content that is meant for the `homeDir`.
24 > *
25 > * Only one instance of VSCode can use the same `userDataDir`.
26 > */
27 > userDataDir: string;
28 >
29 > /**
30 > * The user home directory mainly used for persisting extensions
31 > * and global configuration that should be shared across all
32 > * versions.
33 > */
34 > homeDir: string;
35 >
36 > /**
37 > * OS tmp dir.
38 > */
39 > tmpDir: string;
40 > }
41 >
42 > export abstract class AbstractNativeEnvironmentService implements INativeEnvironmentService {
43 >
44 > declare readonly _serviceBrand: undefined;
45 >
46 > @memoize
47 > get appRoot(): string { return dirname(FileAccess.asFileUri('').fsPath); }
48 >
49 > @memoize
50 > get userHome(): URI { return URI.file(this.paths.homeDir); }
51 >
52 > @memoize
53 > get userDataPath(): string { return this.paths.userDataDir; }
54 >
55 > @memoize
56 > get appSettingsHome(): URI { return URI.file(join(this.userDataPath, 'User')); }
57 >
58 > @memoize
59 > get tmpDir(): URI { return URI.file(this.paths.tmpDir); }
60 >
61 > @memoize
62 > get cacheHome(): URI { return URI.file(this.userDataPath); }
63 >
64 > @memoize
65 > get stateResource(): URI { return joinPath(this.appSettingsHome, 'globalStorage', 'storage.json'); }
66 >
67 > @memoize
68 > get userRoamingDataHome(): URI { return this.appSettingsHome.with({ scheme: Schemas.vscodeUserData }); }
69 >
70 > @memoize
71 > get userDataSyncHome(): URI { return joinPath(this.appSettingsHome, 'sync'); }
72 >
73 > get logsHome(): URI {
74 if (!this.args.logsPath) {
75 const key = toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '');
76 this.args.logsPath = join(this.userDataPath, 'logs', key);
77 }
78
79 return URI.file(this.args.logsPath);
80 }
82 > @memoize
83 > get sync(): 'on' | 'off' | undefined { return this.args.sync; }
84 >
85 > @memoize
86 > get workspaceStorageHome(): URI { return joinPath(this.appSettingsHome, 'workspaceStorage'); }
87 >
88 > @memoize
89 > get localHistoryHome(): URI { return joinPath(this.appSettingsHome, 'History'); }
90 >
91 > @memoize
92 > get keyboardLayoutResource(): URI { return joinPath(this.userRoamingDataHome, 'keyboardLayout.json'); }
93 >
94 > @memoize
95 > get argvResource(): URI {
96 const vscodePortable = env['VSCODE_PORTABLE'];
97 if (vscodePortable) {
98 return URI.file(join(vscodePortable, 'argv.json'));
99 }
100
101 return joinPath(this.userHome, this.productService.dataFolderName, 'argv.json');
102 }
104 > @memoize
105 > get isExtensionDevelopment(): boolean { return !!this.args.extensionDevelopmentPath; }
106 >
107 > @memoize
108 > get untitledWorkspacesHome(): URI { return URI.file(join(this.userDataPath, 'Workspaces')); }
109 >
110 > @memoize
111 > get builtinExtensionsPath(): string {
112 const cliBuiltinExtensionsDir = this.args['builtin-extensions-dir'];
113 if (cliBuiltinExtensionsDir) {
114 return resolve(cliBuiltinExtensionsDir);
115 }
116
117 return normalize(join(FileAccess.asFileUri('').fsPath, '..', 'extensions'));
118 }
120 > @memoize
121 > get extensionsDownloadLocation(): URI {
122 const cliExtensionsDownloadDir = this.args['extensions-download-dir'];
123 if (cliExtensionsDownloadDir) {
124 return URI.file(resolve(cliExtensionsDownloadDir));
125 }
126
127 return URI.file(join(this.userDataPath, 'CachedExtensionVSIXs'));
128 }
130 > @memoize
131 > get extensionsPath(): string {
132 const cliExtensionsDir = this.args['extensions-dir'];
133 if (cliExtensionsDir) {
134 return resolve(cliExtensionsDir);
135 }
136
137 const vscodeExtensions = env['VSCODE_EXTENSIONS'];
138 if (vscodeExtensions) {
139 return vscodeExtensions;
140 }
141
142 const vscodePortable = env['VSCODE_PORTABLE'];
143 if (vscodePortable) {
144 return join(vscodePortable, 'extensions');
145 }
146
147 return joinPath(this.userHome, this.productService.dataFolderName, 'extensions').fsPath;
148 }
150 > @memoize
151 > get appSharedDataHome(): URI {
152 const cliSharedDataDir = this.args['shared-data-dir'];
153 if (cliSharedDataDir) {
154 return URI.file(resolve(cliSharedDataDir));
155 }
156
157 const vscodePortable = env['VSCODE_PORTABLE'];
158 if (vscodePortable) {
159 return URI.file(join(vscodePortable, 'shared-data'));
160 }
161
162 return joinPath(this.userHome, this.productService.sharedDataFolderName);
163 }
165 > @memoize
166 > get extensionDevelopmentLocationURI(): URI[] | undefined {
167 const extensionDevelopmentPaths = this.args.extensionDevelopmentPath;
168 if (Array.isArray(extensionDevelopmentPaths)) {
169 return extensionDevelopmentPaths.map(extensionDevelopmentPath => {
170 if (/^[^:/?#]+?:\/\//.test(extensionDevelopmentPath)) {
171 return URI.parse(extensionDevelopmentPath);
172 }
173
174 return URI.file(normalize(extensionDevelopmentPath));
175 });
176 }
177
178 return undefined;
179 }
181 > @memoize
182 > get extensionDevelopmentKind(): ExtensionKind[] | undefined {
183 return this.args.extensionDevelopmentKind?.map(kind => kind === 'ui' || kind === 'workspace' || kind === 'web' ? kind : 'workspace');
184 }
186 > @memoize
187 > get extensionTestsLocationURI(): URI | undefined {
188 const extensionTestsPath = this.args.extensionTestsPath;
189 if (extensionTestsPath) {
190 if (/^[^:/?#]+?:\/\//.test(extensionTestsPath)) {
191 return URI.parse(extensionTestsPath);
192 }
193
194 return URI.file(normalize(extensionTestsPath));
195 }
196
197 return undefined;
198 }
200 > get disableExtensions(): boolean | string[] {
201 if (this.args['disable-extensions']) {
202 return true;
203 }
204
205 const disableExtensions = this.args['disable-extension'];
206 if (disableExtensions) {
207 if (typeof disableExtensions === 'string') {
208 return [disableExtensions];
209 }
210
211 if (Array.isArray(disableExtensions) && disableExtensions.length > 0) {
212 return disableExtensions;
213 }
214 }
215
216 return false;
217 }
219 > get skipBuiltinExtensions(): readonly string[] {
220 const value = env['VSCODE_SKIP_BUILTIN_EXTENSIONS'];
221 if (!value) {
222 return [];
223 }
224 return value.split(',').map(id => id.trim()).filter(id => id);
225 }
227 > @memoize
228 > get debugExtensionHost(): IExtensionHostDebugParams { return parseExtensionHostDebugPort(this.args, this.isBuilt); }
229 > get debugRenderer(): boolean { return !!this.args.debugRenderer; }
230 >
231 > get isBuilt(): boolean { return !env['VSCODE_DEV']; }
232 > get verbose(): boolean { return !!this.args.verbose; }
233 >
234 > @memoize
235 > get logLevel(): string | undefined { return this.args.log?.find(entry => !EXTENSION_IDENTIFIER_WITH_LOG_REGEX.test(entry)); }
236 > @memoize
237 > get extensionLogLevel(): [string, string][] | undefined {
238 const result: [string, string][] = [];
239 for (const entry of this.args.log || []) {
240 const matches = EXTENSION_IDENTIFIER_WITH_LOG_REGEX.exec(entry);
241 if (matches?.[1] && matches[2]) {
242 result.push([matches[1], matches[2]]);
243 }
244 }
245 return result.length ? result : undefined;
246 }
248 > @memoize
249 > get serviceMachineIdResource(): URI { return joinPath(URI.file(this.userDataPath), 'machineid'); }
250 >
251 > get crashReporterId(): string | undefined { return this.args['crash-reporter-id']; }
252 > get crashReporterDirectory(): string | undefined { return this.args['crash-reporter-directory']; }
253 >
254 > @memoize
255 > get disableTelemetry(): boolean { return !!this.args['disable-telemetry']; }
256 >
257 > @memoize
258 > get disableExperiments(): boolean { return !!this.args['disable-experiments']; }
259 >
260 > @memoize
261 > get disableWorkspaceTrust(): boolean { return !!this.args['disable-workspace-trust']; }
262 >
263 > @memoize
264 > get useInMemorySecretStorage(): boolean { return !!this.args['use-inmemory-secretstorage']; }
265 >
266 > @memoize
267 > get policyFile(): URI | undefined {
268 if (this.args['__enable-file-policy']) {
269 const vscodePortable = env['VSCODE_PORTABLE'];
270 if (vscodePortable) {
271 return URI.file(join(vscodePortable, 'policy.json'));
272 }
273
274 return joinPath(this.userHome, this.productService.dataFolderName, 'policy.json');
275 }
276 return undefined;
277 }
279 > @memoize
280 > get agentSessionsWorkspace(): URI {
281 > return joinPath(this.appSettingsHome, 'agent-sessions.code-workspace'); userDataProfile.ts ×5
282 > }
284 > get editSessionId(): string | undefined { return this.args['editSessionId']; }
285 >
286 > get exportPolicyData(): string | undefined {
287 return this.args['export-policy-data'];
288 }
290 > get exportDefaultKeybindings(): string | undefined {
291 return this.args['export-default-keybindings'];
292 }
294 > get continueOn(): string | undefined {
295 return this.args['continueOn'];
296 }
298 > set continueOn(value: string | undefined) {
299 this.args['continueOn'] = value;
300 }
302 > get args(): NativeParsedArgs { return this._args; }
303 >
304 > constructor(
305 > private readonly _args: NativeParsedArgs, environmentService.ts ×1
306 > private readonly paths: INativeEnvironmentPaths,
307 > protected readonly productService: IProductService
308 > ) { }
310 >
311 > export function parseExtensionHostDebugPort(args: NativeParsedArgs, isBuilt: boolean): IExtensionHostDebugParams {
312 > return parseDebugParams(args['inspect-extensions'], args['inspect-brk-extensions'], 5870, isBuilt, args.debugId, args.extensionEnvironment); environmentService.ts ×3
313 > }
315 > export function parseDebugParams(debugArg: string | undefined, debugBrkArg: string | undefined, defaultBuildPort: number, isBuilt: boolean, debugId?: string, environmentString?: string): IExtensionHostDebugParams {
316 > const portStr = debugBrkArg || debugArg; environmentService.ts ×3
317 > const port = Number(portStr) || (!isBuilt ? defaultBuildPort : null);
318 > const brk = port ? Boolean(!!debugBrkArg) : false;
319 > let env: Record<string, string> | undefined;
320 > if (environmentString) {
322 > env = JSON.parse(environmentString);
323 > } catch {
324 // ignore
325 }
328 > return { port, break: brk, debugId, env };
329 > }