DEV Community

dumdumdev
dumdumdev

Posted on

Php using VSCode

I am learning Php and trying to get VSCode to Format and code complete my files. I have the Extensions recomended by VSC and have looked around but it seems that I have everything that they suggest. Is there a setting I am missing?
The issue for me is when saving it doesn't format or tab anything properly.(Even when Formatting the file from menu) I do have that set to on_save in settings not on_type. It doesn't even have an auto complete for a Php block.
Am I missing soemthing here? I set up my own snippet and that works but wondering why when you type <? VSC doesn't auto complete the rest. Any help would be awesome.

{

    "Php IF Statement": {
        "prefix": "pif",
        "body": [
            "<?php"
                "if ( $1 ) : ",
                " $2;",
                " endif;",
            "?>"
        ],
}

Top comments (1)

Collapse
 
siatwe profile image
Simon Weis

Maybe you should install php-cs-fixer and this extension php-cs-fixer Extension) for formatting. Have you set this "editor.tabCompletion": "on" to your settings.json?