dotnet/roslyn

Convenience API to provide operation blocks/roots for a given symbol

Aperta

#28.097 aperta il 25 giu 2018

 (0 commenti) (2 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-AnalyzersArea-CompilersFeature - IOperationFeature Requesthelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

Currently, an analyzer can register an operation block action and get hold of all operation blocks for each symbol that has an associated executable code block. This issue tracks exposing a convenience API for non-analyzer clients to get operations blocks for a given symbol.

See second bullet point in Essentials section in the comment from @bkoelman here: https://github.com/dotnet/roslyn/issues/27208#issuecomment-396575101

An API to get operation block(s) from an IMethodSymbol. My current solution via syntax is tedious and probably incomplete. A reliable API that works on symbols for methods, fields and other places that may contain a code block (and which works for both blocks and expression bodies) would be very welcome.

Guida contributor