如何在 executeCommands() 中查找 VSCode 命令的参数 [英] How to find the parameters for a VSCode command in executeCommands()

查看:40
本文介绍了如何在 executeCommands() 中查找 VSCode 命令的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一个vscode扩展并使用vscode.commands.executeCommands(),但是我不知道我要使用的命令需要什么参数.

例如,当我想使用 "actions.find" 命令时,如何找出该特定 API 接受哪些参数?

解决方案

我认为目前没有任何关于命令及其参数的综合文档. 的实现,它支持一组明确定义的参数,例如搜索查询等.

I want to write a vscode extension and use vscode.commands.executeCommands(), but I don't know what parameters the command I want to use takes.

For example, when I want to use the "actions.find" command, how do I find out what parameters this specific API accepts?

解决方案

I don't think there's any comprehensive documentation on commands and their arguments at this time. This page does list some of the most important ones though.

For some commands, there's also args auto-completion in keybindings.json:

Note that a lot of the built-in commands aren't much of an "API" at all. Looking at its implementation, "actions.find" in particular does not seem to support any arguments that would be useful to extensions. Compare this to the implementation of "workbench.action.findInFiles", which supports a well-defined set of arguments such as search query etc.

这篇关于如何在 executeCommands() 中查找 VSCode 命令的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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