Verified on latest main
PHPantom version / commit
0.10.0
Installation method
Pre-built binary from GitHub Releases
Operating system
Linux x86_64
Editor
Zed
Bug description
Using the "Format buffer" action (to auto format the current file) in Zed fails when phpcbf is used.
If the file has formatting issues running the action generates error:
Formatting failed: phpcbf exited with code 2 (stderr: )
Even when the file doesn't have any formatting errors Zed gives an error
Formatting failed: phpcbf exited with code 2 (stderr: No fixable errors were found)
This most likely stems from the fact that phpantom treats phpcbf's exit code 2 as an error
|
match status.code { |
|
0 | 1 => Ok(formatted), |
|
_ => Err(format!( |
|
"phpcbf exited with code {} (stderr: {})", |
|
status.code, |
|
status.stderr.trim() |
|
)), |
|
} |
The resolution would be to treat exit codes 0-2 as non errors.
Steps to reproduce
.
Error output or panic trace
.phpantom.toml
Additional context
No response
Verified on latest main
mainbranch.PHPantom version / commit
0.10.0
Installation method
Pre-built binary from GitHub Releases
Operating system
Linux x86_64
Editor
Zed
Bug description
Using the "Format buffer" action (to auto format the current file) in Zed fails when phpcbf is used.
If the file has formatting issues running the action generates error:
Even when the file doesn't have any formatting errors Zed gives an error
This most likely stems from the fact that phpantom treats phpcbf's exit code 2 as an error
phpantom_lsp/src/formatting.rs
Lines 529 to 536 in 533ef88
The resolution would be to treat exit codes 0-2 as non errors.
Steps to reproduce
.
Error output or panic trace
.phpantom.toml
Additional context
No response