扩展 Azure Data Studio 的功能Extend the functionality of Azure Data Studio

Azure Data Studio 中的扩展提供向基本 Azure Data Studio 安装添加更多功能的简便方法。Extensions in Azure Data Studio provide an easy way to add more functionality to the base Azure Data Studio installation.

扩展由 Azure Data Studio 团队 (Microsoft) 以及第三方社区(你)提供。Extensions are provided by the Azure Data Studio team (Microsoft), as well as the third-party community (you!). 有关创建扩展的详细信息,请参阅扩展创作For more information about creating extensions, see Extension authoring.

添加 Azure Data Studio 扩展Add Azure Data Studio extensions

  1. 通过选择扩展图标或选择“视图”菜单中的“扩展”来访问可用扩展 。Access the available extensions by selecting the Extensions Icon, or by selecting Extensions in the View menu. 可以使用“视图 :显示扩展”命令,该命令可在“命令面板”中找到(F1 或 Ctrl+Shift+PYou can use the View: Show Extensions command, available in the Command Palette (F1 or Ctrl+Shift+P).

    扩展管理器图标

    还可通过按 Ctrl+Shift+X (Windows/Linux) 或 Command+Shift+X (Mac) 来快速访问扩展管理器。You can also quickly access the extensions manager by pressing Ctrl+Shift+X (Windows/Linux) or Command+Shift+X (Mac).

  2. 选择某个可用扩展以查看其详细信息。Select an available extension to view its details.

    扩展详细信息

  3. 选择所需的扩展并“安装”它。Select the extension you want and Install it.

  4. 安装后,重载以启用 Azure Data Studio 中的扩展(仅在第一次安装扩展时需要进行此操作)。Once installed, Reload to enable the extension in Azure Data Studio (only required when installing an extension for the first time).

如果访问 Azure Data Studio 上的扩展管理器时遇到问题,则可以在 GitHub Wiki 上下载所需的扩展。If you're having problems accessing the Extensions Manager on Azure Data Studio, you can download the extension you need on our GitHub Wiki.

管理扩展Manage extensions

列出已安装的扩展List installed extensions

默认的“扩展”视图显示当前启用的扩展、推荐的所有扩展以及所有当前禁用的扩展的折叠容器。The default Extensions view shows the extensions that are currently enabled, all extensions that are recommended for you, and a collapsed container of all currently disabled extensions. “扩展 :显示已安装扩展”命令,该命令可以在“命令面板”或“更多操作”(...) 下拉菜单中找到,显示所有已安装扩展的列表,包括已禁用的扩展The Extensions: Show Installed Extensions command, available in the Command Palette or the More Actions (...) drop-down menu, shows a list of all installed extensions, including disabled extensions.

卸载扩展Uninstall an extension

若要卸载扩展,请单击扩展条目右侧的齿轮图标,然后从下拉菜单中选择“卸载”。To uninstall an extension, click the gear icon on the right of an extension entry and choose Uninstall from the drop-down menu. 这将卸载选定的扩展,并提示你重新加载 Azure Data Studio。This uninstalls the selected extension and will prompt you to reload Azure Data Studio.

扩展下拉列表

禁用一个扩展Disable an extension

可以暂时禁用扩展,而不是永久删除扩展。You may temporarily disable an extension instead of permanently removing an extension. 可以禁用所有 Azure Data Studio 会话的扩展(“禁用”),也可以仅禁用当前工作区的扩展(“禁用(工作区)”) 。You can either disable an extension across all Azure Data Studio sessions (Disable) or just for your current Workspace (Disable (Workspace)). 还可以通过命令面板使用命令“扩展 :禁用所有扩展”和“扩展 :禁用所有扩展(工作区)”来禁用所有当前安装的扩展程序You can also disable all of your currently installed extensions through the Command Palette with the commands Extensions: Disable All Extensions and Extensions: Disable All Extensions (Workspace).

添加扩展Enable an extension

如果扩展已禁用,它将位于扩展列表的“禁用”部分,并标记为“已禁用”。If an extension has been disabled, it will be in the Disabled section of the extension list and marked as Disabled. 可以使用下拉菜单中的“启用”或“启用(工作区)”命令来重新启用它 。You can re-enable it with the Enable or Enable (Workspace) commands in the drop-down menu. 通过命令面板,还可使用命令“扩展 :启用所有扩展”和“扩展 :启用所有扩展(工作区)”来启用所有扩展The Command Palette also lets you enable all extensions with the commands Extensions: Enable All Extensions and Extensions: Enable All Extensions (Workspace).

启用扩展

更新扩展Updating an extension

Azure Data Studio 会自动检查并安装任何已安装扩展的更新。Azure Data Studio automatically checks for and installs updates for any of your installed extensions. 若要关闭自动更新功能,则可以使用“扩展 :禁用自动更新扩展”命令来禁用自动更新If you would like to turn off the auto-update feature, you can disable auto-update with the Extensions: Disable Auto Updating Extensions command.

若要手动更新扩展,可以使用“扩展 :显示过期的扩展”命令检查是否有扩展更新,该命令使用 @outdated 筛选器在扩展列表中进行搜索To manually update an extension, you can check for extension updates with the Extensions: Show Outdated Extensions command which searches through your extension list using the @outdated filter. 这将显示所有当前安装的扩展的任何可用更新。This will show any available updates for all currently installed extensions. 在过期的扩展上单击“更新”按钮可安装更新。Click the Update button on an outdated extension and the update will be installed. 系统将提示你重载 Azure Data Studio。You will then be prompted to reload Azure Data Studio. 还可以使用“扩展 :更新所有扩展”命令同时更新所有过期的扩展You can also update all of your outdated extensions simultaneously with the Extensions: Update All Extensions command.

“扩展 :检查是否有扩展更新”命令是另一种检查哪些扩展具有可用更新的方法The Extensions: Check for Extensions Updates command is another way to check which of your extensions have updates available.

从 VSIX 安装Install from a VSIX

可以使用“扩展”视图命令下拉列表中的“从 VSIX 安装”命令,或者命令面板中的“扩展.vsix **:从 VSIX 安装”命令,手动安装打包在 文件中的 Azure Data Studio 扩展,并指向扩展的 文件。You can manually install an Azure Data Studio extension packaged in a .vsix file using the Install from VSIX command in the Extensions view command drop-down, or the Extensions: Install from VSIX command in the Command Palette and point to the extension's .vsix file.

访问已安装的 Azure Data Studio 扩展Access installed Azure Data Studio extensions

每个扩展都以不同的方式增强你在 Azure Data Studio 中的体验。Each extension enhances your experience in Azure Data Studio in a different way. 因此,扩展的入口点可能会有所不同。As a result, the entry point for extensions can vary. 请参阅已安装的扩展的单独文档,了解关于如何在安装该扩展后访问其功能的信息。Refer to your installed extension's individual documentation for information on how its features can be accessed once it's installed.

扩展视图筛选器Extensions view filters

“扩展”视图搜索框支持筛选器,以帮助你查找和管理扩展。The Extensions view search box supports filters to help you find and manage extensions. 命令“显示安装的扩展”和“显示建议的扩展”在搜索框中使用 @installed@recommended 等筛选器 。The commands Show Installed Extensions and Show Recommended Extensions use filters such as @installed and @recommended in the search box.

通过在扩展搜索框中键入 @ 并浏览建议,可以查看所有筛选器和排序命令的完整列表:You can see a complete listing of all filters and sort commands by typing @ in the extensions search box and navigating through the suggestions:

扩展排序

以下是“扩展”视图筛选器:Here are the Extensions view filters:

  • @builtin - 显示 Azure Data Studio 附带的扩展。@builtin - Show extensions that come with Azure Data Studio. 按类型(编程语言、主题等)分组。Grouped by type (Programming Languages, Themes, etc.).
  • @disabled - 显示已禁用的安装扩展。@disabled - Show disabled installed extensions.
  • @enabled - 显示已启用的安装扩展。@enabled - Show enabled installed extensions. 可以单独启用/禁用扩展。Extensions can be individually enabled/disabled.
  • @installed - 显示已安装的扩展。@installed - Show installed extensions.
  • @outdated - 显示已过期的扩展。@outdated - Show outdated installed extensions. 市场现在提供新版本。A newer version is available on the Marketplace.
  • @recommended - 显示建议的扩展。@recommended - Show recommended extensions. 按工作区特定用途或常规用途分组。Grouped as Workspace specific or general use.
  • @category - 显示属于指定类别的扩展。@category - Show extensions belonging to specified category. 下面是几个受支持的类别。Below are a few of supported categories. 要获得完整的列表,请键入 @category 并按照建议列表中的选项进行操作:For a complete list, type @category and follow the options in the suggestion list:
    • @category:themes
    • @category:formatters
    • @category:snippets 这些筛选器也可以组合。@category:snippets These filters can be combined as well. 例如,@installed @category:themes 显示所有已安装的主题。For example, @installed @category:themes displays all installed themes.

如果未提供筛选器,则“扩展”视图将显示当前已安装和建议的扩展。If no filter is provided, the Extensions view displays currently installed and recommended extensions.

排序Sorting

可以使用 @sort 筛选器对扩展进行排序,它采用以下值:You can sort extensions with the @sort filter, which can take the following values:

  • installs - 按扩展库的安装计数降序排序。installs - Sort by extension gallery installation count, in descending order.
  • rating - 按扩展库等级(1 - 5 星)降序排序。rating - Sort by extension gallery rating (1-5 stars), in descending order.
  • name - 按扩展名的字母顺序排序。name - Sort alphabetically by extension name.

常见问题Common questions

扩展安装在哪里?Where are extensions installed?

扩展安装在每用户扩展文件夹中。Extensions are installed in a per user extensions folder. 根据你的平台,该位置位于以下文件夹中:Depending on your platform, the location is in the following folder:

  • Windows %USERPROFILE%\.azuredatastudio\extensionsWindows %USERPROFILE%\.azuredatastudio\extensions
  • macOS ~/.azuredatastudio/extensionsmacOS ~/.azuredatastudio/extensions
  • Linux ~/.azuredatastudio/extensionsLinux ~/.azuredatastudio/extensions