Skip to content

Commit ba868ea

Browse files
authored
Merge pull request #41395 from bnbarham/init-compiler-invocation-use-action
[IDE] Use the passed in Action for setting up an invocation
2 parents 1e493cb + e811c02 commit ba868ea

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

lib/IDE/Utils.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,7 @@ bool ide::initCompilerInvocation(
350350
FrontendOpts.IndexStorePath.clear();
351351
ImporterOpts.IndexStorePath.clear();
352352

353-
// Force the action type to be -typecheck. This affects importing the
354-
// SwiftONoneSupport module.
355-
FrontendOpts.RequestedAction = FrontendOptions::ActionType::Typecheck;
353+
FrontendOpts.RequestedAction = Action;
356354

357355
// We don't care about LLVMArgs
358356
FrontendOpts.LLVMArgs.clear();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source.edit.kind.active:
22
8:9-8:10 source.refactoring.range.kind.basename
3-
source.edit.kind.active:
3+
source.edit.kind.inactive:
44
10:16-10:17 source.refactoring.range.kind.basename
55
source.edit.kind.inactive:
66
12:16-12:17 source.refactoring.range.kind.basename

test/SourceKit/Refactoring/syntactic-rename.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,15 @@ struct Foo {
118118
}
119119

120120
// RUN: %empty-directory(%t.result)
121+
122+
// Ensure that a syntactic rename request does not require the stdlib
123+
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/empty.json %s -- -resource-dir /no/stdlib/here
124+
121125
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/x.in.json %s >> %t.result/x.expected
122126
// RUN: %diff -u %S/syntactic-rename/x.expected %t.result/x.expected
127+
128+
// Note: Even though the #if is true, it is not evaluated since we only parse.
129+
// Thus, both the #if and #else are inactive
123130
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/z.in.json %s >> %t.result/z.expected
124131
// RUN: %diff -u %S/syntactic-rename/z.expected %t.result/z.expected
125132
// RUN: %sourcekitd-test -req=syntactic-rename -rename-spec %S/syntactic-rename/foo.in.json %s >> %t.result/foo_arity1.expected
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source.edit.kind.active:
22
8:9-8:10 "foo"
3-
source.edit.kind.active:
3+
source.edit.kind.inactive:
44
10:16-10:17 "foo"
55
source.edit.kind.inactive:
66
12:16-12:17 "foo"

0 commit comments

Comments
 (0)