Reputation: 2503
How can I pragmatically automate Find in Files feature from outside/inside VS? For example I want to
Programmaticaly run a find in files
Save the results into a file Programtically after doing some processing on the results.
I be happy with just number 2 only.
Is this the correct way to do it? or Should I be hooking into another extension point that provides the search functionality for VS instead of hooking into VS's own Find and search results itself?
I have been able to find many examples about text editor extensiblity , displaying icons images in the text, but nothing for hooking into serach and results extension points.
Upvotes: 0
Views: 171
Reputation: 27890
You can use the DTE.Find object to specify search options and run a query with DTE.Find.Execute(). Then use DTE.ActiveDocument selection to get search result. See "6. Prompt for a search string and list all matching lines from the current file" sample from Visual Commander commands.
Upvotes: 1