You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Workspace/Workspace.swift
+43-6Lines changed: 43 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
/*
2
2
This source file is part of the Swift.org open source project
3
3
4
-
Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
4
+
Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
5
5
Licensed under Apache License v2.0 with Runtime Library Exception
6
6
7
7
See http://swift.org/LICENSE.txt for license information
@@ -38,6 +38,12 @@ public enum WorkspaceResolveReason: Equatable {
38
38
/// The delegate interface used by the workspace to report status information.
39
39
publicprotocolWorkspaceDelegate:class{
40
40
41
+
/// The workspace is about to load a package manifest (which might be in the cache, or might need to be parsed). Note that this does not include speculative loading of manifests that may occr during dependency resolution; rather, it includes only the final manifest loading that happens after a particular package version has been checked out into a working directory.
/// The workspace has loaded a package manifest, either successfully or not. The manifest is nil if an error occurs, in which case there will also be at least one error in the list of diagnostics (there may be warnings even if a manifest is loaded successfully).
func willClone(repository url:String, to path:AbsolutePath){
102
+
cloning(repository: url)
103
+
}
104
+
func didClone(repository url:String, to path:AbsolutePath, error:Diagnostic?){}
105
+
func cloning(repository:String){}
106
+
func willCheckOut(repository url:String, revision:String, at path:AbsolutePath){
107
+
checkingOut(repository: url, atReference: revision, to: path)
108
+
}
109
+
func didCheckOut(repository url:String, revision:String, at path:AbsolutePath, error:Diagnostic?){}
81
110
func checkingOut(repository:String, atReference:String, to path:AbsolutePath){}
82
111
func repositoryWillUpdate(_ repository:String){}
83
112
func repositoryDidUpdate(_ repository:String){}
@@ -1255,7 +1284,10 @@ extension Workspace {
1255
1284
packageKind:PackageReference.Kind,
1256
1285
diagnostics:DiagnosticsEngine
1257
1286
)->Manifest?{
1258
-
return diagnostics.with(location:PackageLocation.Local(packagePath: packagePath)){ diagnostics in
1287
+
// Load the manifest, bracketed by the calls to the delegate callbacks. The delegate callback is only passed any diagnostics emited during the parsing of the manifest, but they are also forwarded up to the caller.
0 commit comments