mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit] Only verify the solver-based cursor info implementation if requested
This allows us to mark expected deviations between the AST-based and the solver-based implementation in the stress tester as XFails without breaking actual clients We always verify if a cursor info request is issued through `sourcekitd-test`.
This commit is contained in:
@@ -1891,6 +1891,7 @@ void SwiftLangSupport::getCursorInfo(
|
||||
bool SymbolGraph, bool CancelOnSubsequentRequest,
|
||||
ArrayRef<const char *> Args, Optional<VFSOptions> vfsOptions,
|
||||
SourceKitCancellationToken CancellationToken,
|
||||
bool VerifySolverBasedCursorInfo,
|
||||
std::function<void(const RequestResult<CursorInfoData> &)> Receiver) {
|
||||
|
||||
std::string error;
|
||||
@@ -1967,11 +1968,6 @@ void SwiftLangSupport::getCursorInfo(
|
||||
// Currently, we only verify that the solver-based cursor implementation
|
||||
// produces the same results as the AST-based implementation. Only enable it
|
||||
// in assert builds for now.
|
||||
#ifndef NDEBUG
|
||||
bool EnableSolverBasedCursorInfo = true;
|
||||
#else
|
||||
bool EnableSolverBasedCursorInfo = false;
|
||||
#endif
|
||||
|
||||
// If solver based completion is enabled, a string description of the cursor
|
||||
// info result produced by the solver-based implementation. Once the AST-based
|
||||
@@ -1979,7 +1975,7 @@ void SwiftLangSupport::getCursorInfo(
|
||||
// AST-based result.
|
||||
std::string SolverBasedResultDescription;
|
||||
size_t SolverBasedResultCount = 0;
|
||||
if (EnableSolverBasedCursorInfo) {
|
||||
if (VerifySolverBasedCursorInfo) {
|
||||
std::string InputFileError;
|
||||
llvm::SmallString<64> RealInputFilePath;
|
||||
fileSystem->getRealPath(InputFile, RealInputFilePath);
|
||||
|
||||
Reference in New Issue
Block a user