Skip to content

Commit 9dabad4

Browse files
authored
Merge pull request #40491 from apple/revert-40353-pr/no-semantic-info-if-not-requested
Revert "[SourceKit] Don't build an AST if no semantic info is requested"
2 parents aeceaf7 + a5b3f83 commit 9dabad4

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

test/SourceKit/CodeExpand/code-expand-rdar77665805.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ func test() {
66

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

test/SourceKit/CursorInfo/cursor_after_edit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
// buffer to calculate line and column (before rdar://78161348).
88
// RUN: %sourcekitd-test \
99
// RUN: -req=open -text-input %t/empty.swift %t/func.swift -- %t/func.swift == \
10-
// 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 == \
10+
// RUN: -req=edit -offset=0 -length=0 -replace="func foo() {}" -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/func.swift -- %t/func.swift == \
1111
// RUN: -req=cursor -offset=5 %t/func.swift -- %t/func.swift

test/SourceKit/Sema/edit_nowait.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
// EDIT_NOWAIT-NEXT: }
1616

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

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,18 +2664,7 @@ class SKEditorConsumer : public EditorConsumer {
26642664
sourcekitd_response_t createResponse();
26652665

26662666
bool needsSemanticInfo() override {
2667-
if (Opts.SyntacticOnly) {
2668-
return false;
2669-
} else if (isSemanticEditorDisabled()) {
2670-
return false;
2671-
} else if (!documentStructureEnabled() &&
2672-
!syntaxMapEnabled() &&
2673-
!diagnosticsEnabled() &&
2674-
!syntaxTreeEnabled()) {
2675-
return false;
2676-
} else {
2677-
return true;
2678-
}
2667+
return !Opts.SyntacticOnly && !isSemanticEditorDisabled();
26792668
}
26802669

26812670
void handleRequestError(const char *Description) override;

0 commit comments

Comments
 (0)