Skip to content

Commit 20efeb9

Browse files
authored
Merge pull request #13738 from olegtk/main
improve find in files command documentation
2 parents 183a017 + ffa9976 commit 20efeb9

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

docs/ide/reference/find-in-files-command.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ Edit.FindinFiles findwhat [/append] [/case] [/ext:extensions]
3535
Required. The text to match.
3636

3737
## Switches
38-
/append (new in Visual Studio 2022)\
39-
Optional. Directs the results from the current search to be appended to previous search results.
38+
/append: `resultwindowname` (new in Visual Studio 2022)\
39+
Optional. Directs the results from the current search to be appended to previous search results, identified by `resultwindowname` argument. Find Result windows are named by the first search term that resulted in creation of the window.
40+
41+
#### Example
42+
```cmd
43+
>Edit.FindinFiles "AdornmentTagComparer" /lookin:"Entire Solution"
44+
>Edit.FindinFiles "TagComparer" /lookin:"Entire Solution" /append:"AdornmentTagComparer"
45+
```
4046

4147
/case or /c\
4248
Optional. Matches occur only if the uppercase and lowercase characters exactly match those specified in the `findwhat` argument.
@@ -54,7 +60,7 @@ Optional. Displays a list of file names that contain matches.
5460
Optional. Displays a list of the current find option settings and does not perform a search.
5561

5662
/regex or /r\
57-
Optional. Uses pre-defined special characters in the `findwhat` argument as notations that represent patterns of text rather than the literal characters. For a complete list of regular expression characters, see [Regular Expressions](../../ide/using-regular-expressions-in-visual-studio.md).
63+
Optional. Uses predefined special characters in the `findwhat` argument as notations that represent patterns of text rather than the literal characters. For a complete list of regular expression characters, see [Regular Expressions](../../ide/using-regular-expressions-in-visual-studio.md).
5864

5965
/reset or /e\
6066
Optional. Returns the find options to their default settings and does not perform a search.
@@ -73,7 +79,7 @@ Optional. Searches the subfolders within the directory specified in the /lookin:
7379
Optional. Displays the results of the search in the Find Results 2 window.
7480

7581
/wild or /l\ (not supported in Visual Studio 2022)
76-
Optional. Uses pre-defined special characters in the `findwhat` argument as notations to represent a character or sequence of characters.
82+
Optional. Uses predefined special characters in the `findwhat` argument as notations to represent a character or sequence of characters.
7783

7884
/word or /w\
7985
Optional. Searches only for whole words.

docs/ide/reference/replace-in-files-command.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ Required. The text to substitute for the matched text.
4040

4141
Optional. Replaces all occurrences of the search text with the replacement text.
4242

43-
/append (new in Visual Studio 2022)
43+
/append: `resultwindowname` (new in Visual Studio 2022)
4444

45-
Optional. Directs the results from the current search to be appended to previous search results.
45+
Optional. Directs the results from the current search to be appended to previous replace results, identified by `resultwindowname` argument. Replace Result windows are named following the following pattern: Replace "findWhat" with "replaceWith".
46+
47+
#### Example (note that Command Window uses ^ character to escape quotes)
48+
```cmd
49+
>Edit.ReplaceInFiles "Console.WriteLine(" "//Console.WriteLine(" /lookin:"Entire Solution" /a
50+
>Edit.ReplaceInFiles "Console.Write(" "//Console.Write(" /lookin:"Entire Solution" /a /append:"Replace ^"Console.WriteLine(^" with ^"//Console.WriteLine(^""
51+
```
4652

4753
/case or /c
4854

@@ -70,7 +76,7 @@ Optional. Preserves the original casing of each match in your code.
7076

7177
/regex or /r
7278

73-
Optional. Uses pre-defined special characters in the `findwhat` argument as notations that represent patterns of text rather than the literal characters. For a complete list of regular expression characters, see [Regular Expressions](../../ide/using-regular-expressions-in-visual-studio.md).
79+
Optional. Uses predefined special characters in the `findwhat` argument as notations that represent patterns of text rather than the literal characters. For a complete list of regular expression characters, see [Regular Expressions](../../ide/using-regular-expressions-in-visual-studio.md).
7480

7581
/reset or /e
7682

@@ -94,7 +100,7 @@ Optional. Displays the results of the replacement in the **Find Results 2** wind
94100

95101
/wild or /l (not supported in Visual Studio 2022)
96102

97-
Optional. Uses pre-defined special characters in the `findwhat` argument as notations to represent a character or sequence of characters.
103+
Optional. Uses predefined special characters in the `findwhat` argument as notations to represent a character or sequence of characters.
98104

99105
/word or /w
100106

0 commit comments

Comments
 (0)