vscode (browser ) php-sniffer extension fails to execute phpcs

Created on 24 October 2024, 2 months ago

Problem/Motivation

When launching a DrupalPod instance using VSCode browser, the php-sniffer extension tries to execute phpcs, with a bootstrap value of:

/workspace/.vscode-remote/extensions/wongjn.php-sniffer-1.3.0-universal/lib/files.php,/workspace/.vscode-remote/extensions/wongjn.php-sniffer-1.3.0-universal/lib/tab-width.php

This fails because the command is executed inside the ddev web container, and the folder "/workspace/.vscode-remote/..." is not present inside the container. This error is being thrown:

at executeCommand (/workspace/.vscode-remote/extensions/wongjn.php-sniffer-1.3.0-universal/lib/cli.js:151:29)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async Object.phpcs (/workspace/.vscode-remote/extensions/wongjn.php-sniffer-1.3.0-universal/lib/runner.js:159:22)
2024-10-23 14:01:50.389 [error] Error: Notice: running 'php vendor/bin/phpcs --report=json --bootstrap=/workspace/.vscode-remote/extensions/wongjn.php-sniffer-1.3.0-universal/lib/files.php,/workspace/.vscode-remote/extensions/wongjn.php-sniffer-1.3.0-universal/lib/tab-width.php --stdin-path=/workspace/drupalpod/vendor/bin/phpcs --extensions=/workspace/drupalpod/vendor/bin/phpcs --standard=Drupal --runtime-set ignore_warnings_on_exit 1 --runtime-set ignore_errors_on_exit 1 -q -' in ddev
ERROR: The specified bootstrap file "/workspace/.vscode-remote/extensions/wongjn.php-sniffer-1.3.0-universal/lib/files.php" does not exist

Steps to reproduce

1. Create a new DrupalPod instance using VSCode browser.
2. Wait for the environment to initialize.
3. Go to any php file, and open it.
4. You will see the error message.

🐛 Bug report
Status

Active

Component

VSCode extension

Created by

🇪🇸Spain guiu.rocafort.ferrer Barcelona

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024