Skip to content

Commit 5922187

Browse files
committed
Update PrepareHandler comments
1 parent 5c78d0b commit 5922187

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/SourceKitBazelBSP/RequestHandlers/PrepareHandler.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ final class PrepareHandler {
3333
private weak var connection: LSPConnection?
3434

3535
// Prevent redundant builds of the same targets
36+
// FIXME: Need to understand how exactly this request is dispatched from sourcekit-lsp, as
37+
// we see for example multiple build requests for the same target. So we have this
38+
// for now just to make sure the example project works.
3639
private var didRun = false
3740

3841
init(
@@ -51,7 +54,6 @@ final class PrepareHandler {
5154
_: BuildTargetPrepareRequest,
5255
_ id: RequestID
5356
) throws -> VoidResponse {
54-
// FIXME: Invalidate on changes
5557
guard !didRun else {
5658
logger.info("Build already completed, skipping redundant build")
5759
return VoidResponse()
@@ -97,4 +99,8 @@ final class PrepareHandler {
9799

98100
logger.info("Finished building targets!")
99101
}
102+
103+
func invalidateBuildCache() {
104+
didRun = false
105+
}
100106
}

0 commit comments

Comments
 (0)