microsoft / monaco-editor

A browser based code editor
https://microsoft.github.io/monaco-editor/
MIT License
39.61k stars 3.54k forks source link

[Bug] `Toggle Tab Key Moves Focus` missing from Command Palette #4367

Open scnwwu opened 6 months ago

scnwwu commented 6 months ago

Reproducible in vscode.dev or in VS Code Desktop?

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.36.0#example-creating-the-editor-hello-world

Monaco Editor Playground Code

No response

Reproduction Steps

Open Command Palette, search for Toggle Tab Key Moves Focus command

Actual (Problematic) Behavior

Toggle Tab Key Moves Focus missing from Command Palette. Ctrl+M still works but if user don't know it, they can't find it. With #4124, it's harder for user to know it. It's an important accessibility feature.

Expected Behavior

Toggle Tab Key Moves Focus command exists in Command Palette

Additional Context

v0.35.0 works well

vinayak25 commented 3 months ago

A little late here, but whoever is facing this issue, you can make use of editor.addAction method to add a custom command.

    editor.addAction({
      id: 'TOGGLE_TAB_FOCUS_MODE',
      label: 'Toggle Tab Focus Mode',
      run: () => {
        editor.trigger('shortcut', 'editor.action.toggleTabFocusMode', '');
      }
    });