Skip to content

[SourceKit] Fix a build failure if SWIFT_BUILD_SWIFT_SYNTAX is not set #70300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2523,8 +2523,11 @@ void SwiftLangSupport::findRelatedIdentifiersInFile(

// FIXME: Don't silently eat errors here.
void handlePrimaryAST(ASTUnitRef AstUnit) override {
using ResultType = RequestResult<ArrayRef<RelatedIdentInfo>>;
#if !SWIFT_BUILD_SWIFT_SYNTAX
Receiver(RequestResult<RelatedIdentsInfo>::fromError("relatedidents is not supported because sourcekitd was built without swift-syntax"));
Receiver(
ResultType::fromError("relatedidents is not supported because "
"sourcekitd was built without swift-syntax"));
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really needed, FWIW (missed it originally)

#else
auto &CompInst = AstUnit->getCompilerInstance();
Expand Down Expand Up @@ -2597,7 +2600,7 @@ void SwiftLangSupport::findRelatedIdentifiersInFile(
}
};
Action();
Receiver(RequestResult<ArrayRef<RelatedIdentInfo>>::fromResult(Ranges));
Receiver(ResultType::fromResult(Ranges));
#endif
}

Expand Down