Visual studio code ctrl+f until end of a function?

Viewed 111

I recently started using VSC. I use the ctrl+f feature a lot to search for code within a file (please let me know if there's a better feature to do this in VSC), and often times, I only want to search within a particular function in that file, where the function could be a long one (~ 1000 lines). Is there a way to set the ctrl+f stopping criteria to end at the end of the function in that particular file?

1 Answers

You can use the "Find in Selection" feature in VS Code's search bar.

  1. Select the entire function you wish to perform search (This post shows how to select a block of code via shortcuts)
  2. Toggle the "Find in Selection" button

Demo:

enter image description here

Related