mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Allow passing cancel_on_subsequent_request: 0 for all requests that use a OncePerASTToken
We need this option for `collectVariableType` (aka inlay type hints) but since I’m at it, I’m adding an option to disable the implicit request cancellation for all requests that have it since we don’t want it in LSP at all. Prerequisite to fixing https://github.com/swiftlang/sourcekit-lsp/issues/2021 / rdar://145871554, need to adopt this option in SourceKit-LSP.
This commit is contained in:
@@ -1418,7 +1418,8 @@ SwiftLangSupport::findRenameRanges(llvm::MemoryBuffer *InputBuf,
|
||||
|
||||
void SwiftLangSupport::findLocalRenameRanges(
|
||||
StringRef Filename, unsigned Line, unsigned Column, unsigned Length,
|
||||
ArrayRef<const char *> Args, SourceKitCancellationToken CancellationToken,
|
||||
ArrayRef<const char *> Args, bool CancelOnSubsequentRequest,
|
||||
SourceKitCancellationToken CancellationToken,
|
||||
CategorizedRenameRangesReceiver Receiver) {
|
||||
using ResultType = CancellableResult<std::vector<CategorizedRenameRanges>>;
|
||||
std::string Error;
|
||||
@@ -1465,8 +1466,8 @@ void SwiftLangSupport::findLocalRenameRanges(
|
||||
/// FIXME: When request cancellation is implemented and Xcode adopts it,
|
||||
/// don't use 'OncePerASTToken'.
|
||||
static const char OncePerASTToken = 0;
|
||||
getASTManager()->processASTAsync(Invok, ASTConsumer, &OncePerASTToken,
|
||||
CancellationToken,
|
||||
const void *Once = CancelOnSubsequentRequest ? &OncePerASTToken : nullptr;
|
||||
getASTManager()->processASTAsync(Invok, ASTConsumer, Once, CancellationToken,
|
||||
llvm::vfs::getRealFileSystem());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user