Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes a race condition with ProgressListener.End #1183

Merged
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
2 changes: 1 addition & 1 deletion src/FsAutoComplete/LspServers/FSharpLspClient.fs
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ type ServerProgressReport(lspClient: FSharpLspClient, ?token: ProgressToken) =
cancellableTask {
use! __ = fun ct -> locker.LockAsync(ct)
let stillNeedsToSend = canReportProgress && not endSent
endSent <- true

if stillNeedsToSend then
do! lspClient.Progress(x.Token, WorkDoneProgressEnd.Create(?message = message))
endSent <- true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lspClient.Progress could get cancelled before actually sending and endSent would be set to true

}

interface IAsyncDisposable with
Expand Down