
Uninstall PHP IntelliSense (it will be installed by default) Install PHP Intelephense. From the Configuration drop down, select the directory that serves as the project root and select the Configure icon. Prettier ensures consistency in your code formatting and makes the process automatic. Within Visual Studio Code, go to the Extensions tab and search PHP. To start debugging in Visual Studio Code: Select the code to debug - in this case, index.php. More time can be devoted to solving challenging technical problems instead of wrestling over solved problems like code indentation. Agreeing upon a set of configurations helps with legibility and understanding of code. Visual Studio comes available to Windows and Mac users, however Mac users are more limited in their capabilities with the product. It is particularly beneficial when working on a project with multiple collaborators. Having consistent code is a good practice.


After creating one of these and checking it into your project, you can ensure that every team member follows the same formatting rules. In this article, you’ll set up Prettier to automatically format your code in Visual Studio Code, also known as VS Code.įor demonstration purposes, here’s the sample code you will be formatting: const name = "James" const person = įor more specifics on the configuration files, check out the Prettier Docs. Formatting code consistently is a challenge, but modern developer tools make it possible to automatically maintain consistency across your team’s codebase.
