- Visual Studio Find All And Replace
- Visual Studio Find All Subclasses
- Visual Studio Find All References
This is an extension for Visual Studio Code that allows you tosearch for all the occurrences of some text within the current document.
The option chosen from the Look in drop-down list determines whether Find in Files searches only in currently active files or in all files stored within certain folders. Select a search scope from the list or click the Browse (.) button to display the Choose Search Folders dialog box and to enter your own set of directories. There is a section called 'Find All In File' in the Visual Studio Code settings. If you don't want to Find All In File to add items to your editor context menu, you can disable the 'Editor Context Menu' setting ('findAllInFile.editorContextMenu' in settings.json). The default is true which means enabled, and setting it to false will disable it.
Installing
The simplest way to get this extension is directly from ExtensionsMarketplace built into Visual StudioCode.
An alternative way to get this extension is from the Marketplace webpage for Visual StudioCode.
Usage
Visual Studio Find All And Replace
After installing this extension in Visual Studio Code, you will have some new commands available:
Visual Studio Find All Subclasses
- Find All In File: Find Regex (Case Insensitive)Search using a case insensitive regularexpression.
- Find All In File: Find Regex (Case Insensitive, Whole Word)Search using a case insensitive regular expression, match whole word.
- Find All In File: Find Regex (Case Sensitive)Search using a case sensitive regular expression.
- Find All In File: Find Regex (Case Sensitive, Whole Word)Search using a case sensitive regular expression, match whole word.
- Find All In File: Find String (Case Insensitive)Search using a simple case insensitive string.
- Find All In File: Find String (Case Insensitive, Whole Word)Search using a simple case insensitive string, match whole word.
- Find All In File: Find String (Case Sensitive)Search using a simple case sensitive string.
- Find All In File: Find String (Case Sensitive, Whole Word)Search using a simple case sensitive string, match whole word.
All of these combinations match the corresponding options in the built-in Visual Studio CodeSearch interface.
You can use these commands from theCommand Paletteby typing 'Find All In File'
, then selecting the command variant you want to use.
You can can also access these from the editor context menu by right mouse clicking on an opendocument. The same commands are available, with slightly different names:
- Find Regex (Case Insensitive)
- Find Regex (Case Insensitive, Whole Word)
- Find Regex (Case Sensitive)
- Find Regex (Case Sensitive, Whole Word)
- Find String (Case Insensitive)
- Find String (Case Insensitive, Whole Word)
- Find String (Case Sensitive)
- Find String (Case Sensitive, Whole Word)
Visual Studio Find All References
For all of these commands you will first be asked to enter a search string. If you have textselected in your document, that should be the default search string. If you have done any previoussearches, those should also be available in your search history list under that. Of course you canalso type in a new search string as well. Once you finish entering the string, the extension willsearch the current document and display the results.
The results of your search (all the matching occurrences of the string or regex) will show up inthe Find All In FileSide Bar. You canalso manually show the Find All In File Side Bar by selecting the corresponding icon in theActivity Bar. You canuse these results to quickly preview the matches that were found. If you hover on one of theresults, a tooltip will show the complete result details if that information isn't fully visibleotherwise. If you click on one of the results, it will take you to that location in the document,and the matching text will be selected. It's also possible to view the results view at any time byusing the 'Find All In File: Focus on View' command. The format of these results is:
[Match Number] [Line Number]:[Start Column]-[End Column] [Text of matching line from file]
The first and last lines in the Side Bar are special. The first line shows you the search youperformed, and the last line shows you the summary of the search results. If you select either ofthese lines, the entire search results will be copied to the clipboard so you can use textprocessing tools to interact with the results.
Settings
There is a section called 'Find All In File' in the Visual Studio Codesettings.
If you don't want to Find All In File to add items to your editor context menu, you can disable the'Editor Context Menu' setting ('findAllInFile.editorContextMenu' in settings.json). The default istrue
which means enabled, and setting it to false
will disable it.
If you want to change the limit on the number of results that will be found, you can modify the'Result Limit' setting ('findAllInFile.resultLimit' in settings.json). The default is 10000, and you can change it to any number, or zero to disable it (no limit).
If you want to change the limit on the number of searches that will stored in the history, you canmodify the 'Search History Limit' setting ('findAllInFile.searchHistoryLimit' in settings.json).The default is 10, and you can change it to any number between 1 and 100 inclusive.
Note
There is a GitHub issue requesting this featurebe integrated into Visual Studio Code. If that ever happens then this extension will becomeobsolete (we all hope).
Contributions
If you have any suggestions for improvements, find any problems, have any feedback, or would like toprovide translations for the strings in this extension, please contact me on theGitHub project page
Legal
Copyright © 2019 Benbuck Nason.
Released under the ISC license.