I've been learning more recently about user snippets and due to some things I've been reading on here I got interested about combining them as well using the multi-command extension.
I'm writing my first sequence and this is where I am at now:
"multiCommand.commands": [
{
"command": "multiCommand.createFolderStructure",
"sequence": [
{
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"command": "editor.action.clipboardCopyAction",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"command": "explorer.newFile"
},
{ "command": "editor.action.clipboardPasteAction" },
{
"command": "editor.action.insertSnippet",
"args": {
"snippet": ".js"
}
}
]
}
]
So what this does at the moment is:
- Opens the renaming for current active folder.
- Copies the name of the folder.
- Creates new file in active folder.
- Pastes the name of the folder from clipboard.
With the last command I was trying to add .js
at the end of it. But it does not seems to be working. The insert snippet only works in the editor. I didn't find anything else that would work for me. Is there anyone that knows whats a good command id for this particular thing?
Ok I have managed to do what I needed but in an overly complicated way. If anybody knows the answer to my questions I would still like it. This is what I did:
This is the complete series of actions I had to do for all the requirements I had if anybody is interested. However this will not work for you as it is as you also need the user snippets I defined