VSC command log

Trying to figure out how to create a key binding for a specific command. I can see the command in pallete, but it has no bindings, so I cannot see it in keybindings.json.

Is there a way that I can log all the commands executed in the VSC so that I can execute the command and see the command name in the log?

Edit:

To make it clear:

  • I want the general method to know how I can find which commands were issued along with their command IDs.
  • I already know that I find some commands in a file default keybindings

    and is NOT a common way to find the command you ran. It does not list the entire command, does not explain what they are, and you cannot use it to make sure it is the command you followed.
+4


source to share


2 answers


You can also create a binding using keyboard shortcuts (" Preferences: Open Keyboard Shortcuts

command" Preferences: Open Keyboard Shortcuts

). You can search by command name and even check the corresponding ID:
enter image description here

The second option is that you can turn on tracing and see the executed commands in the output pane (it looks like it doesn't log commands executed from the command palette):



  1. Set the log level for trace

    . You can either pass the --log argument when starting VS Code, for example: code --log trace

    (for some reason it doesn't work for me), or execute Developer: Set Log Level...

    from the command palette:enter image description here

  2. After that, you should see the executed commands in the output pane for the Window process.
    enter image description here

+2


source


The "Toggle Line Comment" command ID is editor.action.commentLine

.

You can find all Command IDs using the search function in the keyboard shortcut editor (on macOS, you can open it through Application Menu > Preferences > Keyboard Shortcuts

or with a shortcut Cmd+K Cmd+S

).



In keybindings.json

you can run autocomplete help (i.e. Ctrl+Space

) and search for all available commands.

+1


source







All Articles