mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CodeCompletion] Replace main module instead of file
Rather than replacing the code completion file on the `CompilerInstance` whenever we do a cached top-level completion, let's set a new main module instead. This allows us to properly update the `LoadedModules` map, and allows the retrieval of the code completion file to be turned into a request.
This commit is contained in:
@@ -142,8 +142,8 @@ static bool swiftCodeCompleteImpl(
|
||||
SwiftConsumer.setContext(&CI.getASTContext(), &CI.getInvocation(),
|
||||
&CompletionContext);
|
||||
|
||||
auto SF = CI.getCodeCompletionFile();
|
||||
performCodeCompletionSecondPass(*SF.get(), *callbacksFactory);
|
||||
auto *SF = CI.getCodeCompletionFile();
|
||||
performCodeCompletionSecondPass(*SF, *callbacksFactory);
|
||||
SwiftConsumer.clearContext();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user