geddski / macros

macros support for VS Code
MIT License
165 stars 36 forks source link

is it possible for macros to take arguments? #21

Open lopugit opened 6 years ago

lopugit commented 6 years ago

If I'm calling a macro as a command from elsewhere, can I give it an args list?

ghost commented 6 years ago

Taken from https://marketplace.visualstudio.com/items?itemName=geddski.macros#overview

Passing Arguments to Commands Many commands accept arguments, like the "type" command which lets you insert text into the editor. For these cases use an object instead of a string when specifying the command to call in your settings.json:

"macros": { "addSemicolon": [ "cursorEnd", {"command": "type", "args": {"text": ";"}} ] }

I can't get it to work with editor.action.indentUsingSpaces though...