Configuring VSCode - ben600324/wiki GitHub Wiki

VSCode can be set up in two ways, you can either edit all of your content from a shared network folder or you can use SSH tunnelling.

The shared network folder is the system we have been using for ages but requires that a local version of PHP is installed and Xdebug is set up. It also requires ports to be forwarded to your machine which has been an issue in the office.

The SSH tunnel method is relatively new, this method takes a little configuration in VSCode but means that all of the hard work is done on the server. Debugging and other services are directly run on the same PHP install as the site is using.

We recommend using the tunnel method, if you are setting up a new machine or having trouble with Xdebug you should switch to this method instead of trying to fight with making everything local.

Setting up remote SSH tunnel

Prerequisites Install WSL Ubuntu: https://docs.microsoft.com/en-us/windows/wsl/install-win10 Check you have OpenSSH Client: Settings > Apps and Features > Optional features

SSH Key based authentication VSCode Remote SSH requires you have key based authentication set up to connect to the server

Further reading: https://code.visualstudio.com/docs/remote/ssh

VSCode remote SSH Config

Andy!

{
"phpcs.executablePath": "vendor/squizlabs/php_codesniffer/bin/phpcs",
"phpcs.standard": "Drupal,DrupalPractice",
"html.format.enable": true,
"html.format.wrapLineLength": 80,
"files.watcherExclude": {
"**/config/**": true,
"**/docroot/core/**": true,
"**/docroot/sites/**": true,
"**/vendor/**": true
},
"files.associations": {
"*.inc": "php",
"*.module": "php",
"*.install": "php",
"*.theme": "php",
"*.tpl.php": "php",
"*.test": "php",
"*.php": "php"
},
}