@@ -288,8 +288,8 @@ static sourcekitd_response_t editorExtractTextFromComment(StringRef Source);
288288
289289static sourcekitd_response_t editorConvertMarkupToXML(StringRef Source);
290290
291- static sourcekitd_response_t
292- editorClose(StringRef Name, bool RemoveCache);
291+ static sourcekitd_response_t editorClose(StringRef Name, bool CancelBuilds,
292+ bool RemoveCache);
293293
294294static sourcekitd_response_t
295295editorReplaceText(StringRef Name, llvm::MemoryBuffer *Buf, unsigned Offset,
@@ -831,10 +831,14 @@ handleRequestEditorClose(const RequestDict &Req,
831831 if (!Name.has_value())
832832 return Rec(createErrorRequestInvalid(" missing ' key.name' " ));
833833
834+ // Whether to cancel in-flight builds, default true.
835+ int64_t CancelBuilds = true;
836+ Req.getInt64(KeyCancelBuilds, CancelBuilds, /*isOptional=*/true);
837+
834838 // Whether we remove the cached AST from libcache, by default, false.
835839 int64_t RemoveCache = false;
836840 Req.getInt64(KeyRemoveCache, RemoveCache, /*isOptional=*/true);
837- return Rec(editorClose(*Name, RemoveCache));
841+ return Rec(editorClose(*Name, CancelBuilds, RemoveCache));
838842 }
839843}
840844
@@ -3656,11 +3660,11 @@ editorOpenHeaderInterface(StringRef Name, StringRef HeaderName,
36563660 return EditC.createResponse ();
36573661}
36583662
3659- static sourcekitd_response_t
3660- editorClose (StringRef Name, bool RemoveCache) {
3663+ static sourcekitd_response_t editorClose (StringRef Name, bool CancelBuilds,
3664+ bool RemoveCache) {
36613665 ResponseBuilder RespBuilder;
36623666 LangSupport &Lang = getGlobalContext ().getSwiftLangSupport ();
3663- Lang.editorClose (Name, RemoveCache);
3667+ Lang.editorClose (Name, CancelBuilds, RemoveCache);
36643668 return RespBuilder.createResponse ();
36653669}
36663670
0 commit comments