title: Visual Studio Extensibility / Margins
body: <p>I am trying to build a Margin (through MEF) as a VS addin. I need to get the lines that contain the definition of a method. I have found people doing such things but it seems most are parsing test. This seems like a really bad idea as it would obviously only work with languages you knew how to parse. </p>
  
  <p>In an addin I can access the document in a programmatic fashion using a higher level model:</p>
  
  <pre><code>var fcm = _application.ActiveDocument.ProjectItem.FileCodeModel;
  var elem = fcm.CodeElementFromPoint(point, vsCMElement.vsCMElementFunction);
  </code></pre>
  
  <p>As an example.</p>
  
  <p>Is there anyway to do this from within the MEF stuff when trying to draw the margin?</p>