Therzok / MonoDevelop.Analyzers

Set of analyzers that can be used when working on MonoDevelop (and its dependencies)
MIT License
2 stars 2 forks source link

Main thread access requirements #21

Open garuma opened 5 years ago

garuma commented 5 years ago

MS.VS.Threading has a an analyzer that know about certain VS APIs and the requirement that they need to be run on the main thread to work properly. They then check that any code calling them is properly flagged with ThrowIfNotOnUIThread and such.

Therzok commented 5 years ago

This would mean adding additional files to the compilation which contain the semantics: https://github.com/Microsoft/vs-threading/blob/34c6eae89e0514ca6c6e72d411629cdb4cd88d2e/src/Microsoft.VisualStudio.Threading.Analyzers/VSTHRD109AvoidAssertInAsyncMethodsAnalyzer.cs#L51 https://github.com/Microsoft/vs-threading/blob/34c6eae89e0514ca6c6e72d411629cdb4cd88d2e/src/Microsoft.VisualStudio.Threading.Analyzers/CommonInterest.cs#L168