environmentService.ts ×21

Frontier kind: Code frontier

unlabeled · c_73a302b48756

34 tests · 6027 LOC · 34 files · introduces 0 tests · 174 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
21 ranges174 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
840 ranges6027 lines · 34 files · Browse complete extent
All tests (intent)
34 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

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 native relationship evidence on this page.

Introduced files, introduced tests, and structurally relevant concept specializationuserDataProfileService.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 ×1resources.ts ×23 · 253 introduced LOCresources.ts ×23network.ts ×20 · 292 introduced LOCnetwork.ts ×20extpath.ts ×17 · 91 introduced LOCextpath.ts ×17strings.ts ×101 · 542 introduced LOCstrings.ts ×101decorators.ts ×1 · 3 introduced LOCdecorators.ts ×1decorators.ts ×5 · 11 introduced LOCdecorators.ts ×5decorators.ts ×5 · 17 introduced LOCdecorators.ts ×5cancelPreviousCalls.ts ×1 · 87 introduced LOCcancelPreviousCalls.ts ×…cancellation.ts ×18 · 90 introduced LOCcancellation.ts ×18event.ts ×93 · 864 introduced LOCevent.ts ×93date.ts ×10 · 46 introduced LOCdate.ts ×10product.ts ×4 · 39 introduced LOCproduct.ts ×4utils.ts ×3 · 9 introduced LOCutils.ts ×3nls.ts ×1 · 1 introduced LOCnls.ts ×1linkedList.ts ×13 · 44 introduced LOClinkedList.ts ×13nls.ts ×6 · 13 introduced LOCnls.ts ×6lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lazy.ts ×1 · 2 introduced LOClazy.ts ×1lazy.ts ×3 · 37 introduced LOClazy.ts ×3lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1uint.ts ×2 · 43 introduced LOCuint.ts ×2lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/cache.ts · 153 LOCcommon/cache.tssrc/vs/base/common/cancellation.ts · 206 LOCcommon/cancellation.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/date.ts · 317 LOCcommon/date.tssrc/vs/base/common/decorators.ts · 131 LOCcommon/decorators.tssrc/vs/base/common/decorators/cancelPreviousCalls.ts · 168 LOCdecorators/cancelPreviou…src/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/event.ts · 1964 LOCcommon/event.tssrc/vs/base/common/extpath.ts · 433 LOCcommon/extpath.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lazy.ts · 57 LOCcommon/lazy.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/linkedList.ts · 151 LOCcommon/linkedList.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/network.ts · 440 LOCcommon/network.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/resources.ts · 444 LOCcommon/resources.tssrc/vs/base/common/stopwatch.ts · 41 LOCcommon/stopwatch.tssrc/vs/base/common/strings.ts · 1413 LOCcommon/strings.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uint.ts · 59 LOCcommon/uint.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tssrc/vs/platform/environment/common/environmentService.ts · 329 LOCcommon/environmentServic…src/vs/platform/environment/node/argv.ts · 536 LOCnode/argv.tssrc/vs/platform/environment/node/environmentService.ts · 35 LOCnode/environmentService.…src/vs/platform/product/common/product.ts · 93 LOCcommon/product.tssrc/vs/platform/userDataProfile/common/userDataProfile.ts · 758 LOCcommon/userDataProfile.t…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 concept · environmentService.ts ×21 · 174 introduced LOCenvironmentService.ts ×2…

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 174 introduced LOC across 21 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/environment/common/environmentService.ts 174 introduced LOC · 21 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- environmentService.ts
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, '');
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) {
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) {
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) {
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) {
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) {
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)) {
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) {
197 return undefined;
198 }
200 > get disableExtensions(): boolean | string[] {
201 if (this.args['disable-extensions']) {
202 return true;
216 return false;
217 }
219 > get skipBuiltinExtensions(): readonly string[] {
220 const value = env['VSCODE_SKIP_BUILTIN_EXTENSIONS'];
221 if (!value) {
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 || []) {
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'];
276 return undefined;
277 }
279 > @memoize
280 > get agentSessionsWorkspace(): URI {
281 return joinPath(this.appSettingsHome, 'agent-sessions.code-workspace');
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,
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);
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;
317 const port = Number(portStr) || (!isBuilt ? defaultBuildPort : null);