Skip to content

Commit f373ef3

Browse files
committed
[sourcekitd] Make code-completion obey the semantic-editor-delay
These are semantic requests and should obey the delay to ensure we don't trigger too many crashes. rdar://18326221
1 parent 692dd86 commit f373ef3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,9 @@ handleSemanticRequest(RequestDict Req,
720720

721721
llvm::SmallString<64> ErrBuf;
722722

723+
if (isSemanticEditorDisabled())
724+
return Rec(createErrorRequestFailed("semantic editor is disabled"));
725+
723726
if (ReqUID == RequestCodeComplete) {
724727
std::unique_ptr<llvm::MemoryBuffer>
725728
InputBuf = getInputBufForRequest(SourceFile, SourceText, ErrBuf);
@@ -767,9 +770,6 @@ handleSemanticRequest(RequestDict Req,
767770
return Rec(indexSource(*SourceFile, Args, Hash));
768771
}
769772

770-
if (isSemanticEditorDisabled())
771-
return Rec(createErrorRequestFailed("semantic editor is disabled"));
772-
773773
if (ReqUID == RequestCursorInfo) {
774774
LangSupport &Lang = getGlobalContext().getSwiftLangSupport();
775775

0 commit comments

Comments
 (0)