mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] When AST-based cursor info is cancelled, don’t run solver-based cursor info
Running solver-based cursor info in the callback that is informed about cancellation extends the window for a deadlock.
This commit is contained in:
@@ -2041,8 +2041,14 @@ void SwiftLangSupport::getCursorInfo(
|
||||
fileSystem, Receiver, Offset, Actionables,
|
||||
SymbolGraph](
|
||||
const RequestResult<CursorInfoData> &Res) {
|
||||
if (Res.isCancelled()) {
|
||||
// If the AST-based result got cancelled, we don’t want to start
|
||||
// solver-based cursor info anymore.
|
||||
Receiver(Res);
|
||||
return;
|
||||
}
|
||||
// AST based completion *always* produces a result
|
||||
bool NoResults = Res.isError() || Res.isCancelled();
|
||||
bool NoResults = Res.isError();
|
||||
if (Res.isValue()) {
|
||||
NoResults = Res.value().Symbols.empty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user