fileService.ts ×4

Frontier kind: Code frontier

unlabeled · c_86b0223d3a6c

1025 tests · 11345 LOC · 44 files · introduces 0 tests · 31 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges31 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1759 ranges11345 lines · 44 files · Browse complete extent
All tests (intent)
1025 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.

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.

2 files ranked by introduced lines: 31 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/files/common/fileService.ts 27 introduced LOC · 4 ranges

Open complete file

216
217 const stat = await provider.stat(resource);
219 > let trie: TernarySearchTree<URI, boolean> | undefined;
220 >
221 > return this.toFileStat(provider, resource, stat, undefined, !!resolveMetadata, (stat, siblings) => {
222
223 // lazy trie to check for recursive resolving
247 private async toFileStat(provider: IFileSystemProvider, resource: URI, stat: IStat, siblings: number | undefined, resolveMetadata: true, recurse: (stat: IFileStat, siblings?: number) => boolean): Promise<IFileStatWithMetadata>;
248 private async toFileStat(provider: IFileSystemProvider, resource: URI, stat: IStat | { type: FileType } & Partial<IStat>, siblings: number | undefined, resolveMetadata: boolean, recurse: (stat: IFileStat, siblings?: number) => boolean): Promise<IFileStat> {
249 > const { providerExtUri } = this.getExtUri(provider); fileService.ts
250 >
251 > // convert to file stat
252 > const fileStat: IFileStat = {
253 > resource,
254 > name: providerExtUri.basename(resource),
255 > isFile: (stat.type & FileType.File) !== 0,
256 > isDirectory: (stat.type & FileType.Directory) !== 0,
257 > isSymbolicLink: (stat.type & FileType.SymbolicLink) !== 0,
258 > mtime: stat.mtime,
259 > ctime: stat.ctime,
260 > size: stat.size,
261 > readonly: Boolean((stat.permissions ?? 0) & FilePermission.Readonly) || Boolean(provider.capabilities & FileSystemProviderCapabilities.Readonly),
262 > locked: Boolean((stat.permissions ?? 0) & FilePermission.Locked),
263 > executable: Boolean((stat.permissions ?? 0) & FilePermission.Executable),
264 > etag: etag({ mtime: stat.mtime, size: stat.size }),
265 > children: undefined
266 > };
267 >
268 > // check to recurse for directories
269 > if (fileStat.isDirectory && recurse(fileStat, siblings)) {
270 try {
271 const entries = await provider.readdir(resource);
295
296 return fileStat;
297 > } fileService.ts
298
299 async resolveAll(toResolve: { resource: URI; options?: IResolveFileOptions }[]): Promise<IFileStatResult[]>;
src/vs/platform/files/common/files.ts 4 introduced LOC · 2 ranges

Open complete file

1569 export function etag(stat: { mtime: number | undefined; size: number | undefined }): string | undefined;
1570 export function etag(stat: { mtime: number | undefined; size: number | undefined }): string | undefined {
1571 > if (typeof stat.size !== 'number' || typeof stat.mtime !== 'number') { files.ts
1572 return undefined;
1573 }
1574 > files.ts
1575 > return stat.mtime.toString(29) + stat.size.toString(31);
1576 > }
1577
1578 export async function whenProviderRegistered(file: URI, fileService: IFileService): Promise<void> {