@@ -288,8 +288,8 @@ static sourcekitd_response_t editorExtractTextFromComment(StringRef Source);
288
288
289
289
static sourcekitd_response_t editorConvertMarkupToXML(StringRef Source);
290
290
291
- static sourcekitd_response_t
292
- editorClose(StringRef Name, bool RemoveCache);
291
+ static sourcekitd_response_t editorClose(StringRef Name, bool CancelBuilds,
292
+ bool RemoveCache);
293
293
294
294
static sourcekitd_response_t
295
295
editorReplaceText(StringRef Name, llvm::MemoryBuffer *Buf, unsigned Offset,
@@ -831,10 +831,14 @@ handleRequestEditorClose(const RequestDict &Req,
831
831
if (!Name.has_value())
832
832
return Rec(createErrorRequestInvalid(" missing ' key.name' " ));
833
833
834
+ // Whether to cancel in-flight builds, default true.
835
+ int64_t CancelBuilds = true;
836
+ Req.getInt64(KeyCancelBuilds, CancelBuilds, /*isOptional=*/true);
837
+
834
838
// Whether we remove the cached AST from libcache, by default, false.
835
839
int64_t RemoveCache = false;
836
840
Req.getInt64(KeyRemoveCache, RemoveCache, /*isOptional=*/true);
837
- return Rec(editorClose(*Name, RemoveCache));
841
+ return Rec(editorClose(*Name, CancelBuilds, RemoveCache));
838
842
}
839
843
}
840
844
@@ -3656,11 +3660,11 @@ editorOpenHeaderInterface(StringRef Name, StringRef HeaderName,
3656
3660
return EditC.createResponse ();
3657
3661
}
3658
3662
3659
- static sourcekitd_response_t
3660
- editorClose (StringRef Name, bool RemoveCache) {
3663
+ static sourcekitd_response_t editorClose (StringRef Name, bool CancelBuilds,
3664
+ bool RemoveCache) {
3661
3665
ResponseBuilder RespBuilder;
3662
3666
LangSupport &Lang = getGlobalContext ().getSwiftLangSupport ();
3663
- Lang.editorClose (Name, RemoveCache);
3667
+ Lang.editorClose (Name, CancelBuilds, RemoveCache);
3664
3668
return RespBuilder.createResponse ();
3665
3669
}
3666
3670
0 commit comments