ObliviousHarmony / vscode-php-codesniffer

A VS Code extension for integrating PHP_CodeSniffer.
https://marketplace.visualstudio.com/items?itemName=obliviousharmony.vscode-php-codesniffer
Other
38 stars 2 forks source link

Path to windows executable can't handle spaces #97

Open es-sayers opened 1 month ago

es-sayers commented 1 month ago

Description

Unable to have a space in the file path to the windows PHPCS executable.

Reproduction Steps

  1. Go to Extension settings
  2. Scroll down to PHP Code Sniffer > Exec: Windows
  3. Enter C:\Users\User Name\path\to\executable or quoted "C:\Users\User Name\path\to\executable"
  4. See error "The PHPCS executable "C:\Users\User" could not be found."

Expected Behavior

Expected the executable to be found.

ObliviousHarmony commented 1 month ago

Thanks @es-sayers,

It looks like there's a problem with the handling of quoted strings when using Windows directory separators. If you use / instead for your path ("C:/Users/User Name/path/to/executable") it should work. Note that you do need to escape the path. This is because the executable option supports the use of spaces to create more complicated commands such as running it via docker.

Definitely still something to fix though.