Find and replace in files
The search in files is done by the server, where the files are: even on a large project the window stays responsive, and the results arrive while the search goes on.
Finding
- Choose the workspace in the tree, or a folder inside it.
- Press Ctrl+Shift+F (or Edit → Find in files).
- Type the text to find and, if needed:
- Match case: tells capitals from lower case;
- Whole word: finds “Log” but not “Logger”;
- Regular expression: for example
Log\.(Info|Error); - Folder: to search only part of the workspace, like
src/; - File types: for example
*.cs;*.md.
The list fills up as results come. Double click or Enter on a result opens the file at the right line. A new search stops the previous one.
Every file of the workspace is searched except the build and git folders (bin, obj, .git) and
binary files. A file someone has open is searched in the text being written, even if it is not saved yet.
Replacing
Type the new text and press “Replace in N files”: the replacement is done in the files of the results. The Output says how many replacements were made.
Whoever has one of those files open sees the replacement arrive as a normal change, made by you, and can
undo it like the others. With a regular expression, $1, $2... in the new text are the parts in
brackets; without a regular expression $ stays a $.
Replacing changes the files: it needs the developer role. Anyone can search.