79244836

Date: 2024-12-02 16:31:52
Score: 0.5
Natty:
Report link

I am not able to explain why that doesn't work, you should get some errors, but this works:
I have added alert statement to debug it if not. You can safely remove it.

myEditor.addCommand(
        monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyP, // Ctrl+P or Cmd+P
        function () {
            alert()
            // Trigger the built-in command palette command
            myEditor.trigger('keyboard', 'editor.action.quickCommand', null);
        }
    );

Your code in playground: this My answer: this

Reasons:
  • Blacklisted phrase (1): I am not able to
  • Has code block (-0.5):
Posted by: redoc