How do I list/search all files of a specific type in Visual Studio Code

Viewed 2326

I want to see a filtered list of all the files in my project that have a specific extension.

As Im using a Scala language the files have the extension ".scala", so i would like to see a filtered list of all the files with a ".scala" extension.

The following post shows some techniques but nothing showing how to achieve what I require. How do I search for files in Visual Studio Code?

2 Answers

Based on @Mark response I enhanced my knowledge a bit further.

Here is the link to the Visual Studio Code website that explains it in more detail

https://code.visualstudio.com/docs/getstarted/userinterface#_filtering-the-document-tree


Summary

  1. Click on the "Explorer" icon in Visual Studio Code.
  2. Click on the "Explorer" panel background and type what you want to filter.

In my case i typed ".scala" and all other that did not have the scala extension were removed from view.

To remove the filter, simply click the cross next to the red text that represents what you typed as a filter.

The cross appears when you hover your mouse over the text.

As VonC mentioned in the comment, see also his answer at How to filter files shown in Visual Studio Code? in vscode v1.70 you should be able to filter the Explorer to show only files with a particular extension by typing .json for example into the new Find Widget for lists (the Explorer files is a list).

Demo:

filter the Explorer by extension

Note that there is a json.txt file that is not shown if you begin the filter with the ..

Related