return await this.stat(resource);
} catch (error) {
}
}
Frontier kind: Joint frontier
unlabeled · c_5d66618410ba
6 tests · 27079 LOC · 101 files · introduces 5 tests · 79 LOC · 3 files
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.
Every exact file and test below is linked only from the concept that introduces it.
mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: cache dir includes sdkTarget so Universal launches stay separate|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: cache miss → downloads, extracts, writes sentinel|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: concurrent calls in same process share one download|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: reports monotonic download progress ending at totalBytes|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: substitutes {sdkTarget} into urlTemplate|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1mocha: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=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1Every collected test enters the hierarchy at exactly one concept.
5 tests introduced at this concept.
agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: cache dir includes sdkTarget so Universal launches stay separate|occurrence=1agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: cache miss → downloads, extracts, writes sentinel|occurrence=1agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: concurrent calls in same process share one download|occurrence=1agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: reports monotonic download progress ending at totalBytes|occurrence=1agentSdkDownloader.test|title=AgentSdkDownloader loadSdkRoot: substitutes {sdkTarget} into urlTemplate|occurrence=1Every collected source range enters the hierarchy at exactly one concept.
3 files ranked by introduced lines: 79 introduced LOC across 18 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
return await this.stat(resource);
} catch (error) {
}
}
const result: [string, FileType][] = [];
await Promise.all(children.map(async child => {
let type: FileType;
if (child.isSymbolicLink()) {
type = (await this.stat(joinPath(resource, child.name))).type; // always resolve target the link points to if any
type = this.toType(child);
}
result.push([child.name, type]);
} catch (error) {
this.logService.trace(error); // ignore errors for individual entries that can arise from permission denied
}
return this.doWriteFileAtomic(resource, joinPath(resourcesDirname(resource), `${resourcesBasename(resource)}${opts.atomic.postfix}`), content, opts);
} else {
}
}
let lock: IDisposable | undefined = undefined;
if (isFileOpenForWriteOptions(opts) && !disableWriteLock) {
}
let fd: number | undefined = undefined;
if (lock) {
// Remember that this handle has an associated lock
this.traceLock(`[Disk FileSystemProvider]: open() - storing lock for handle ${fd} (${filePath})`);
this.mapHandleToLock.set(fd, lock);
// There is a slight chance that a resource lock for a
// handle was not yet disposed when we acquire a new
// lock, so we must ensure to dispose the previous lock
// before storing a new one for the same handle, other
// wise we end up in a deadlock situation
// https://github.com/microsoft/vscode/issues/142462
if (previousLock) {
this.traceLock(`[Disk FileSystemProvider]: open() - disposing a previous lock that was still stored on same handle ${fd} (${filePath})`);
previousLock.dispose();
}
return fd;
} finally {
if (lockForHandle) {
this.traceLock(`[Disk FileSystemProvider]: close() - resource lock removed from handle-lock map ${fd}`);
this.mapHandleToLock.delete(fd); // only delete from map if this is still our lock!
}
this.traceLock(`[Disk FileSystemProvider]: close() - disposing lock for handle ${fd}`);
lockForHandle.dispose();
}
}
}
await Promises.rm(filePath, RimRafMode.MOVE, rmMoveToPath);
} else {
await promises.unlink(filePath);
} catch (unlinkError) {
// `fs.unlink` will throw when used on directories
}
}
} catch (error) {
throw this.toFileSystemProviderError(error);
const toStat = await this.statIgnoreError(to);
if (!toStat) {
}
if (!overwrite) {
this._fireProgress(pkg, downloadId, 'progress', receivedBytes, totalBytes);
});
await this._fileService.del(URI.file(tarballPath));
// Write the `.complete` sentinel inside the tmp dir BEFORE the
// move so the move atomically publishes a directory that
// already carries its sentinel — a crash between move and
// sentinel-write can't leave a wedged, sentinel-less cacheDir
// behind. Content is intentionally empty: only existence
// matters, and the cache dir path already encodes
// `<pkg>/<version>/<sdkTarget>` for debugging.
await this._fileService.writeFile(
URI.joinPath(tmpDirUri, '.complete'),
VSBuffer.fromString(''),
);
// Atomic publish of the completed extraction.
try {
await this._fileService.move(tmpDirUri, URI.file(cacheDir));
} catch (err) {
if (await this._handleRenameLoser(err, sentinel, tmpDirUri)) {
this._logService.info(`[AgentSdkDownloader] ${pkg.id}: lost rename race, using existing cache`);
throw err;
}
const elapsed = Math.round((Date.now() - start) / 1000);
this._logService.info(`[AgentSdkDownloader] ${pkg.id}: downloaded in ${elapsed}s`);
this._fireProgress(pkg, downloadId, 'completed', lastTotal ?? lastReceived, lastTotal);
return cacheDir;
};
const settleResolve = () => {
settled = true;
cancelSub.dispose();
resolve();
};
const settleReject = (err: unknown) => {
if (settled) { return; }
});
context.stream.on('end', () => {
out.end();
});
context.stream.on('error', settleReject);
private async _extractTarGz(tarball: string, dest: string): Promise<void> {
// runs on without depending on a system `tar` binary.
await tar.x({ file: tarball, cwd: dest });
}
private async _delIgnoringMissing(uri: URI): Promise<void> {
let writeFileOptions = options;
if (hasFileAtomicWriteCapability(provider) && !writeFileOptions?.atomic) {
if (enforcedAtomicWrite) {
writeFileOptions = { ...options, atomic: enforcedAtomicWrite };
}
try {