Skip to content

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Jul 8, 2021

We added RunImmediate in #11788 and it gives much, much better debug stacks.

However we hadn't realised that in FSharp.Editor this was sometimes being called on the UI thread - notably for GoToDefinition for external sources. This results in a UI hang for this case. Running an async synchronously on the UI thread is not what we want. So we protect against that.

For this case we rename RunImmediate to RunImmediateExceptOnUI.

(RunImmediateExceptOnUI is now effectively the old F# 4.0 spec for RunSynchronously . This got changed in #11142 to check for isThreadPoolThread, which made our stacks originating from Roslyn background threads worse.)

@dsyme dsyme merged commit 3bc3870 into dotnet:main Jul 8, 2021
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
…et#11805)

* RunImmediate uses RunSynchronously on UI thread

Co-authored-by: Don Syme <donsyme@fastmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants