Reputation: 17
This is how I imagined that I could do it but I see that it is overwritten and only the last one is working:
{
"php": {
"prefix": "php",
"body": [ "<?php $1 ?>" ],
"description": "php tag",
"prefix": "echo",
"body": [ "echo \"$1\";" ],
"description": "php tag"
}
}
Thanks!
Upvotes: 1
Views: 174
Reputation: 146460
That's not even valid JSON. You should be getting green squiggly lines that display Duplicate object key on hover:
You need to edit the snippets\php.json
file and add several sub-objects to the top-level object identified by different key names; such key is meant to contain the snippet name, not the language, which is already set in the file name:
{
"PHP tags": {
"prefix": "php",
"body": [ "<?php $1 ?>" ],
"description": "php tag"
},
"echo statement": {
"prefix": "echo",
"body": [ "echo \"$1\";" ],
"description": "php tag"
}
}
Upvotes: 1