| description | Setting up the Visual Studio Code editor to work well with Drupal |
|---|
- Under Extensions
in the left sidebar, search for "PHP Debug" and click "Install"
- Edit
.vscode/launch.json - Add the following configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/app/": "${workspaceRoot}/",
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
- Under Extensions
in the left sidebar, search for "phpcs" and click "Install"
- Click in top navbar navigate to
file > preferences > settings - Under
Workspace Settingsexpand theExtensionsoption - Locate
PHP CodeSniffer configurationand scroll down to theStandardsection and click the "Edit in settings.json" link - Add the following configuration to your
Workspace Settings:
{
"phpcs.standard": "vendor/drupal/coder/coder_sniffer/Drupal",
}
.png)
