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:
lisettef"You cannot use another ender pearl for {shared.format_duration( remaining, )}."The compiler reports:
text[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
I’ll trace the formatter’s f-string handling and its existing tests, then patch the layout rule and run the focused suite plus the broader formatter checks.
- Assistant
rgisn’t installed in this checkout, so I’m usingfind/grepfor the same repository inspection. I’m also checking local contribution instructions and the worktree before editing. - Assistant
The fault is in the pretty-printer: interpolation expressions are formatted as ordinary documents, so an enclosing 80-column group can activate their call-argument breaks. I’m adding an explicit “unbreakable” document wrapper for interpolation expressions and a regression snapshot using the reported call shape. Hard newlines already present in f-string text remain unaffected.
- Assistant
The regression now formats the reported interpolation on one line even though the surrounding f-string exceeds the normal width. I’m checking the full formatter snapshot suite next, including idempotence/neighboring layouts, and then I’ll validate the resulting diff.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.