How to search for just a specific file type in Visual Studio code?

Visual Studio-Code

Visual Studio-Code Problem Overview


In Visual Studio code, how do I search for just a specific file type (i.e. *.css or *.ts)?

PS: I'm talking about the global search (Ctrl+Shift+F in Windows)

I'm already using the "files to include" as a folder filter. So currently it has something like ./src/app.

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

Click the ellipses on the bottom right to display the "files to include" field.

You can specify a particular type with "*.filetype".

E.g.

screenshot

Solution 2 - Visual Studio-Code

You can do this.

./src/app/**/*.ts

other glob syntax

  • * to match one or more characters in a path segment
  • ? to match on one character in a path segment
  • ** to match any number of path segments, including none
  • {} to group conditions (for example {**/.html,**/.txt} matches all HTML and text files)
  • [] to declare a range of characters to match (example.[0-9] to match on example.0, example.1, …)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionWagner Danda da Silva FilhoView Question on Stackoverflow
Solution 1 - Visual Studio-CodeBlorgbeardView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeMohitGhodasaraView Answer on Stackoverflow