Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/SourceKit/CodeExpand/code-expand-rdar77665805.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func test() {

// RUN: %sourcekitd-test \
// RUN: -req=open %s -- %s == \
// RUN: -req=edit -offset=0 -length=53 -replace="" -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %s -- %s == \
// RUN: -req=edit -offset=0 -length=53 -replace="" -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 -dont-print-response %s -- %s == \
// RUN: -req=expand-placeholder -offset=23 -length=18 %s \
// RUN: | %FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion test/SourceKit/CursorInfo/cursor_after_edit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
// buffer to calculate line and column (before rdar://78161348).
// RUN: %sourcekitd-test \
// RUN: -req=open -text-input %t/empty.swift %t/func.swift -- %t/func.swift == \
// RUN: -req=edit -offset=0 -length=0 -replace="func foo() {}" -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/func.swift -- %t/func.swift == \
// RUN: -req=edit -offset=0 -length=0 -replace="func foo() {}" -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 -dont-print-response %t/func.swift -- %t/func.swift == \
// RUN: -req=cursor -offset=5 %t/func.swift -- %t/func.swift
6 changes: 3 additions & 3 deletions test/SourceKit/Sema/edit_nowait.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// EDIT_NOWAIT-NEXT: }

// RUN: %sourcekitd-test \
// RUN: -req=open -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift -- %t/t.swift == \
// RUN: -req=open -req-opts=enablesyntaxmap=0,enablesubstructure=1,enablediagnostics=0 %t/t.swift -- %t/t.swift == \
// RUN: -req=print-annotations %t/t.swift == \
// RUN: -req=edit -offset=0 -replace="func foo() { warn("") }" -length=16 -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift == \
// RUN: -req=edit -offset=13 -replace="print" -length=4 -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift == \
// RUN: -req=edit -offset=0 -replace="func foo() { warn("") }" -length=16 -req-opts=enablesyntaxmap=0,enablesubstructure=1,enablediagnostics=0 %t/t.swift == \
// RUN: -req=edit -offset=13 -replace="print" -length=4 -req-opts=enablesyntaxmap=0,enablesubstructure=1,enablediagnostics=0 %t/t.swift == \
// RUN: -req=print-annotations %t/t.swift \
// RUN: | %FileCheck --check-prefix=ANNOTATION %s

Expand Down
13 changes: 12 additions & 1 deletion tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,18 @@ class SKEditorConsumer : public EditorConsumer {
sourcekitd_response_t createResponse();

bool needsSemanticInfo() override {
return !Opts.SyntacticOnly && !isSemanticEditorDisabled();
if (Opts.SyntacticOnly) {
return false;
} else if (isSemanticEditorDisabled()) {
return false;
} else if (!documentStructureEnabled() &&
!syntaxMapEnabled() &&
!diagnosticsEnabled() &&
!syntaxTreeEnabled()) {
return false;
} else {
return true;
}
}

void handleRequestError(const char *Description) override;
Expand Down