0

I have a Visual Studio Code project configured with multiple launch targets.

I'm aware I can select them on the Run dropdown in the Run view, however, I'd like to perform this operation via keyboard.

Is it possible? I can't find the action/keyboard shortcut in the keyboard shortcuts editor.

Marcus
  • 5,104
  • 2
  • 28
  • 24
  • 1
    Look athttps://stackoverflow.com/a/61847595/836330 - it might be helpful. You can set a shortcut to any specific launch config. – Mark Oct 27 '20 at 03:13
  • I updated the extension - now you can set multiple keybindings to different launch configurations. – Mark Oct 31 '20 at 22:27
  • @Mark interesting! if you convert it to answer, I'll upvote it - it will help people finding it :-) – Marcus Nov 02 '20 at 06:43

2 Answers2

0

Although there is no direct shortcut, it's possible to assign one to Select and Start Debugging, which yields essentially the same effect.

Marcus
  • 5,104
  • 2
  • 28
  • 24
0

See the extension Launch A Config. You can make multiple keybindings to any of your launch configs. Example keybinding:

{
  "key": "alt+f",
  "command": "launches.RunNodeCurrentFile"
},

where in your settings.json you link that command to sone launch config name:

"launches": {
  "RunNodeCurrentFile": "Launch File",
  "Test": "Run Extension Tests",
  // and more 
},
Mark
  • 143,421
  • 24
  • 428
  • 436