title: Roslyn Analyzer to mark return type of property
body: <p>I'm writing an analyzer for Roslyn that needs to mark the return type of a property.  I have it marking the property declaration itself.  I've looked through the debugger but I can't find a location that targets the return type token.</p>
  
  <p>Example:</p>
  
  <pre><code>// important code for analzyer
  
  public override void Initialize(AnalysisContext context)
  {
      context.RegisterSyntaxNodeAction(AnalyzeSyntax, SyntaxKind.MethodDeclaration, SyntaxKind.PropertyDeclaration);
  }
  
  private static void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
  {
      var propertySymbol = context.ContainingSymbol as IPropertySymbol;
      var propertyType = propertySymbol.Type;
      if (propertyType.Name != "Class1") return;
  
      var diagnostic = Diagnostic.Create(Rule, propertySymbol.Locations[0], propertyType.Name);
      context.ReportDiagnostic(diagnostic);
      break;
  }
  
  // example where it should be working
  
  public class Usage
  {
      public Class1 Test { get; set; }
  }
  </code></pre>
  
  <p>It currently puts green squigglies under the <code>Usage.Test</code> property name, but I want it under the return type for that property.</p>
  
  <p>The <code>context.ContainingSymbol</code> has a <code>Locations</code> property, but it only has one location specified in it, and it points exclusively to <code>Test</code>.  The <code>context.Node</code> specifies a few other spans that cover the entire property, but it's not a full <code>Location</code> object, so I can't use them.</p>
  
  <p><strong>Edit 1</strong></p>
  
  <p>Apparently, it's important that I'm doing this in .Net Standard with VS 2017.  The .Net 4.5 analyzers can access usages via the <code>MSBuildWorkspace</code> and <code>SymbolFinder</code> classes, but .Net Standard doesn't have <code>MSBuildWorkspace</code> for some reason so I can't get the current solution to pass to <code>SymbolFinder.FindReferencesAsync()</code>.</p>