workspaces.ts ×17

Frontier kind: Code frontier

unlabeled · c_5648e4b34d76

17 tests · 7276 LOC · 38 files · introduces 0 tests · 169 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
17 ranges169 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
992 ranges7276 lines · 38 files · Browse complete extent
All tests (intent)
17 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 specializationworkspaces.ts ×1 · 17 introduced LOCworkspaces.ts ×1workspaces.ts ×6 · 46 introduced LOCworkspaces.ts ×6workspaces.ts ×2 · 22 introduced LOCworkspaces.ts ×2workspace.test|title=Workspace getFolder returns the folder even if the uri has query path|occurrence=1 · 0 introduced LOCworkspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with single relative folder|occurrence=1, workspace.test|title=Workspace toWorkspaceFolders with multiple unique absolute and relative folders|occurrence=1, +2 · 0 introduced LOCworkspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with single absolute folder|occurrence=1, workspace.test|title=Workspace toWorkspaceFolders with multiple unique absolute folders|occurrence=1, +2 · 0 introduced LOCworkspace.test|title=Wor…workspace.test|title=Workspace getFolder returns the folder if the uri is sub|occurrence=1 · 0 introduced LOCworkspace.test|title=Wor…workspaces.ts ×3 · 32 introduced LOCworkspaces.ts ×3workspace.test|title=Workspace getFolder returns the folder with given uri|occurrence=1 · 0 introduced LOCworkspace.test|title=Wor…workspace.test|title=Workspace getFolder returns the closest folder if the uri is sub|occurrence=1 · 0 introduced LOCworkspace.test|title=Wor…workspace.test|title=Workspace getFolder returns null if the uri is not sub|occurrence=1 · 0 introduced LOCworkspace.test|title=Wor…workspace.ts ×27 · 322 introduced LOCworkspace.ts ×27labels.ts ×12 · 146 introduced LOClabels.ts ×12ternarySearchTree.ts ×60 · 193 introduced LOCternarySearchTree.ts ×60resources.ts ×23 · 253 introduced LOCresources.ts ×23remoteHosts.ts ×7 · 52 introduced LOCremoteHosts.ts ×7network.ts ×20 · 292 introduced LOCnetwork.ts ×20strings.test|title=Strings trimWhitespace|occurrence=1 · 0 introduced LOCstrings.test|title=Strin…extpath.ts ×17 · 91 introduced LOCextpath.ts ×17strings.ts ×101 · 542 introduced LOCstrings.ts ×101cancellation.test|title=CancellationToken None|occurrence=1 · 0 introduced LOCcancellation.test|title=…cancellation.ts ×18 · 90 introduced LOCcancellation.ts ×18event.ts ×93 · 864 introduced LOCevent.ts ×93jsonEdit.ts ×5 · 18 introduced LOCjsonEdit.ts ×5jsonFormatter.ts ×6 · 69 introduced LOCjsonFormatter.ts ×6json.ts ×14 · 399 introduced LOCjson.ts ×14uri.ts ×3 · 14 introduced LOCuri.ts ×3uri.ts ×3 · 3 introduced LOCuri.ts ×3uri.ts ×2 · 2 introduced LOCuri.ts ×2uri.ts ×3 · 3 introduced LOCuri.ts ×3uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…uri.ts ×2 · 10 introduced LOCuri.ts ×2utils.ts ×3 · 9 introduced LOCutils.ts ×3path.ts ×3 · 5 introduced LOCpath.ts ×3uri.ts ×1 · 2 introduced LOCuri.ts ×1uri.ts ×9 · 37 introduced LOCuri.ts ×9nls.ts ×1 · 1 introduced LOCnls.ts ×1path.ts ×3 · 15 introduced LOCpath.ts ×3linkedList.ts ×13 · 44 introduced LOClinkedList.ts ×13nls.ts ×6 · 13 introduced LOCnls.ts ×6instantiation.ts ×5 · 111 introduced LOCinstantiation.ts ×5path.ts ×1 · 2 introduced LOCpath.ts ×1path.ts ×3 · 10 introduced LOCpath.ts ×3path.ts ×3 · 14 introduced LOCpath.ts ×3lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2path.ts ×1 · 1 introduced LOCpath.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1path.ts ×6 · 24 introduced LOCpath.ts ×6lifecycle.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 ×1path.ts ×2 · 3 introduced LOCpath.ts ×2uint.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/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/json.ts · 1326 LOCcommon/json.tssrc/vs/base/common/jsonEdit.ts · 176 LOCcommon/jsonEdit.tssrc/vs/base/common/jsonFormatter.ts · 261 LOCcommon/jsonFormatter.tssrc/vs/base/common/labels.ts · 484 LOCcommon/labels.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/ternarySearchTree.ts · 796 LOCcommon/ternarySearchTree…src/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/instantiation/common/instantiation.ts · 130 LOCcommon/instantiation.tssrc/vs/platform/remote/common/remoteHosts.ts · 109 LOCcommon/remoteHosts.tssrc/vs/platform/workspace/common/workspace.ts · 493 LOCcommon/workspace.tssrc/vs/platform/workspaces/common/workspaces.ts · 411 LOCcommon/workspaces.tscancellation.test|title=CancellationToken None|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/cancellation.test|title=CancellationToken None|occurrence=1cancellation.test|title=…charCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…strings.test|title=Strings trimWhitespace|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/strings.test|title=Strings trimWhitespace|occurrence=1strings.test|title=Strin…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…workspace.test|title=Workspace getFolder returns null if the uri is not sub|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace getFolder returns null if the uri is not sub|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace getFolder returns the closest folder if the uri is sub|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace getFolder returns the closest folder if the uri is sub|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace getFolder returns the folder even if the uri has query path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace getFolder returns the folder even if the uri has query path|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace getFolder returns the folder if the uri is sub|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace getFolder returns the folder if the uri is sub|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace getFolder returns the folder with given uri|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace getFolder returns the folder with given uri|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with multiple absolute and relative folders with duplicates|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with multiple absolute and relative folders with duplicates|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with multiple absolute and relative folders with invalid paths|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with multiple absolute and relative folders with invalid paths|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with multiple absolute folders with duplicates|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with multiple absolute folders with duplicates|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with multiple unique absolute and relative folders|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with multiple unique absolute and relative folders|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with multiple unique absolute folders with names|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with multiple unique absolute folders with names|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with multiple unique absolute folders|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with multiple unique absolute folders|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with single absolute folder with name|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with single absolute folder with name|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with single absolute folder|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with single absolute folder|occurrence=1workspace.test|title=Wor…workspace.test|title=Workspace toWorkspaceFolders with single relative folder|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspace/test/common/workspace.test|title=Workspace toWorkspaceFolders with single relative folder|occurrence=1workspace.test|title=Wor…workspacesHistoryStorage.test|title=History Storage open 1_55|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspaces/test/node/workspacesHistoryStorage.test|title=History Storage open 1_55|occurrence=1workspacesHistoryStorage…workspacesHistoryStorage.test|title=History Storage storing and restoring|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspaces/test/node/workspacesHistoryStorage.test|title=History Storage storing and restoring|occurrence=1workspacesHistoryStorage…workspacesHistoryStorage.test|title=History Storage toStoreData drops label if it matches path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/workspaces/test/node/workspacesHistoryStorage.test|title=History Storage toStoreData drops label if it matches path|occurrence=1workspacesHistoryStorage…Focused concept · workspaces.ts ×17 · 169 introduced LOCworkspaces.ts ×17

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: 169 introduced LOC across 17 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/workspaces/common/workspaces.ts 169 introduced LOC · 17 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- workspaces.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 { Event } from '../../../base/common/event.js';
7 > import { isUNC, toSlashes } from '../../../base/common/extpath.js';
8 > import * as json from '../../../base/common/json.js';
9 > import * as jsonEdit from '../../../base/common/jsonEdit.js';
10 > import { FormattingOptions } from '../../../base/common/jsonFormatter.js';
11 > import { normalizeDriveLetter } from '../../../base/common/labels.js';
12 > import { Schemas } from '../../../base/common/network.js';
13 > import { isAbsolute, posix } from '../../../base/common/path.js';
14 > import { isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js';
15 > import { IExtUri, isEqualAuthority } from '../../../base/common/resources.js';
16 > import { URI } from '../../../base/common/uri.js';
17 > import { IWorkspaceBackupInfo, IFolderBackupInfo } from '../../backup/common/backup.js';
18 > import { createDecorator } from '../../instantiation/common/instantiation.js';
19 > import { ILogService } from '../../log/common/log.js';
20 > import { getRemoteAuthority } from '../../remote/common/remoteHosts.js';
21 > import { IBaseWorkspace, IRawFileWorkspaceFolder, IRawUriWorkspaceFolder, IWorkspaceIdentifier, WorkspaceFolder } from '../../workspace/common/workspace.js';
22 >
23 > export const IWorkspacesService = createDecorator<IWorkspacesService>('workspacesService');
24 >
25 > export interface IWorkspacesService {
26 >
27 > readonly _serviceBrand: undefined;
28 >
29 > // Workspaces Management
30 > enterWorkspace(workspaceUri: URI): Promise<IEnterWorkspaceResult | undefined>;
31 > createUntitledWorkspace(folders?: IWorkspaceFolderCreationData[], remoteAuthority?: string): Promise<IWorkspaceIdentifier>;
32 > deleteUntitledWorkspace(workspace: IWorkspaceIdentifier): Promise<void>;
33 > getWorkspaceIdentifier(workspaceUri: URI): Promise<IWorkspaceIdentifier>;
34 >
35 > // Workspaces History
36 > readonly onDidChangeRecentlyOpened: Event<void>;
37 > addRecentlyOpened(recents: IRecent[]): Promise<void>;
38 > removeRecentlyOpened(workspaces: URI[]): Promise<void>;
39 > clearRecentlyOpened(): Promise<void>;
40 > getRecentlyOpened(): Promise<IRecentlyOpened>;
41 >
42 > // Dirty Workspaces
43 > getDirtyWorkspaces(): Promise<Array<IWorkspaceBackupInfo | IFolderBackupInfo>>;
44 > }
45 >
46 > //#region Workspaces Recently Opened
47 >
48 > export interface IRecentlyOpened {
49 > workspaces: Array<IRecentWorkspace | IRecentFolder>;
50 > files: IRecentFile[];
51 > }
52 >
53 > export type IRecent = IRecentWorkspace | IRecentFolder | IRecentFile;
54 >
55 > export interface IRecentWorkspace {
56 > readonly workspace: IWorkspaceIdentifier;
57 > label?: string;
58 > readonly remoteAuthority?: string;
59 > }
60 >
61 > export interface IRecentFolder {
62 > readonly folderUri: URI;
63 > label?: string;
64 > readonly remoteAuthority?: string;
65 > }
66 >
67 > export interface IRecentFile {
68 > readonly fileUri: URI;
69 > label?: string;
70 > readonly remoteAuthority?: string;
71 > }
72 >
73 > export function isRecentWorkspace(curr: IRecent): curr is IRecentWorkspace {
74 return curr.hasOwnProperty('workspace');
75 }
77 > export function isRecentFolder(curr: IRecent): curr is IRecentFolder {
78 return curr.hasOwnProperty('folderUri');
79 }
81 > export function isRecentFile(curr: IRecent): curr is IRecentFile {
82 return curr.hasOwnProperty('fileUri');
83 }
85 > //#endregion
86 >
87 > //#region Workspace File Utilities
88 >
89 > export function isStoredWorkspaceFolder(obj: unknown): obj is IStoredWorkspaceFolder {
90 return isRawFileWorkspaceFolder(obj) || isRawUriWorkspaceFolder(obj);
91 }
93 function isRawFileWorkspaceFolder(obj: unknown): obj is IRawFileWorkspaceFolder {
94 const candidate = obj as IRawFileWorkspaceFolder | undefined;
96 return typeof candidate?.path === 'string' && (!candidate.name || typeof candidate.name === 'string');
97 }
99 function isRawUriWorkspaceFolder(obj: unknown): obj is IRawUriWorkspaceFolder {
100 const candidate = obj as IRawUriWorkspaceFolder | undefined;
102 return typeof candidate?.uri === 'string' && (!candidate.name || typeof candidate.name === 'string');
103 }
105 > export type IStoredWorkspaceFolder = IRawFileWorkspaceFolder | IRawUriWorkspaceFolder;
106 >
107 > export interface IStoredWorkspace extends IBaseWorkspace {
108 > folders: IStoredWorkspaceFolder[];
109 > }
110 >
111 > export interface IWorkspaceFolderCreationData {
112 > readonly uri: URI;
113 > readonly name?: string;
114 > }
115 >
116 > export interface IUntitledWorkspaceInfo {
117 > readonly workspace: IWorkspaceIdentifier;
118 > readonly remoteAuthority?: string;
119 > }
120 >
121 > export interface IEnterWorkspaceResult {
122 > readonly workspace: IWorkspaceIdentifier;
123 > readonly backupPath?: string;
124 > }
125 >
126 > /**
127 > * Given a folder URI and the workspace config folder, computes the `IStoredWorkspaceFolder`
128 > * using a relative or absolute path or a uri.
129 > * Undefined is returned if the `folderURI` and the `targetConfigFolderURI` don't have the
130 > * same schema or authority.
131 > *
132 > * @param folderURI a workspace folder
133 > * @param forceAbsolute if set, keep the path absolute
134 > * @param folderName a workspace name
135 > * @param targetConfigFolderURI the folder where the workspace is living in
136 > */
137 > export function getStoredWorkspaceFolder(folderURI: URI, forceAbsolute: boolean, folderName: string | undefined, targetConfigFolderURI: URI, extUri: IExtUri): IStoredWorkspaceFolder {
138
139 // Scheme mismatch: use full absolute URI as `uri`
180 return { name: folderName, path: folderPath };
181 }
183 function massagePathForWindows(folderPath: string) {
184
195 return folderPath;
196 }
198 > export function toWorkspaceFolders(configuredFolders: IStoredWorkspaceFolder[], workspaceConfigFile: URI, extUri: IExtUri): WorkspaceFolder[] {
199 const result: WorkspaceFolder[] = [];
200 const seen: Set<string> = new Set();
233 return result;
234 }
236 > /**
237 > * Rewrites the content of a workspace file to be saved at a new location.
238 > * Throws an exception if file is not a valid workspace file
239 > */
240 > export function rewriteWorkspaceFileForNewLocation(rawWorkspaceContents: string, configPathURI: URI, isFromUntitledWorkspace: boolean, targetConfigPathURI: URI, extUri: IExtUri) {
241 const storedWorkspace = doParseStoredWorkspace(configPathURI, rawWorkspaceContents);
242
270 return newContent;
271 }
273 function doParseStoredWorkspace(path: URI, contents: string): IStoredWorkspace {
274
285 return storedWorkspace;
286 }
288 > //#endregion
289 >
290 > //#region Workspace Storage
291 >
292 > interface ISerializedRecentWorkspace {
293 > readonly workspace: {
294 > id: string;
295 > configPath: string;
296 > };
297 > readonly label?: string;
298 > readonly remoteAuthority?: string;
299 > }
300 >
301 > interface ISerializedRecentFolder {
302 > readonly folderUri: string;
303 > readonly label?: string;
304 > readonly remoteAuthority?: string;
305 > }
306 >
307 > interface ISerializedRecentFile {
308 > readonly fileUri: string;
309 > readonly label?: string;
310 > readonly remoteAuthority?: string;
311 > }
312 >
313 > interface ISerializedRecentlyOpened {
314 > readonly entries: Array<ISerializedRecentWorkspace | ISerializedRecentFolder | ISerializedRecentFile>; // since 1.55
315 > }
316 >
317 > export type RecentlyOpenedStorageData = object;
318 >
319 function isSerializedRecentWorkspace(data: unknown): data is ISerializedRecentWorkspace {
320 const candidate = data as ISerializedRecentWorkspace | undefined;
322 return typeof candidate?.workspace === 'object' && typeof candidate.workspace.id === 'string' && typeof candidate.workspace.configPath === 'string';
323 }
325 function isSerializedRecentFolder(data: unknown): data is ISerializedRecentFolder {
326 const candidate = data as ISerializedRecentFolder | undefined;
328 return typeof candidate?.folderUri === 'string';
329 }
331 function isSerializedRecentFile(data: unknown): data is ISerializedRecentFile {
332 const candidate = data as ISerializedRecentFile | undefined;
334 return typeof candidate?.fileUri === 'string';
335 }
337 > export function restoreRecentlyOpened(data: RecentlyOpenedStorageData | undefined, logService: ILogService): IRecentlyOpened {
338 const result: IRecentlyOpened = { workspaces: [], files: [] };
339 if (data) {
367 return result;
368 }
370 > export function toStoreData(recents: IRecentlyOpened): RecentlyOpenedStorageData {
371 const serialized: ISerializedRecentlyOpened = { entries: [] };
372
408 return serialized;
409 }
411 > //#endregion