Formatter rewrites Lisette f-strings to multiline interpolation that the compiler…
- User
Formatter rewrites Lisette f-strings to multiline interpolation that the compiler rejects
lis buildrejects multiline interpolation expressions insidef"...{...}"strings, but Zed’s Lisette formatter appears to rewrite single-line calls across lines automatically.Example:
f"You cannot use another ender pearl for {shared.format_duration( remaining, )}."The compiler reports:
[error] Multi-line f-string interpolation ... error: f-string interpolations must be single-lineImpact:
lis buildfails after formatting in touched spots.- This forces manual one-line edits to pass build.
Expected:
- Either Lisette formatter should preserve single-line interpolation in compatible cases, or
- Formatter rules should be configured to avoid splitting interpolation argument expressions across lines.
Interface
No new interfaces are introduced.
- Assistant
The formatter is splitting f-string interpolations across lines, which the compiler rejects — I'll locate the formatter logic and how f-strings are handled.
- Assistant
Reproducing the formatter behavior first, then implementing the fix.
- Assistant
Reproduction confirmed. Implementing
ForceUnbrokento keep f-string interpolations on one line. - Assistant
The
ForceUnbrokenhandler was passing through the parent mode instead of settingForcedUnbroken— fixing that. - Assistant
The fix works. Accepting the snapshot and running the format test suite.
- Assistant
Fixed. The formatter was breaking call expressions inside f-string
{...}interpolations across lines, but the Lisette lexer requires interpolations to stay on a single line.Root cause:
format_stringformatted interpolation expressions with the normalexpression()path, which can insert line breaks (e.g. wrapping call arguments). That produced invalid output like:f"...{shared.format_duration( remaining, )}."Fix: Added a
ForceUnbrokendocument mode to the pretty-printer (the inverse of existingForceBroken) that prevents any line breaks inside a region. F-string interpolations now wrap their expression with :
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.