Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99173

Possible to add palette command running another command with arguments?

$
0
0

Is it straightforwardly possible to define a command to be added into VS Code's command palette, which runs an existing command with specified arguments?

Concrete example: I have installed the Alignment extension, and want to use it to align Ruby symbol-key hashes like so:

{
  key:        'foo',
  anotherKey: 'bar',
  myKey:      'ponk'
}

I can do this by invoking Align by regex, then in the palette dialog that opens giving the regex (?<=:) \w.

Picking "Align by regex" from the paletteFollowing up by entering the regex

Naturally, that's a pain to type each time. Can I define a palette command to do that in one step?


Viewing all articles
Browse latest Browse all 99173

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>