List of all available commands in VSCode

╄→尐↘猪︶ㄣ 提交于 2021-01-20 16:01:12

问题


Where can I find the list of all commands available in VSCode and their description?

I'm only aware of these sources:

In the official docs:

  • This list which only seems to include a subset of Visual Studio Code commands that you might use with vscode.commands.executeCommand API (why is this only a subset of the full list?)
  • This other list in the keybindings doc, which also only seems to include a subset of all commands available (I suppose those tied to a default keybinding?)

In the editor itself:

I can see a list of commands when I open the "default keybindings". Many actions are commented out with //, but interestingly I don't think this includes all the commands either (e.g. maximizeOtherEditor isn't listed)


Does VSCode have an official list of commands (commandID's) either in its documentation or in its code base? If not:

  • What's the closest to it?
  • What's a good way to navigate the code base to try to find all commands and what they do?

回答1:


I believe that content of "Preferences: Default Keyboard Shortcuts (JSON)" (command ID workbench.action.openDefaultKeybindingsFile) really shows comprehensive list of all native and extensions-contributed commands VSC knows about at moment when invoked.

This file shows keys from VSC's defaults and extension manifests. Commands with no suggested defaults are those commented out at the end of file.

Their descriptions (as seen in the Command Palette, Keyboard Shortcuts settings, extension Contributions tab and elsewhere) are supposedly in localization properties and I believe there is currently no way to see them along their respective command IDs in single convenient "localized" list. So for now the only way to read the description of command found in aforementioned JSON is pasting its ID into Keyboard Shortcuts search field. (Would be delighted to be proven wrong.)




回答2:


In case someone ever fell on this and just wanted a quick-list of VSCode commands to browse through: https://gist.github.com/skfarhat/4e88ef386c93b9dceb98121d9457edbf

If you do, please note the VSCode version and commit. These may well be out of date by the time you read them.



来源:https://stackoverflow.com/questions/58367207/list-of-all-available-commands-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!