使用特定搜索查询从扩展程序打开 VS Code 设置窗口 [英] Opening VS Code settings window from extension with specific search query

查看:24
本文介绍了使用特定搜索查询从扩展程序打开 VS Code 设置窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 VS Code 扩展,我想从我的扩展中以编程方式打开设置窗口.我希望窗口已经填写了搜索以仅显示我的扩展程序提供的设置,以及一种在打开窗口时选择工作区设置与用户设置的方法.我知道如何从我的扩展程序运行 vscode 命令,但我不知道哪些命令打开了那个窗口.

I am writing a VS Code extension where I want to open the settings window programmatically from my extension. I want the window to already have the search filled out to only show the settings my extension provides, and also a way to select workspace settings vs user settings when opening the window. I know how to run vscode commands from my extension, but I cannot figure out which commands open that window.

推荐答案

您现在可以将参数传递给搜索,例如

You can now pass an argument to the search, e.g.

vscode.commands.executeCommand( 'workbench.action.openSettings', 'editor.formatOnSaveTimeout' );

vscode.commands.executeCommand( 'workbench.action.openSettings', '<your extension>' );

这篇关于使用特定搜索查询从扩展程序打开 VS Code 设置窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆