@@ -16,7 +16,7 @@ import CoreCommands
1616import var TSCBasic. stdoutStream
1717
1818extension SwiftPackageCommand {
19- struct CompletionCommand : SwiftCommand {
19+ struct CompletionCommand : AsyncSwiftCommand {
2020 static let configuration = CommandConfiguration (
2121 commandName: " completion-tool " ,
2222 abstract: " Completion command (for shell completions) "
@@ -52,7 +52,7 @@ extension SwiftPackageCommand {
5252 @Argument ( help: " generate-bash-script | generate-zsh-script | \n generate-fish-script | list-dependencies | list-executables " )
5353 var mode : Mode
5454
55- func run( _ swiftCommandState: SwiftCommandState ) throws {
55+ func run( _ swiftCommandState: SwiftCommandState ) async throws {
5656 switch mode {
5757 case . generateBashScript:
5858 let script = SwiftCommand . completionScript ( for: . bash)
@@ -64,7 +64,7 @@ extension SwiftPackageCommand {
6464 let script = SwiftCommand . completionScript ( for: . fish)
6565 print ( script)
6666 case . listDependencies:
67- let graph = try swiftCommandState. loadPackageGraph ( )
67+ let graph = try await swiftCommandState. loadPackageGraph ( )
6868 // command's result output goes on stdout
6969 // ie "swift package list-dependencies" should output to stdout
7070 ShowDependencies . dumpDependenciesOf (
@@ -74,14 +74,14 @@ extension SwiftPackageCommand {
7474 on: TSCBasic . stdoutStream
7575 )
7676 case . listExecutables:
77- let graph = try swiftCommandState. loadPackageGraph ( )
77+ let graph = try await swiftCommandState. loadPackageGraph ( )
7878 let package = graph. rootPackages [ graph. rootPackages. startIndex] . underlying
7979 let executables = package . modules. filter { $0. type == . executable }
8080 for executable in executables {
8181 print ( executable. name)
8282 }
8383 case . listSnippets:
84- let graph = try swiftCommandState. loadPackageGraph ( )
84+ let graph = try await swiftCommandState. loadPackageGraph ( )
8585 let package = graph. rootPackages [ graph. rootPackages. startIndex] . underlying
8686 let executables = package . modules. filter { $0. type == . snippet }
8787 for executable in executables {
0 commit comments