0

I am new to Visual Studio addin development and want to create a small prototype of an addin for a course at the university. I already looked at a couple of tutorials and the VS SDK. Before I dig further into this topic, I want to ask if it is possible to develop what I want:

My goal (for the prototype is) to receive all annotations in the sources commentary annotations (i.e. TODO, HACK, FIXME, etc.) in my plugin and then to run some analytics.

So, is it (theoretically and using the existing API) possible to get a list of those commentary annotations? If yes, any link to a tutorial, blogpost or code sample would be very much appreciated!

Thank you!

casaout
  • 1,819
  • 3
  • 24
  • 54

1 Answers1

1

You can use the SVsTaskList service to access standard VS annotations. See also the following EnumTaskItems sample.

Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
  • Hi Sergey. Thank you very much for your post. This looks very promising. Unfortunately, I am unable to find out how to get a ServiceProvider (needed as the _serviceProvider variable in the example)... How can I do this? Thank you!! – casaout Oct 11 '13 at 15:22
  • 1
    In add-in you can get it from a DTE object: System.IServiceProvider _serviceProvider = new Microsoft.VisualStudio.Shell.ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)dte); – Sergey Vlasov Oct 12 '13 at 04:41
  • Awesome, thank you so much! I basically had the same code, but didn't find the dte object (i.e. I oversaw that it was already present in the addin)... Have a great weekend! – casaout Oct 12 '13 at 09:20