1

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!

1 Answer 1

1

That's not even valid JSON. You should be getting green squiggly lines that display Duplicate object key on hover:

Duplicate object key

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"
    }
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.