VS Addin how review the source code
I am currently trying to create a Visual Studio Addin, that I want to go through all the classes in a project and look at the code.
The things I'm trying to do is identify whether Option explicit/strict is turned on, whether there is XML commenting on the subs/functions etc.
I've managed to get my Addin to load and I'm able to identify all the classes within the project but I don't seem to be able to figure out how to get the addin to look at the code or things like that.
I was wondering if anyone has done anything like this before and has an idea about how I may be able to achieve this?
Thanks for any help in advance
Satal :D
Re: VS Addin how review the source code
I hate to bump, but I still would like to know if there is any way of achieving this or will I have to manually go through the files?
If providing more information would be useful then please let me know and I'll do what I can.
Satal
Re: VS Addin how review the source code
I have written an add-in so I can be of some help to you.
Code:
Public VB As DTE2
Dim PI As ProjectItem
Dim EP As EditPoint
Dim TD As TextDocument
Dim obj As Object
Dim Win As EnvDTE.Window
PI = VB.Solution.FindProjectItem("Form1.vb")
Win = PI.Open(vsViewKindTextView)
Win.Visible = True
PI.Document.Activate()
obj = VB.ActiveDocument.Object("TextDocument")
TD = CType(obj, TextDocument)
EP = TD.CreateEditPoint
With EP
.FindPattern("<summary>")
.LineDown(2)
.Insert("'Comment goes here")
End With
I took some code and tried to cobble something together. I haven't tested it, but was trying to give you an idea of where to start. I will help anyway I can, but there is not much out there on this subject.
Re: VS Addin how review the source code
Awesome thank you :D
Yeah there isn't much on the subject out there and unfortunately the people who know this stuff in depth are the ones making money from it so are unlikely to share their knowledge :(