-
-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
With PHP 8.5 the new pipe operator has been introduced.
Unfortunately it seems that prettier/plugin-php isn't able to format correctly and throws an error.
I have PHP 8.5 installed and I don't use composer, just plain old PHP.
2026-01-29T12:14:37+01:00 ERROR [project::lsp_store] Formatting failed: default prettier instance failed to format buffer: SyntaxError: Parse Error : syntax error, unexpected '>' on line 137
135 | {
136 | return array_map(fn($part) => trim($part, DIRECTORY_SEPARATOR), $parts)
> 137 | |> fn(array $paths) => implode(DIRECTORY_SEPARATOR, $paths)
| ^
138 | |> fn(string $path) => preg_replace("#" . DIRECTORY_SEPARATOR . "+#", DIRECTORY_SEPARATOR, $path);
139 | }
140 | }
While handling prettier request: {"jsonrpc":"2.0","id":3,"method":"prettier/format","params":{"text":"..snip..","options":{"plugins":[".../Zed/prettier/node_modules/@prettier/plugin-php/standalone.js"],"parser":"php","filepath":"some filepath","prettierOptions":{"tabWidth":2,"printWidth":100,"useTabs":false,"phpVersion":"auto"},"ignorePath":null}}}
Metadata
Metadata
Assignees
Labels
No labels