5

I've made plenty of changes in my solution, using TFS, and I want to search for something only in the files which I edited (which appear in the "Pending Changes").

There is only an option to search in specific directories of the solution but not in the edited files.

Maybe there is some extension that can help with it?

For example, I want to search for TODO comments but only in the files edited by me, without seeing TODOs of other developers.

SeReGa
  • 1,219
  • 2
  • 11
  • 32

5 Answers5

9

Press ctrl + shift + f In Result options, select Find results Table

enter image description here

Press find all and then, in the find window filter by select Changed Documents. enter image description here

Guy Frieman
  • 156
  • 3
  • Great! that's exactly what I wanted! – SeReGa Jan 16 '19 at 09:00
  • If aynone got advice how to make this work when having multiple external solutions checked out, please let me know. It doesn't detect any 'Changed documents' when I search all files (cause Entire solution doesn't cover it) Using 'All files' and typing in words in the filter works, but it's still not as efficient than the 'Changed documents' feature. – Honnes Aug 13 '19 at 10:43
1

This is not the answer for searching in pending changes in general, but it is possible to get list of TODOS only from changed files by using Task list window.

Open Task list window and use the filter for only Changed documents: Task list windows showcase

Simply007
  • 444
  • 3
  • 14
  • That's nice option, and I can edit the task tokens in `Tools -> Options -> Environment -> Task List`, it will show them in this list... Thanks, but this solution only for search in comments of changed documents. – SeReGa Jan 15 '19 at 18:13
0

It doesnt look like there is a way to do this directly but I am able to do it via a work around that might work for you.

  1. Shelve your pending changes
  2. Delete all local items
  3. Unshelve your changes (this should now bring down only the files you have edited to your local)
  4. Perform your search on the parent folder of all the edited items.
Jansen McEntee
  • 451
  • 5
  • 9
  • Oh, it would work, but it is too much effort... Looking for an easier way. Thanks – SeReGa Dec 28 '18 at 10:53
  • This looks promising but I have not tried it. Doesnt look like its exactly what you are looking for, but I have not seen an extension with quite that capability. Here is the extension: https://marketplace.visualstudio.com/items?itemName=EntrianSolutions-RichieHindle.EntrianSourceSearchAfulltextindexsearchengineforyo#overview. And http://entrian.com/source-search/doc-searching.html is the manual page which talks about search filtering – Jansen McEntee Dec 28 '18 at 16:49
  • I've tried these options, but it's not what i'm looking for. – SeReGa Jan 09 '19 at 12:35
0

It's super hacky but you could write a quick console/win forms application to:

  1. Scan your project directory for files with a last modified date greater than your last check in
  2. Copy them to a separate temp folder
  3. Use the visual studio's find in files feature to search that temp directory.
Hunter Nelson
  • 1,707
  • 3
  • 20
  • 37
0

Not the exact answer for this question but go to View/Task List to search for the TODO Apply the technics explained in the other answers. To get a list of tokens, go to Tools/Options/Environment/TaskList

Antonio Leite
  • 460
  • 3
  • 7