How to open the lightbulb via shortcut?

后端 未结 2 421
日久生厌
日久生厌 2020-12-25 09:28

Some languages support code actions which display a lightbulb providing quick fixes for a warning/error (See https://code.visualstudio.com/docs/editor/editingevolved#_code-a

相关标签:
2条回答
  • 2020-12-25 09:47

    The correct command editor.action.quickFix. The default binding on Windows looks like this:

    { "key": "ctrl+.", "command": "editor.action.quickFix",
                       "when": "editorTextFocus" }
    

    On Mac it's CMD + ..

    0 讨论(0)
  • 2020-12-25 10:02

    If you're a JetBrains junkie and can't imagine not hammering on Alt+Enter all day long, then you can re-map the default (Ctrl+.) easily enough.

    Open the File menu and select Preferences then Keyboard Shortcuts.

    Type editor.action.quickFix into the search box:

    Click the pen icon, or right-click and select Change Keybinding.

    Enter your preferred shortcut into the dialog that appears, then press Enter.

    You should end up with something that looks like:

    0 讨论(0)
提交回复
热议问题