Php using VSCode

github logo ・1 min read

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;",
            "?>"
        ],
}
twitter logo DISCUSS (1)
markdown guide
 

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?

Classic DEV Post from Jan 17

25 years of coding, and I'm just beginning

I've come to a conclusion that I have nothing to show for my 25 years of coding. I am ready to begin and I have a plan.

dumdumdev profile image

Let's talk shop 👩‍💻👨‍💻

Sign up (for free)