title: Can Roslyn generate source code from an object instance?
body: <p>Using the Roslyn API with Visual Studio 2015, can I convert an object instance to source code? Can I create an extension method like ".ToSourceCode()" as shown below?</p>
  
  <pre class="lang-cs prettyprint-override"><code>class Foo { }
  class Program
  {
      static string classSourceCode = "class Foo { }";
      static void Main()
      {
          var instance = new Foo();
          var instanceSourceCode = instance.GetType().ToSourceCode();
          System.Diagnostics.Debug.Assert(instanceSourceCode == classSourceCode);
      }
  }
  </code></pre>