These are my minimum requirements for an elegant and easy-to-use development environment with VS Code.
I am using Visual Studio Code as my main editor for several months now. It's perfomance, look & feels, available plugins and features makes it the perfect every-day editor for me. The only thing I'm missing is an equivalent Symfony plugin as it exists for PHPStorm.
Coupled with the following packages it has excellent autocompletion, code-formatting and many more.
Get and install composer as described here.
Install packages with composer global require <package_name>
.
phpstan/phpstan
- PHP Static Analysis Tooldeployer/deployer
- PHP Deployment Toolsquizlabs/php_codesniffer
- PHP Coding Standard Analysisphpunit/phpunit
- PHP Unit Testing Framework
Get and install NodeJS as described here. Alternatively use YARN.
Install packages with npm install -g <package_name>
.
eslint
- A fully pluggable tool for identifying and reporting on patterns in JavaScriptprettier
- Opinionated Code Formatter@prettier/plugin-php
- Prettier PHP Support
Those can be found in the inbuilt extension manager.
PHP Debug
- Debug support for PHP with XDebugPHP DocBlockr
- Helps Writing PHPDocPHP Getters & Setters
- Create PHP getters and setters from class propertiesPHP Intelephense
- PHP code intelligence for Visual Studio CodePHP Static Analysis
- Static analysis support for PHP with PhpStanphpcs
- Static analysis support for PHP with PhpStanTwig
- Syntax highlighting for PHP Twig
Nomo Dark Icon Theme
- Icon ThemePaper-tmTheme
- Color Scheme
Beautify
- Beautify code in place for VS CodeBracket Pair Colorizer 2
- A customizable extension for colorizing matching bracketsDotENV
- Support for dotenv file syntaxEditorConfig for VS Code
- EditorConfig Support for Visual Studio CodePrettier - Code formatter
- VS Code plugin for prettier/prettierProject Manager
- Easily switch between projects
There are a variety of fonts which come down to personal preference. The ones I use the most are:
{
"explorer.openEditors.visible": 0,
"git.autofetch": true,
// Editor
"editor.fontLigatures": true, // needed if using Fira Code
"editor.fontFamily": "'Hack', monospace",
"editor.fontSize": 13,
"editor.formatOnSave": true,
"editor.wordWrapColumn": 120,
// Workbench
"workbench.colorTheme": "Paper Dark",
"workbench.editor.enablePreview": false,
"workbench.iconTheme": "vs-nomo-dark",
// Project Manager
"projectManager.git.baseFolders": [
"C:\\Users\\<USERNAME>\\Development" // whatever your path is
],
"projectManager.git.ignoredFolders": [
"node_modules",
"out",
"build",
"typings",
"test",
".haxelib",
"vendor"
],
// PHP
"intelephense.licenceKey": "YOUR-LICENSE-KEY", // comment if you don't have one
"phpcs.executablePath": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\Composer\\vendor\\bin\\phpcs.bat", // This is on windows
// Formatting
"eslint.autoFixOnSave": true,
"beautify.language": {
"html": [
"html",
"vue"
],
"css": [],
"js": []
}
}