This project is read-only.
3
Vote

Expose IsPartial property on IMethodSymbol

description

It's sort of tricky to figure out when I'm dealing with partial methods as there is no public IsPartial property on IMethodSymbol.

The underlying SourceMemberMethodSymbol defines an IsPartial internally:

http://source.roslyn.codeplex.com/#Microsoft.CodeAnalysis.CSharp/Symbols/Source/SourceMethodSymbol.cs,446

It would be great if this would be exposed publicly.

comments

JoshVarty wrote Sep 4, 2014 at 1:30 AM

I realize I can use :

IMethodSymbol methodSymbol...
if (methodSymbol.PartialImplementationPart != null || method.PartialDefinitionPart != null)
{
//This is a partial method
}

But this makes a lot more sense. Especially to anyone unfamiliar with the logic of when PartialDefinitionPart and PartialImplementationPart are null.
if (methodSymbol.IsPartial)
{
//This is a partial method
}