Closed scippio closed 5 months ago
I found thats php-cs-fixer doesn't not support stdout :thinking: :disappointed: ... So thats maybe the problem....
Is there fully supported php formatter for conform? I habe Mason and trying pretty-php too, but without success...
Why are you defining formatters
? These are all formatters that are built-in, and you're overriding their args to be invalid.
But it's not working without definitions. When I open my php file I get:
I think you have something wrong with your config. If you define a formatter in your formatters_by_ft
it should always show up in :ConformInfo
. If you're missing a definition for that formatter, it will give you the error:
Formatters for this buffer:
php-cs-fixer unavailable: No config found
Which, indeed, we do expect because the name of that formatter is actually php_cs_fixer
with underscores. You don't need to define any of the formatters you have in the formatters
block, and in the case of prettier it is actively buggy. If you still can't get it working, I recommend starting with a minimal neovim config (like the one in the bug report template) and see if that can reproduce the issue.
php_cs_fixer` with underscores.
omg :facepalm: Sorry, it works now... I'm new in nvim & plugins and I overlooked :see_no_evil: all these build-in formatters :man_facepalming:
Thank you for help. I'm closing this "issue".
Neovim version (nvim -v)
v0.9.5
Operating system/version
Archlinux
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
12:03:45[ERROR] error formatting log line: '"Formatter 'php-cs-fixer' error: PHP CS Fixer 3.51.0 (008b824) Insomnia by Fabien Potencier, Dariusz Ruminski and contributors.\nPHP runtime: 8.3.3\nLoaded config default.\nUsing cache file \".php-cs-fixer.cache\".\n 0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0%\n 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%\n\n"' args {
n = 0
}
Describe the bug
I have problem with my php-cs-fixer setup. I added php-cs-fixer config, but when formatter starts I get this php-cs-fixer error. Maybe I have bad configuration setup? Please help. Thank you.
Manual runs are ok like:
php-cs-fixer fix /path-to-file
or ("The command can also read from standard input, in which case it won't
automatically fix anything" in docs):
cat /path-to-file | php-cs-fixer fix -
What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
1) start nvim with conform 2) open php file 3) try save/format by conform
Expected Behavior
format without error
Minimal example file
No response
Minimal init.lua
Additional context
No response