Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task WorkAndSetTcs(Func<CancellationToken, Task<IReadOnlyList<Hiera

public Task<IReadOnlyList<HierarchicalSymbol>> GetSymbolsAsync(CancellationToken ct = default) {
lock (_syncObj) {
return _fileTcs.Task;
return _fileTcs.Task.WaitAsync(ct);
}
}

Expand Down Expand Up @@ -111,6 +111,7 @@ public void Dispose() {
}
_state = WorkQueueState.FinishedWork;
}
_fileCts?.Dispose();
}

private async Task<IReadOnlyList<HierarchicalSymbol>> IndexAsync(IDocument doc, CancellationToken indexCt) {
Expand Down Expand Up @@ -150,6 +151,7 @@ private async Task<IReadOnlyList<HierarchicalSymbol>> ParseAsync(CancellationTok

private void RenewTcs() {
Check.InvalidOperation(Monitor.IsEntered(_syncObj));
_fileCts?.Dispose();
_fileCts = new CancellationTokenSource();
_fileTcs = new TaskCompletionSource<IReadOnlyList<HierarchicalSymbol>>();
}
Expand Down