3

I have made changes to my repository and I can see the changes of the files under Source control in this tab on the left of VS Code. This shows all my uncommitted changes in git.

Repository changes

I have a compilation fail because of these uncommitted changes but the error is cryptic and misleading. I would like to narrow down the list of files to search to only my uncommitted changes.

I would like to search for text only in these uncommitted changes and not the rest of the repo that I can achieve using Command/Ctrl + Shift + F (as I get more hits than I need).

Is there a way to limit the search only in the changes since the last commit?

I am running on Windows but other systems could help.

Destroy666
  • 12,350

1 Answers1

5

It's not possible by default. There's been a highly upvoted issue hanging around for years now. I don't see any helpful extensions either.

What you can do as a rather bad workaround:

  • close all opened files
  • go to Source Control in sidebar panel (or Ctrl + Shift + G)
  • Right mouse click on Changes label and Open changed files:

Changed files menu

  • search in opened files (Ctrl + Shift + F -> ... icon -> Search only in open editors book icon):

Search menu

Destroy666
  • 12,350