[SourceKit] Re-enable cancellation of non-completion requests

This enables the ability to cancel requests, which aren’t code completion requests, again.

Previous crashes in SILGen are prevented by disabling cancellation during the SIL stages. Instead, we add dedicated cancellation checkpoints before and after SIL.

rdar://98390926
This commit is contained in:
Alex Hoppen
2022-08-16 16:02:23 +02:00
parent 50c79f9b3c
commit e22e443596
4 changed files with 24 additions and 4 deletions

View File

@@ -1621,6 +1621,10 @@ static void computeDiagnostics(
auto Diagnostics = DiagConsumer.getDiagnosticsForBuffer(BufferID);
Receiver(RequestResult<DiagnosticsResult>::fromResult(Diagnostics));
}
void cancelled() override {
Receiver(RequestResult<DiagnosticsResult>::cancelled());
}
};
auto Consumer = std::make_shared<DiagnosticsConsumer>(std::move(Receiver));