DEV Community

dumdumdev
dumdumdev

Posted on

3

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?

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay