Visual Studio - How to search in pending changes files?
Asked Answered
A

5

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.

Appreciative answered 22/12, 2018 at 19:41 Comment(0)
V
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

Vermiculite answered 16/1, 2019 at 8:53 Comment(2)
Great! that's exactly what I wanted!Appreciative
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.Moonscape
F
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

Frankish answered 15/1, 2019 at 16:27 Comment(1)
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.Appreciative
A
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.
Aboutship answered 16/1, 2019 at 7:9 Comment(1)
Too much effort, I'm sure there is more elegant way to do it.Appreciative
B
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

Bosky answered 16/9, 2020 at 19:33 Comment(1)
Apply the technics explained in the other answers?! What technics?Appreciative
S
-1

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.
Sokil answered 27/12, 2018 at 14:49 Comment(3)
Oh, it would work, but it is too much effort... Looking for an easier way. ThanksAppreciative
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: marketplace.visualstudio.com/…. And entrian.com/source-search/doc-searching.html is the manual page which talks about search filteringSokil
I've tried these options, but it's not what i'm looking for.Appreciative

© 2022 - 2024 — McMap. All rights reserved.