webksde / ddev-vscode-devcontainer-drupal-template

Drupal DDEV based development container with attached Visual Studio Code
23 stars 3 forks source link

Set path to executables (e.g. phpcs) in VSCode settings explicitely on container / workspace #88

Closed JPustkuchen closed 10 months ago

JPustkuchen commented 2 years ago

Problem:

Executable paths are overridden in my User settings in VSCode to make them run outside of containerized project, for example from User settings.json:

"composer.executablePath": "/usr/local/bin/composer",
"php.validate.executablePath": "F:\\Users\\Julian\\Lokale VMs\\WSL\\wsl-php\\php.bat",
"php.executablePath": "F:\\Users\\Julian\\Lokale VMs\\WSL\\wsl-php\\php.bat",
"phpcs.standard": "Drupal",
"phpcs.executablePath": "F:\\Users\\Julian\\Lokale VMs\\WSL\\wsl-phpcs\\phpcs.bat",
"php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar",
"php-cs-fixer.executablePathWindows": "F:\\Users\\Julian\\Lokale VMs\\WSL\\wsl-php-cs-fixer\\php-cs-fixer.bat",
"phpcbf.executablePath": "F:\\Users\\Julian\\Lokale VMs\\WSL\\wsl-phpcbf\\phpcbf.bat",
"phpmd.command": "F:\\Users\\Julian\\Lokale VMs\\WSL\\wsl-phpcs\\phpmd.bat",

As these are not explicitely set in the container or workspace, the User setting seems to apply and VSCode reports an error as it can't find phpcs

Setting this in settings.json from the container or workspace explicitely fixes it for phpcs:

{
  "phpcs.executablePath": "/var/www/html/vendor/bin/phpcs"
}

So my assumption is, that "User" settings apply if the corresponding workspace or container setting is empty...?

JPustkuchen commented 2 years ago

Ok as I just saw, this is already in .vscode/settings.json so I guess we currently can't fix it... The configuration doesn't seem to be imported for whatever reason... at least in some cases.

joshsedl commented 2 years ago

Hopefully this will get fixed, when we are able to use container settings instead of the current workaround using workspace settings

joshsedl commented 2 years ago

Could not replicate this issue, do you have the newest ddev software stack?

JPustkuchen commented 2 years ago

Let's keep this open to see if it happens again. Needs steps to reproduce.

joshsedl commented 10 months ago

I think we can close this.