MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / getPubWorkspaceOrPackageFolderUris

Function getPubWorkspaceOrPackageFolderUris

src/shared/vscode/pub.ts:286–292  ·  view source on GitHub ↗
(packageFolderOrPubspecUris: Uri[])

Source from the content-addressed store, hash-verified

284 * If any URIs are non-file URIs, they will be dropped.
285 */
286export function getPubWorkspaceOrPackageFolderUris(packageFolderOrPubspecUris: Uri[]): Uri[] {
287 const packageFolderPaths = packageFolderOrPubspecUris
288 .filter((uri) => uri.scheme === "file")
289 .map((uri) => fsPath(uri));
290 const mappedPaths = getPubWorkspaceOrPackageFolderPaths(packageFolderPaths);
291 return mappedPaths.map((mappedPath) => Uri.file(mappedPath));
292}
293
294/**
295 * If `packageFolderOrPubspecUri` is part of a Pub Workspace, returns the workspace root folder URI.

Callers 1

runPackageCommandMethod · 0.90

Calls 2

fsPathFunction · 0.90

Tested by

no test coverage detected