geddski / macros

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

Cannot change language mode #34

Open gormac opened 6 years ago

gormac commented 6 years ago

As mentioned in the comments of issue #14 by @martin-tarjanyi:

I would like to have a macro to change the language mode to Json and format the document according to that. However, I'm not able to provide an input for this command automatically.

"macros": {
    "formatJson": [
        {"command": "workbench.action.editor.changeLanguageMode", "args": {"id": "json"}},
        "editor.action.formatDocument"
    ]
}
elcasa commented 5 years ago

I would like to do the same with XML, when you copy them text from logs or similar, it would help... I'm doing it many times a day..

usernamehw commented 5 years ago

Not sure if it'll help but I just wrote and extension to change language from a keybinding: https://marketplace.visualstudio.com/items?itemName=usernamehw.change-language-mode

mask2012 commented 5 years ago

@gormac a year passed, still not working using your code, I don't know why macros is so hard to use in vs code.

sublime can easily record macros and play it by keybinds.

in vs code ,you need to struggle in editing the macros by hand editing, and facing so much problems.

gormac commented 5 years ago

@mask2012 Last commit was in late 2017. This appears to be a dead repository.