-
Notifications
You must be signed in to change notification settings - Fork 1k
GetSemanticModelAsync should not be called from UI Thread #3770
Comments
It's not called from ui thread - it's called async with await. I'm not sure if the hangs monitor is the issue here. |
It's executed on the same thread when the semantic model is up2date and cached. |
We call it always on UI thread like that - if that it would be a problem we would block all the time. So I doubt it's an issue. |
ATM I don't see a way to fix that - and no issue here. If you think you can improve that - try it out. |
…ighting fixes Issue #3770 This improves typing performance a lot in some cases when `GetSemanticModelAsync` takes long time(sometimes it can take multiple seconds)... This uses advanced `AbstractAsynchronousTaggerProvider` from Roslyn that takes care of snapshot `TranslateTo` so if new classification is not ready yet, it translates old spans to requested snapshot and notifies editor when semantic classification is updated for specific span so it re-renders line containing updated classification. There are two hacks in this commit: - Translations from `ClassificationTypes` to `ScopeStack` are hardcoded and so is order(same as in existing Roslyn classifier) - On `classifier.ClassificationChanged` event is ignored if span is whole file, reason for this is that it seems to me like SyntaxHighligher is doing this(probably can't figure out exact spans), Kirill debugged this on VS2017 and saw same behaviour, I suspect VS2017 doesn't re-render if classifications are same as in previous pass, hence it doesn't hurt them as much as it does MonoDevelop
…ighting fixes Issue #3770 This improves typing performance a lot in some cases when `GetSemanticModelAsync` takes long time(sometimes it can take multiple seconds)... This uses advanced `AbstractAsynchronousTaggerProvider` from Roslyn that takes care of snapshot `TranslateTo` so if new classification is not ready yet, it translates old spans to requested snapshot and notifies editor when semantic classification is updated for specific span so it re-renders line containing updated classification. There are two hacks in this commit: - Translations from `ClassificationTypes` to `ScopeStack` are hardcoded and so is order(same as in existing Roslyn classifier) - On `classifier.ClassificationChanged` event is ignored if span is whole file, reason for this is that it seems to me like SyntaxHighligher is doing this(probably can't figure out exact spans), Kirill debugged this on VS2017 and saw same behaviour, I suspect VS2017 doesn't re-render if classifications are same as in previous pass, hence it doesn't hurt them as much as it does MonoDevelop
This was fixed with #4740 |
https://github.com/mono/monodevelop/blob/ddb4355/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RoslynClassificationHighlighting.cs#L137
Found this issue via UIThread hangs monitor...
The text was updated successfully, but these errors were encountered: