@@ -541,7 +541,7 @@ void swift::ide::CompletionInstance::performOperation(
541
541
swift::CompilerInvocation &Invocation, llvm::ArrayRef<const char *> Args,
542
542
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
543
543
llvm::MemoryBuffer *completionBuffer, unsigned int Offset,
544
- DiagnosticConsumer *DiagC,
544
+ DiagnosticConsumer *DiagC, bool IgnoreSwiftSourceInfo,
545
545
std::shared_ptr<std::atomic<bool >> CancellationFlag,
546
546
llvm::function_ref<void (CancellableResult<CompletionInstanceResult>)>
547
547
Callback) {
@@ -563,9 +563,7 @@ void swift::ide::CompletionInstance::performOperation(
563
563
return ;
564
564
}
565
565
566
- // Always disable source location resolutions from .swiftsourceinfo file
567
- // because they're somewhat heavy operations and aren't needed for completion.
568
- Invocation.getFrontendOptions ().IgnoreSwiftSourceInfo = true ;
566
+ Invocation.getFrontendOptions ().IgnoreSwiftSourceInfo = IgnoreSwiftSourceInfo;
569
567
570
568
// We don't need token list.
571
569
Invocation.getLangOptions ().CollectParsedToken = false ;
@@ -617,9 +615,11 @@ void swift::ide::CompletionInstance::codeComplete(
617
615
}
618
616
};
619
617
618
+ // Disable source location resolutions from .swiftsourceinfo file because
619
+ // they're somewhat heavy operations and aren't needed for completion.
620
620
performOperation (
621
621
Invocation, Args, FileSystem, completionBuffer, Offset, DiagC,
622
- CancellationFlag,
622
+ /* IgnoreSwiftSourceInfo= */ true , CancellationFlag,
623
623
[&](CancellableResult<CompletionInstanceResult> CIResult) {
624
624
CIResult.mapAsync <CodeCompleteResult>(
625
625
[&CompletionContext, &CancellationFlag](auto &Result,
@@ -696,7 +696,7 @@ void swift::ide::CompletionInstance::typeContextInfo(
696
696
697
697
performOperation (
698
698
Invocation, Args, FileSystem, completionBuffer, Offset, DiagC,
699
- CancellationFlag,
699
+ /* IgnoreSwiftSourceInfo= */ true , CancellationFlag,
700
700
[&](CancellableResult<CompletionInstanceResult> CIResult) {
701
701
CIResult.mapAsync <TypeContextInfoResult>(
702
702
[&CancellationFlag](auto &Result, auto DeliverTransformed) {
@@ -764,7 +764,7 @@ void swift::ide::CompletionInstance::conformingMethodList(
764
764
765
765
performOperation (
766
766
Invocation, Args, FileSystem, completionBuffer, Offset, DiagC,
767
- CancellationFlag,
767
+ /* IgnoreSwiftSourceInfo= */ true , CancellationFlag,
768
768
[&](CancellableResult<CompletionInstanceResult> CIResult) {
769
769
CIResult.mapAsync <ConformingMethodListResults>(
770
770
[&ExpectedTypeNames, &CancellationFlag](auto &Result,
@@ -830,7 +830,7 @@ void swift::ide::CompletionInstance::cursorInfo(
830
830
831
831
performOperation (
832
832
Invocation, Args, FileSystem, completionBuffer, Offset, DiagC,
833
- CancellationFlag,
833
+ /* IgnoreSwiftSourceInfo= */ false , CancellationFlag,
834
834
[&](CancellableResult<CompletionInstanceResult> CIResult) {
835
835
CIResult.mapAsync <CursorInfoResults>(
836
836
[&CancellationFlag, Offset](auto &Result, auto DeliverTransformed) {
0 commit comments