Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I save the contents of the "CodeLens References" window to a file in Visual Studio 2015?

The is a pretty neat window showing you what references your class, the "CodeLens References" Window. You get it by clicking in the references link that appears above your class name and selecting "Dock Popup" icon. It looks like:

The CodeLens Popup

Now how do I save the contents of that window to a text file? There is no menu, tried a Window-text-grabber app, no luck. Hopefully there is a VS plugin that can help but none found yet.

V.

like image 263
VinceJS Avatar asked Mar 10 '16 09:03

VinceJS


1 Answers

The only easiest way I know is using OneNote (I am using OneNote 2013) - You have a shortcut for screen clipping (Windows + N, S).

  1. Take a snapshot - send/copy it to OneNote.
  2. Right-click on the image and click "Copy Text from Picture"
  3. Paste the copied text into OneNote or in a notepad (you don't really need notepad, if you have OneNote ;-))

The bonus is, you may not need to save it to a text file. OneNote can search through text within images and index it for your search within OneNote.

It's a pity the text can't be copied directly.

Two caveats though:

  • You may have to drag open the docked window, so most or all of the text can be snapped. It is much more painful especially with CodeLens Test Status.
  • Because this method is using an OCR scanner of an image (within OneNote), you may not have everything perfectly in text. I had better results with lighter backgrounds (VS Environment Theme - Light).
like image 65
B Charles H Avatar answered Nov 14 '22 22:11

B Charles H