Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add --space=2 because -t4 is always set #155

Open
jcvanhalle-ec opened this issue Oct 23, 2024 · 1 comment
Open

Can't add --space=2 because -t4 is always set #155

jcvanhalle-ec opened this issue Oct 23, 2024 · 1 comment

Comments

@jcvanhalle-ec
Copy link

I want 2 spaces indentation so I set up --space=2 in formatter arguments option of the extension but it seems -t4 is hardcoded when passing arguments to pretty-php.

Can it be disabled ?

2024-10-23 11:38:57.698 [info] Spawned: /usr/bin/php -ddisplay_errors=stderr -dshort_open_tag=On /home/user/.vscode/extensions/lkrms.pretty-php-0.4.74/bin/pretty-php.phar --space=2 -r blank-before-return -r align-data -r align-chains -r align-comments -r align-fn -F /home/user/file.php -t4 -q -- -
2024-10-23 11:38:57.909 [info] /usr/bin/php reported:
Error: --tab and --space cannot both be given
@lkrms
Copy link
Owner

lkrms commented Oct 23, 2024

The VS Code extension passes the indentation selected in the editor to the formatter, so if you want to use two spaces, use VS Code to choose 2 spaces for editing purposes, remove the formatter arguments, and everything should just work.

You may need to use VS Code settings to force 2 spaces when editing PHP and override its auto detection when opening existing files with other indentation types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants