Skip to content

Commit 415452e

Browse files
authored
Merge pull request #37145 from bnbarham/add-external-locs
Add locations from external modules to cursor info results
2 parents 981d41f + 73d9f5b commit 415452e

File tree

22 files changed

+308
-235
lines changed

22 files changed

+308
-235
lines changed

include/swift/IDE/Utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ bool initCompilerInvocation(
8787
DiagnosticEngine &Diags, StringRef UnresolvedPrimaryFile,
8888
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
8989
const std::string &runtimeResourcePath,
90-
const std::string &diagnosticDocumentationPath,
91-
bool shouldOptimizeForIDE, time_t sessionTimestamp, std::string &Error);
90+
const std::string &diagnosticDocumentationPath, time_t sessionTimestamp,
91+
std::string &Error);
9292

9393
bool initInvocationByClangArguments(ArrayRef<const char *> ArgList,
9494
CompilerInvocation &Invok,

lib/Frontend/CompilerInvocation.cpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -711,21 +711,15 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
711711
Opts.VerifySyntaxTree = true;
712712
}
713713

714+
// Configure lexing to parse and remember comments if:
715+
// - Emitting a swiftdoc/swiftsourceinfo
716+
// - Performing index-while-building
717+
// - Emitting a symbol graph file
714718
// If we are asked to emit a module documentation file, configure lexing and
715719
// parsing to remember comments.
716-
if (FrontendOpts.InputsAndOutputs.hasModuleDocOutputPath()) {
717-
Opts.AttachCommentsToDecls = true;
718-
}
719-
720-
// If we are doing index-while-building, configure lexing and parsing to
721-
// remember comments.
722-
if (!FrontendOpts.IndexStorePath.empty()) {
723-
Opts.AttachCommentsToDecls = true;
724-
}
725-
726-
// If we are emitting a symbol graph file, configure lexing and parsing to
727-
// remember comments.
728-
if (FrontendOpts.EmitSymbolGraph) {
720+
if (FrontendOpts.InputsAndOutputs.hasModuleDocOutputPath() ||
721+
FrontendOpts.InputsAndOutputs.hasModuleSourceInfoOutputPath() ||
722+
!FrontendOpts.IndexStorePath.empty() || FrontendOpts.EmitSymbolGraph) {
729723
Opts.AttachCommentsToDecls = true;
730724
}
731725

lib/IDE/CommentConversion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ visitDocComment(const DocComment *DC, TypeOrExtensionDecl SynthesizedTarget) {
315315

316316
{
317317
// Print line and column number.
318-
auto Loc = D->getLoc();
318+
auto Loc = D->getLoc(/*SerializedOK=*/true);
319319
if (Loc.isValid()) {
320320
const auto &SM = D->getASTContext().SourceMgr;
321321
StringRef FileName = SM.getDisplayNameForLoc(Loc);

lib/IDE/Utils.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ bool ide::initCompilerInvocation(
276276
DiagnosticEngine &Diags, StringRef UnresolvedPrimaryFile,
277277
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
278278
const std::string &runtimeResourcePath,
279-
const std::string &diagnosticDocumentationPath,
280-
bool shouldOptimizeForIDE, time_t sessionTimestamp, std::string &Error) {
279+
const std::string &diagnosticDocumentationPath, time_t sessionTimestamp,
280+
std::string &Error) {
281281
SmallVector<const char *, 16> Args;
282282
// Make sure to put '-resource-dir' and '-diagnostic-documentation-path' at
283283
// the top to allow overriding them with the passed in arguments.
@@ -348,15 +348,6 @@ bool ide::initCompilerInvocation(
348348
// We don't care about LLVMArgs
349349
FrontendOpts.LLVMArgs.clear();
350350

351-
// SwiftSourceInfo files provide source location information for decls coming
352-
// from loaded modules. For most IDE use cases it either has an undesirable
353-
// impact on performance with no benefit (code completion), results in stale
354-
// locations being used instead of more up-to-date indexer locations (cursor
355-
// info), or has no observable effect (diagnostics, which are filtered to just
356-
// those with a location in the primary file, and everything else).
357-
if (shouldOptimizeForIDE)
358-
FrontendOpts.IgnoreSwiftSourceInfo = true;
359-
360351
// To save the time for module validation, consider the lifetime of ASTManager
361352
// as a single build session.
362353
// NOTE: Do this only if '-disable-modules-validate-system-headers' is *not*

test/SourceKit/CursorInfo/cursor_info.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ func checkAnyIsAKeyword(x: Any) {}
284284
// CHECK5-NEXT: (Int) -> (){{$}}
285285

286286
// RUN: %sourcekitd-test -req=cursor -pos=9:32 %s -- -F %S/../Inputs/libIDE-mock-sdk -I %t.tmp %s | %FileCheck -check-prefix=CHECK6 %s
287-
// CHECK6: source.lang.swift.ref.function.free ()
287+
// CHECK6: source.lang.swift.ref.function.free ({{.*}}/FooSwiftModule.swift:2:13-2:25)
288288
// CHECK6-NEXT: fooSwiftFunc
289289
// CHECK6-NEXT: s:14FooSwiftModule03fooB4FuncSiyF
290290
// CHECK6-NEXT: source.lang.swift
@@ -293,7 +293,7 @@ func checkAnyIsAKeyword(x: Any) {}
293293
// CHECK6-NEXT: FooSwiftModule
294294
// CHECK6-NEXT: <Declaration>func fooSwiftFunc() -&gt; <Type usr="s:Si">Int</Type></Declaration>
295295
// CHECK6-NEXT: <decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooSwiftFunc</decl.name>() -&gt; <decl.function.returntype><ref.struct usr="s:Si">Int</ref.struct></decl.function.returntype></decl.function.free>
296-
// CHECK6-NEXT: {{^}}<Function><Name>fooSwiftFunc()</Name><USR>s:14FooSwiftModule03fooB4FuncSiyF</USR><Declaration>func fooSwiftFunc() -&gt; Int</Declaration><CommentParts><Abstract><Para>This is ‘fooSwiftFunc’ from ‘FooSwiftModule’.</Para></Abstract></CommentParts></Function>{{$}}
296+
// CHECK6-NEXT: {{^}}<Function file="{{.*}}/FooSwiftModule.swift" line="2" column="13"><Name>fooSwiftFunc()</Name><USR>s:14FooSwiftModule03fooB4FuncSiyF</USR><Declaration>func fooSwiftFunc() -&gt; Int</Declaration><CommentParts><Abstract><Para>This is ‘fooSwiftFunc’ from ‘FooSwiftModule’.</Para></Abstract></CommentParts></Function>{{$}}
297297

298298
// RUN: %sourcekitd-test -req=cursor -pos=14:10 %s -- -F %S/../Inputs/libIDE-mock-sdk -I %t.tmp %s | %FileCheck -check-prefix=CHECK7 %s
299299
// CHECK7: source.lang.swift.ref.struct (13:8-13:10)
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
#if MOD_PARTIALA
2+
/// Comment from A
3+
public func someFunc() {}
4+
#endif
5+
6+
#if MOD_PARTIALB
7+
public func funcBeforeLoc() {}
8+
/// Comment from B
9+
public func anotherFuncBeforeLoc() {}
10+
#sourceLocation(file: "doesnotexist.swift", line: 10)
11+
public func funcInLoc() {}
12+
/// Comment from #sourceLocation
13+
public func anotherFuncInLoc() {}
14+
#sourceLocation()
15+
public func funcAfterLoc() {}
16+
/// Comment from B
17+
public func anotherFuncAfterLoc() {}
18+
#endif
19+
20+
#if MOD_USE
21+
import somemod
22+
23+
func test() {
24+
someFunc()
25+
anotherFuncBeforeLoc()
26+
anotherFuncInLoc()
27+
anotherFuncAfterLoc()
28+
}
29+
#endif
30+
31+
// This test depends on line numbers, hence RUN lines being underneath the
32+
// code.
33+
34+
// RUN: %empty-directory(%t)
35+
// RUN: %empty-directory(%t/mods)
36+
37+
// RUN: %target-swift-frontend -emit-module -emit-module-source-info -o %t/mods/somemoda.partial.swiftmodule -D MOD_PARTIALA -module-name somemod %s
38+
// RUN: %target-swift-frontend -emit-module -emit-module-source-info -o %t/mods/somemodb.partial.swiftmodule -D MOD_PARTIALB -module-name somemod %s
39+
40+
// RUN: %target-swift-frontend -emit-module -emit-module-source-info -o %t/mods/somemod.swiftmodule -module-name somemod %t/mods/somemoda.partial.swiftmodule %t/mods/somemodb.partial.swiftmodule
41+
42+
// RUN: %sourcekitd-test -req=cursor -req-opts=retrieve_symbol_graph=1 -pos=24:3 %s -- -D MOD_USE -I %t/mods -target %target-triple %s | %FileCheck --check-prefix=CHECK-NORMAL %s
43+
// CHECK-NORMAL: source.lang.swift.ref.function.free (3:13-3:21)
44+
// CHECK-NORMAL-NEXT: someFunc()
45+
// CHECK-NORMAL-NEXT: s:7somemod8someFuncyyF
46+
// CHECK-NORMAL: "docComment": {
47+
// CHECK-NORMAL-NEXT: "lines": [
48+
// CHECK-NORMAL-NEXT: {
49+
// CHECK-NORMAL-NEXT: "range": {
50+
// CHECK-NORMAL-NEXT: "end": {
51+
// CHECK-NORMAL-NEXT: "character": 18,
52+
// CHECK-NORMAL-NEXT: "line": 1
53+
// CHECK-NORMAL-NEXT: },
54+
// CHECK-NORMAL-NEXT: "start": {
55+
// CHECK-NORMAL-NEXT: "character": 4,
56+
// CHECK-NORMAL-NEXT: "line": 1
57+
// CHECK-NORMAL-NEXT: }
58+
// CHECK-NORMAL-NEXT: },
59+
// CHECK-NORMAL-NEXT: "text": "Comment from A"
60+
// CHECK-NORMAL-NEXT: }
61+
// CHECK-NORMAL-NEXT: ]
62+
// CHECK-NORMAL-NEXT: },
63+
// CHECK-NORMAL: "location": {
64+
// CHECK-NORMAL-NEXT: "position": {
65+
// CHECK-NORMAL-NEXT: "character": 12,
66+
// CHECK-NORMAL-NEXT: "line": 2
67+
// CHECK-NORMAL-NEXT: },
68+
// CHECK-NORMAL-NEXT: "uri": "file://{{.*}}cursor_info_multi_module.swift"
69+
// CHECK-NORMAL-NEXT: }
70+
71+
// RUN: %sourcekitd-test -req=cursor -req-opts=retrieve_symbol_graph=1 -pos=25:3 %s -- -D MOD_USE -I %t/mods -target %target-triple %s | %FileCheck --check-prefix=CHECK-BEFORE %s
72+
// CHECK-BEFORE: source.lang.swift.ref.function.free (9:13-9:33)
73+
// CHECK-BEFORE-NEXT: anotherFuncBeforeLoc()
74+
// CHECK-BEFORE-NEXT: s:7somemod20anotherFuncBeforeLocyyF
75+
// CHECK-BEFORE: "docComment": {
76+
// CHECK-BEFORE-NEXT: "lines": [
77+
// CHECK-BEFORE-NEXT: {
78+
// CHECK-BEFORE-NEXT: "range": {
79+
// CHECK-BEFORE-NEXT: "end": {
80+
// CHECK-BEFORE-NEXT: "character": 18,
81+
// CHECK-BEFORE-NEXT: "line": 7
82+
// CHECK-BEFORE-NEXT: },
83+
// CHECK-BEFORE-NEXT: "start": {
84+
// CHECK-BEFORE-NEXT: "character": 4,
85+
// CHECK-BEFORE-NEXT: "line": 7
86+
// CHECK-BEFORE-NEXT: }
87+
// CHECK-BEFORE-NEXT: },
88+
// CHECK-BEFORE-NEXT: "text": "Comment from B"
89+
// CHECK-BEFORE-NEXT: }
90+
// CHECK-BEFORE-NEXT: ]
91+
// CHECK-BEFORE-NEXT: },
92+
// CHECK-BEFORE: "location": {
93+
// CHECK-BEFORE-NEXT: "position": {
94+
// CHECK-BEFORE-NEXT: "character": 12,
95+
// CHECK-BEFORE-NEXT: "line": 8
96+
// CHECK-BEFORE-NEXT: },
97+
// CHECK-BEFORE-NEXT: "uri": "file://{{.*}}cursor_info_multi_module.swift"
98+
// CHECK-BEFORE-NEXT: }
99+
100+
// Cursor info ignores #sourceLocation, symbol graph does not
101+
// RUN: %sourcekitd-test -req=cursor -req-opts=retrieve_symbol_graph=1 -pos=26:3 %s -- -D MOD_USE -I %t/mods -target %target-triple %s | %FileCheck --check-prefix=CHECK-IN %s
102+
// CHECK-IN: source.lang.swift.ref.function.free (13:13-13:29)
103+
// CHECK-IN-NEXT: anotherFuncInLoc()
104+
// CHECK-IN-NEXT: s:7somemod16anotherFuncInLocyyF
105+
// CHECK-IN: "docComment": {
106+
// CHECK-IN-NEXT: "lines": [
107+
// CHECK-IN-NEXT: {
108+
// CHECK-IN-NEXT: "range": {
109+
// CHECK-IN-NEXT: "end": {
110+
// CHECK-IN-NEXT: "character": 32,
111+
// CHECK-IN-NEXT: "line": 10
112+
// CHECK-IN-NEXT: },
113+
// CHECK-IN-NEXT: "start": {
114+
// CHECK-IN-NEXT: "character": 4,
115+
// CHECK-IN-NEXT: "line": 10
116+
// CHECK-IN-NEXT: }
117+
// CHECK-IN-NEXT: },
118+
// CHECK-IN-NEXT: "text": "Comment from #sourceLocation"
119+
// CHECK-IN-NEXT: }
120+
// CHECK-IN-NEXT: ]
121+
// CHECK-IN-NEXT: },
122+
// CHECK-IN: "location": {
123+
// CHECK-IN-NEXT: "position": {
124+
// CHECK-IN-NEXT: "character": 12,
125+
// CHECK-IN-NEXT: "line": 11
126+
// CHECK-IN-NEXT: },
127+
// CHECK-IN-NEXT: "uri": "file://doesnotexist.swift"
128+
// CHECK-IN-NEXT: }
129+
130+
// RUN: %sourcekitd-test -req=cursor -req-opts=retrieve_symbol_graph=1 -pos=27:3 %s -- -D MOD_USE -I %t/mods -target %target-triple %s | %FileCheck --check-prefix=CHECK-AFTER %s
131+
// CHECK-AFTER: source.lang.swift.ref.function.free (17:13-17:32)
132+
// CHECK-AFTER-NEXT: anotherFuncAfterLoc()
133+
// CHECK-AFTER-NEXT: s:7somemod19anotherFuncAfterLocyyF
134+
// CHECK-AFTER: "docComment": {
135+
// CHECK-AFTER-NEXT: "lines": [
136+
// CHECK-AFTER-NEXT: {
137+
// CHECK-AFTER-NEXT: "range": {
138+
// CHECK-AFTER-NEXT: "end": {
139+
// CHECK-AFTER-NEXT: "character": 18,
140+
// CHECK-AFTER-NEXT: "line": 15
141+
// CHECK-AFTER-NEXT: },
142+
// CHECK-AFTER-NEXT: "start": {
143+
// CHECK-AFTER-NEXT: "character": 4,
144+
// CHECK-AFTER-NEXT: "line": 15
145+
// CHECK-AFTER-NEXT: }
146+
// CHECK-AFTER-NEXT: },
147+
// CHECK-AFTER-NEXT: "text": "Comment from B"
148+
// CHECK-AFTER-NEXT: }
149+
// CHECK-AFTER-NEXT: ]
150+
// CHECK-AFTER-NEXT: },
151+
// CHECK-AFTER: "location": {
152+
// CHECK-AFTER-NEXT: "position": {
153+
// CHECK-AFTER-NEXT: "character": 12,
154+
// CHECK-AFTER-NEXT: "line": 16
155+
// CHECK-AFTER-NEXT: },
156+
// CHECK-AFTER-NEXT: "uri": "file://{{.*}}cursor_info_multi_module.swift"
157+
// CHECK-AFTER-NEXT: }

test/SourceKit/CursorInfo/cursor_symbol_graph_referenced.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extension Parent {
1919

2020
// RUN: %empty-directory(%t)
2121
// RUN: echo 'public struct FromSomeModule {} ' > %t/SomeModule.swift
22-
// RUN: %target-build-swift %t/SomeModule.swift -module-name SomeModule -emit-module -emit-module-path %t/
22+
// RUN: %target-build-swift %t/SomeModule.swift -emit-module -module-name SomeModule -o %t/SomeModule.swiftmodule
2323

2424
// References should cover symbols from the symbol graph declaration fragments, even if not present in the original source.
2525
// RUN: %sourcekitd-test -req=cursor -pos=3:5 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple -I %t | %FileCheck -check-prefixes=GLOBAL %s
@@ -133,7 +133,7 @@ extension Parent {
133133

134134

135135
// References to unsupported types (like generic parameters) should be ignored.
136-
// RUN: %sourcekitd-test -req=cursor -pos=11:14 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple -I %t | %FileCheck -check-prefixes=NESTED %s
136+
// RUN: %sourcekitd-test -req=cursor -pos=11:14 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple -I %t | %FileCheck -check-prefixes=NESTED %s
137137
//
138138
// NESTED: SYMBOL GRAPH BEGIN
139139
// NESTED: "declarationFragments": [
@@ -225,8 +225,7 @@ extension Parent {
225225
// NESTED-NEXT: [[ExtInner_USR]] | internal | {{.*}}cursor_symbol_graph_referenced.swift | cursor_symbol_graph_referenced | User | NonSPI | source.lang.swift
226226
// NESTED-NEXT: Parent swift.struct s:30cursor_symbol_graph_referenced6ParentV
227227
// NESTED-NEXT: ExtInner swift.struct [[ExtInner_USR]]
228-
// FIXME: We should get the file path via the swiftsourceinfo file for user modules (rdar://75582627)
229-
// NESTED-NEXT: [[FromSomeModule_USR]] | public | <empty> | SomeModule | User | NonSPI | source.lang.swift
228+
// NESTED-NEXT: [[FromSomeModule_USR]] | public | {{.*}}/SomeModule.swift | SomeModule | User | NonSPI | source.lang.swift
230229
// NESTED-NEXT: FromSomeModule swift.struct [[FromSomeModule_USR]]
231230
// NESTED-NEXT: REFERENCED DECLS END
232231

test/SourceKit/CursorInfo/use-swift-source-info.swift

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/SourceKit/Misc/stats.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ func foo() {}
22

33
// RUN: %sourcekitd-test -req=syntax-map %s == -req=stats | %FileCheck %s -check-prefix=SYNTAX_1
44

5-
// SYNTAX_1: 3 {{.*}} source.statistic.num-requests
5+
// SYNTAX_1: 2 {{.*}} source.statistic.num-requests
66
// SYNTAX_1: 0 {{.*}} source.statistic.num-semantic-requests
77
// SYNTAX_1: 0 {{.*}} source.statistic.num-ast-builds
88
// SYNTAX_1: 1 {{.*}} source.statistic.num-open-documents
99
// SYNTAX_1: 1 {{.*}} source.statistic.max-open-documents
1010

1111
// RUN: %sourcekitd-test -req=syntax-map %s == -req=close %s == -req=stats | %FileCheck %s -check-prefix=SYNTAX_2
1212

13-
// SYNTAX_2: 4 {{.*}} source.statistic.num-requests
13+
// SYNTAX_2: 3 {{.*}} source.statistic.num-requests
1414
// SYNTAX_2: 0 {{.*}} source.statistic.num-semantic-requests
1515
// SYNTAX_2: 0 {{.*}} source.statistic.num-ast-builds
1616
// SYNTAX_2: 0 {{.*}} source.statistic.num-open-documents
1717
// SYNTAX_2: 1 {{.*}} source.statistic.max-open-documents
1818

1919
// RUN: %sourcekitd-test -req=sema %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=stats | %FileCheck %s -check-prefix=SEMA_1
2020

21-
// SEMA_1: 4 {{.*}} source.statistic.num-requests
21+
// SEMA_1: 3 {{.*}} source.statistic.num-requests
2222
// SEMA_1: 0 {{.*}} source.statistic.num-semantic-requests
2323
// SEMA_1: 1 {{.*}} source.statistic.num-ast-builds
2424
// SEMA_1: 1 {{.*}} source.statistic.num-asts-in-memory
@@ -28,7 +28,7 @@ func foo() {}
2828

2929
// RUN: %sourcekitd-test -req=sema %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=edit -pos=1:1 -replace=" " %s == -req=stats | %FileCheck %s -check-prefix=SEMA_2
3030

31-
// SEMA_2: 6 {{.*}} source.statistic.num-requests
31+
// SEMA_2: 5 {{.*}} source.statistic.num-requests
3232
// SEMA_2: 0 {{.*}} source.statistic.num-semantic-requests
3333
// SEMA_2: 2 {{.*}} source.statistic.num-ast-builds
3434
// NOTE: we cannot match num-asts-in-memory, or num-ast-cache-hits reliably when
@@ -40,7 +40,7 @@ func foo() {}
4040

4141
// RUN: %sourcekitd-test -req=sema %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=cursor -pos=1:6 %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=stats | %FileCheck %s -check-prefix=SEMA_3
4242

43-
// SEMA_3: 5 {{.*}} source.statistic.num-requests
43+
// SEMA_3: 4 {{.*}} source.statistic.num-requests
4444
// SEMA_3: 1 {{.*}} source.statistic.num-semantic-requests
4545
// SEMA_3: 1 {{.*}} source.statistic.num-ast-builds
4646
// SEMA_3: 1 {{.*}} source.statistic.num-asts-in-memory
@@ -50,7 +50,7 @@ func foo() {}
5050

5151
// RUN: %sourcekitd-test -req=sema %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=related-idents -pos=1:6 %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=stats | %FileCheck %s -check-prefix=SEMA_4
5252

53-
// SEMA_4: 5 {{.*}} source.statistic.num-requests
53+
// SEMA_4: 4 {{.*}} source.statistic.num-requests
5454
// SEMA_4: 1 {{.*}} source.statistic.num-semantic-requests
5555
// SEMA_4: 1 {{.*}} source.statistic.num-ast-builds
5656
// SEMA_4: 1 {{.*}} source.statistic.num-asts-in-memory

tools/SourceKit/include/SourceKit/Core/Context.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ namespace SourceKit {
3131
class GlobalConfig {
3232
public:
3333
struct Settings {
34-
/// When true, the default compiler options and other configuration flags
35-
/// will be chosen to optimize for usage from an IDE.
36-
///
37-
/// At the time of writing this just means ignoring .swiftsourceinfo files.
38-
bool OptimizeForIDE = false;
39-
4034
struct CompletionOptions {
4135

4236
/// Max count of reusing ASTContext for cached code completion.
@@ -52,10 +46,8 @@ class GlobalConfig {
5246
mutable llvm::sys::Mutex Mtx;
5347

5448
public:
55-
Settings update(Optional<bool> OptimizeForIDE,
56-
Optional<unsigned> CompletionMaxASTContextReuseCount,
49+
Settings update(Optional<unsigned> CompletionMaxASTContextReuseCount,
5750
Optional<unsigned> CompletionCheckDependencyInterval);
58-
bool shouldOptimizeForIDE() const;
5951
Settings::CompletionOptions getCompletionOpts() const;
6052
};
6153

0 commit comments

Comments
 (0)