- Developing Multi:Platform Apps with Visual Studio Code
- Ovais Mehboob Ahmed Khan Khusro Habib Chris Dias
- 802字
- 2021-06-11 18:23:25
Extension filters
In this topic, we will discuss some commands to filter extensions in VS Code.
View commands to filter extensions
VS Code offers various commands to filter extensions. You can open the Commands context menu by hitting the … from the Extensions bar that displays the list of commands to further filter extensions, as shown in the following screenshot:

Figure 2.5 – Context menu showing the different commands for extensions
Each option is self-explanatory and shows extensions based on different options. They allow you to check for extension updates, disable the autoupdating of extensions, install any custom extensions from a VSIX file, or disable all installed extensions.
Extension identifiers
VS Code also provides lot of identifiers that you can type in the Search Extensions textbox and find or filter the extension based on the identifier type. To list all of the identifiers, you can type @ and it will give you options to select from and filter extensions accordingly:

Figure 2.6 – Using extension identifiers
Here are some of the most commonly used ones:
- @id: If you know the ID of the extension, then you can use the @id:{extension_code} to add the C/C++ extension type, such as @id: ms-vscode.cpptools.
- @builtin: Shows out-of-the-box extensions that come with VS Code.
- @sort: Sorts extensions based on their name, ratings, and installs. For example, to sort C++ extensions based on their name, you can type C++ @sort:name. You can also sort them based on their rating or installs by running the C++ @sort:rating and C++ @sort:installs commands respectively.
- @recommended: Shows recommended extensions.
- @enabled: Shows a list of enabled extensions.
- @disabled: Shows a list of disabled extensions.
- @installed: Shows a list of installed extensions.
- @tag: Search for extensions with tags. For example, @tag:Microsoft will search for all of the extensions that are tagged with Microsoft.
- @outdated: Shows a list of outdated extensions.
You can also combine multiple extensions to filter or refine your search for more accurate searching. For example, to search enabled extensions with category formatters, we can type @enabled @category:formatters.
Filtering extensions using categories
Extensions can also be filtered with categories and tags. Categories and tags are used to describe the features of the extension and then you can use the given syntax to filter out extensions based on the categories or tags assigned to them.
To filter extensions based on categories, you can type @category: in the extension bar and filter it out based on the supported categories shown in the following screenshot:

Figure 2.7 – Using the category filter
Similarly, you can also use @tag: to filter out extensions based on their tag. For example, you can filter out the extensions tagged to Microsoft, as shown in the following screenshot:

Figure 2.8 – Using the tag filter
Unlike categories, when searching with @tag:, we won't get any IntelliSense extensions, and you need to search the marketplace in order to know which tags are helpful.
Creating a list for recommended extensions
When working in a team, we sometimes need to share a list of recommended extensions with the other members of the team. There might also be the case where a lead developer adds certain extensions that are essential for a project and wants to share those with the team. One option is to compile the list of extensions and distribute it to the team so they can install them on their own machines. Another way of doing this is to create an extension list and share it with your team.
To create a list of recommended extensions, open the Command Palette by hitting F1 and then type Extensions: Configure Recommended Extensions (Workspace). This command creates a new extensions.json file that will reside in the .vscode folder. You can open this file and add the recommended extensions by adding the following snippet:
{
"recommendations": [
"ms-kubernetes-tools.vscode-kubernetes-tools",
"azuredevspaces.azds"
]
}
Here is the list of default paths in which the .vscode folder resides for each platform:
- Windows: %USERPROFILE%\.vscode\extensions
- Linux: ~/.vscode/extensions
- macOS: ~/.vscode/extensions
The default location for extensions can be changed by running the following command:
code --extensions-dir <dir>
The following example sets the default extensions directory to the vscodeextensions folder in the C drive:
code --extensions-dir c:\vscodeextensions
Each extension should be added by providing its extensions code. You can then share this list with any member in your team who can place it under the .vscode folder. Finally, once the VS Code opens, it will show users the recommended extensions, which can be installed right away:

Figure 2.9 – List of recommended extensions
This is one of the best features when we are working as a team. Every team of developers can build their own set of recommended lists of extensions and share with other team members so that they can use it.
- Node.js+Webpack開(kāi)發(fā)實(shí)戰(zhàn)
- What's New in TensorFlow 2.0
- Rake Task Management Essentials
- Python Deep Learning
- Python高級(jí)編程
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- Mastering React
- Arduino可穿戴設(shè)備開(kāi)發(fā)
- ActionScript 3.0從入門(mén)到精通(視頻實(shí)戰(zhàn)版)
- 貫通Tomcat開(kāi)發(fā)
- Getting Started with Electronic Projects
- HTML5移動(dòng)前端開(kāi)發(fā)基礎(chǔ)與實(shí)戰(zhàn)(微課版)
- 數(shù)據(jù)科學(xué)中的實(shí)用統(tǒng)計(jì)學(xué)(第2版)
- Xamarin Cross-Platform Development Cookbook
- 少兒編程輕松學(xué)(全2冊(cè))