Skip to content

Commit 5d8f620

Browse files
authored
Fix empty folder in dependencies view for registry deps (#1311)
Registry dependencies are stored in a different location than those checked out from source control. Issue: #1307
1 parent c5c3bd4 commit 5d8f620

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/SwiftPackage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export interface CheckoutState {
148148

149149
export interface WorkspaceStateDependency {
150150
packageRef: { identity: string; kind: string; location: string; name: string };
151-
state: { name: string; path?: string; checkoutState?: CheckoutState };
151+
state: { name: string; path?: string; checkoutState?: CheckoutState; version?: string };
152152
subpath: string;
153153
}
154154

src/ui/PackageDependencyProvider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ export class PackageDependenciesProvider implements vscode.TreeDataProvider<Tree
358358
dependency.state.checkoutState?.version ??
359359
dependency.state.checkoutState?.branch ??
360360
dependency.state.checkoutState?.revision.substring(0, 7) ??
361+
dependency.state.version ??
361362
"unknown"
362363
);
363364
}
@@ -389,7 +390,11 @@ export class PackageDependenciesProvider implements vscode.TreeDataProvider<Tree
389390
workspaceFolder,
390391
true
391392
);
392-
return path.join(buildDirectory, "checkouts", dependency.subpath);
393+
if (dependency.packageRef.kind === "registry") {
394+
return path.join(buildDirectory, "registry", "downloads", dependency.subpath);
395+
} else {
396+
return path.join(buildDirectory, "checkouts", dependency.subpath);
397+
}
393398
}
394399
}
395400
}

0 commit comments

Comments
 (0)