[SourceKit] Explicitly specify frontend action type when creating compiler invocation

Explicitly specify the frontend action to make sure we aren’t loading thes stdlib if the performed action is syntactic only.
This commit is contained in:
Alex Hoppen
2021-11-17 11:40:30 +01:00
parent 63c31033fc
commit 22f67e89a6
10 changed files with 93 additions and 70 deletions

View File

@@ -1043,8 +1043,8 @@ void SwiftLangSupport::performWithParamsToCompletionLikeOperation(
CompilerInvocation Invocation;
std::string CompilerInvocationError;
bool CreatingInvocationFailed = getASTManager()->initCompilerInvocation(
Invocation, Args, Diags, newBuffer->getBufferIdentifier(), FileSystem,
CompilerInvocationError);
Invocation, Args, FrontendOptions::ActionType::Typecheck, Diags,
newBuffer->getBufferIdentifier(), FileSystem, CompilerInvocationError);
if (CreatingInvocationFailed) {
PerformOperation(CancellableResult<CompletionLikeOperationParams>::failure(
CompilerInvocationError));