We have several of the same snippets in our snippets json:
"Function-Advanced": {
"prefix": "function-advanced",
"body": [
"function ${1:Verb-Noun} {",
"\t[CmdletBinding()]",
"\tparam (",
"\t\t$0",
"\t)",
"\t",
"\tbegin {",
"\t}",
"\t",
"\tprocess {",
"\t}",
"\t",
"\tend {",
"\t}",
"}"
],
"description": "Script advanced function definition snippet"
},
"Cmdlet": {
"prefix": "cmdlet",
"body": [
"function ${1:Verb-Noun} {",
"\t[CmdletBinding()]",
"\tparam (",
"\t\t$0",
"\t)",
"\t",
"\tbegin {",
"\t}",
"\t",
"\tprocess {",
"\t}",
"\t",
"\tend {",
"\t}",
"}"
],
"description": "Script cmdlet definition snippet"
},
This could be avoided by supporting an array of prefixes like so:
"Cmdlet": {
"prefix": ["function-advanced", "cmdlet"], // <--- here
"body": [
"function ${1:Verb-Noun} {",
"\t[CmdletBinding()]",
"\tparam (",
"\t\t$0",
"\t)",
"\t",
"\tbegin {",
"\t}",
"\t",
"\tprocess {",
"\t}",
"\t",
"\tend {",
"\t}",
"}"
],
"description": "Script cmdlet definition snippet"
}
It'd help slim down snippet json files and support snippets that might go by different names.
We have several of the same snippets in our snippets json:
This could be avoided by supporting an array of prefixes like so:
It'd help slim down snippet json files and support snippets that might go by different names.