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
We originally started preparing and indexing the low-level targets in the hope that we can unblock the files of those targets as early as possible for indexing and thus get best indexing performance. Revisiting this design decision, we can actually get a ~2x speed up (SourceKit-LSP gets indexed in 2:45 instead of 5:49 minutes on my machine) in initial indexing performance by preparing indexing top-level targets first. This speed-up is for two reasons:
- When preparing a top-level target, all of its dependencies are implicitly also prepared. That means that we don’t need to send any prepare requests to the build server for those targets, which is very advantages for SwiftPM projects, in which the constant cost in the order of 500ms (based on my memory) even for a null build.
- The underlying build server is able to prepare dependencies of the top-level target in parallel instead of implicitly serializing them by preparing all targets in the package in dependency order.
Copy file name to clipboardExpand all lines: Contributor Documentation/BSP Extensions.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,18 +100,29 @@ To do so, the build server should perform any work that is necessary to typechec
100
100
The server communicates during the initialize handshake whether this method is supported or not by setting `prepareProvider: true` in `SourceKitInitializeBuildResponseData`.
101
101
102
102
- method: `buildTarget/prepare`
103
-
- params: `PrepareParams`
104
-
- result: `void`
103
+
- params: `BuildTargetPrepareRequest`
104
+
- result: `BuildTargetPrepareResponse`
105
105
106
106
```ts
107
-
exportinterfacePrepareParams {
107
+
exportinterfaceBuildTargetPrepareRequest {
108
108
/** A list of build targets to prepare. */
109
109
targets:BuildTargetIdentifier[];
110
110
111
111
/** A unique identifier generated by the client to identify this request.
112
112
* The server may include this id in triggered notifications or responses. **/
113
113
originId?:OriginId;
114
114
}
115
+
116
+
exportinterfaceBuildTargetPrepareResponse {
117
+
/**
118
+
* Targets that were implicitly prepared by the prepare request.
119
+
*
120
+
* For example, a target may be implicitly prepared if one if its dependents gets prepared.
121
+
*
122
+
* When omitted, this is the same as an empty array.
0 commit comments