Skip to content

Commit

Permalink
Fix empty folder in dependencies view for registry deps (#1311)
Browse files Browse the repository at this point in the history
Registry dependencies are stored in a different location than those
checked out from source control.

Issue: #1307
  • Loading branch information
plemarquand authored Jan 14, 2025
1 parent c5c3bd4 commit 5d8f620
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SwiftPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export interface CheckoutState {

export interface WorkspaceStateDependency {
packageRef: { identity: string; kind: string; location: string; name: string };
state: { name: string; path?: string; checkoutState?: CheckoutState };
state: { name: string; path?: string; checkoutState?: CheckoutState; version?: string };
subpath: string;
}

Expand Down
7 changes: 6 additions & 1 deletion src/ui/PackageDependencyProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ export class PackageDependenciesProvider implements vscode.TreeDataProvider<Tree
dependency.state.checkoutState?.version ??
dependency.state.checkoutState?.branch ??
dependency.state.checkoutState?.revision.substring(0, 7) ??
dependency.state.version ??
"unknown"
);
}
Expand Down Expand Up @@ -389,7 +390,11 @@ export class PackageDependenciesProvider implements vscode.TreeDataProvider<Tree
workspaceFolder,
true
);
return path.join(buildDirectory, "checkouts", dependency.subpath);
if (dependency.packageRef.kind === "registry") {
return path.join(buildDirectory, "registry", "downloads", dependency.subpath);
} else {
return path.join(buildDirectory, "checkouts", dependency.subpath);
}
}
}
}

0 comments on commit 5d8f620

Please sign in to comment.