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

Function getPubWorkspaceFolderOrPackageFolderUri

src/shared/vscode/pub.ts:299–303  ·  view source on GitHub ↗
(packageFolderOrPubspecUri: Uri)

Source from the content-addressed store, hash-verified

297 * Otherwise (or if there is no workspace root, or URI is not file-scheme), returns `packageFolderOrPubspecUri`.
298 */
299export function getPubWorkspaceFolderOrPackageFolderUri(packageFolderOrPubspecUri: Uri): Uri {
300 return packageFolderOrPubspecUri.scheme === "file"
301 ? Uri.file(getPubWorkspaceFolderOrPackageFolderPath(fsPath(packageFolderOrPubspecUri)))
302 : packageFolderOrPubspecUri;
303}
304
305/**
306 * If `packageFolderOrPubspecPath` is part of a Pub Workspace, returns the workspace root folder.

Callers 1

runPackageCommandMethod · 0.90

Calls 2

fsPathFunction · 0.90

Tested by

no test coverage detected