How to override built-in VSCode commands via an extension

Viewed 215

According to this issue comment, what I need should be this piece of code:

vscode.commands.registerCommand('type', (args) => {
  console.log(`type with args`, args)
  return vscode.commands.executeCommand('default:type', args)
})

This should allow for overriding the built-in type command and even call the original command if needed via default: prefix. However, I get this error, which implies otherwise.

enter image description here

Is there any alternative way of achieving the desired override or am I just doing something wrong?

0 Answers
Related