From 00aebd665945b1bcbf1390dc97ec72d234407635 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 23 May 2024 13:58:54 -0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20cancel=20build=20when=20closing?= =?UTF-8?q?=20a=20document?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In SourceKit-LSP, we can get into the following situation: 1. We open A.swift 2. We issue a request for A.swift, the request takes a while to execute 3. The dependencies of A.swift are updated, which causes us to reopen the document in sourcekitd, so that the AST is rebuilt 4. This shouldn’t cause the request from (2) to be cancelled. We should continue executing it and only re-open the document after the request from (2) has finished rdar://127475366 --- Sources/SourceKitLSP/Swift/SwiftLanguageService.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/SourceKitLSP/Swift/SwiftLanguageService.swift b/Sources/SourceKitLSP/Swift/SwiftLanguageService.swift index ed341adb..69a3b5cd 100644 --- a/Sources/SourceKitLSP/Swift/SwiftLanguageService.swift +++ b/Sources/SourceKitLSP/Swift/SwiftLanguageService.swift @@ -382,6 +382,7 @@ extension SwiftLanguageService { keys.enableDiagnostics: 0, keys.syntacticOnly: 1, keys.compilerArgs: compileCommand?.compilerArgs as [SKDRequestValue]?, + keys.cancelBuilds: 0, ]) }