Skip to content

feat(dune_lang): format multi-line strings#13758

Draft
Alizter wants to merge 1 commit intoocaml:mainfrom
Alizter:push-kxrkwxtlkorp
Draft

feat(dune_lang): format multi-line strings#13758
Alizter wants to merge 1 commit intoocaml:mainfrom
Alizter:push-kxrkwxtlkorp

Conversation

@Alizter
Copy link
Copy Markdown
Collaborator

@Alizter Alizter commented Mar 9, 2026

This change adds support for preserving multi-line block strings ("|" and ">" syntax) when formatting dune files with version >= 3.23.

For dune-lang < 3.23, block strings are converted to:

  • Regular escaped strings (if no pforms)
  • Templates (if pforms present, to preserve expansion semantics)

Supersedes #10780 and #11581.

@Alizter Alizter marked this pull request as draft March 9, 2026 22:19
@Alizter Alizter force-pushed the push-kxrkwxtlkorp branch from 71caf09 to 7c16a47 Compare March 9, 2026 22:22
@Alizter Alizter force-pushed the push-kxrkwxtlkorp branch from 7c16a47 to 736212e Compare March 18, 2026 00:02
@Alizter Alizter force-pushed the push-kxrkwxtlkorp branch from 736212e to 241c9af Compare March 18, 2026 00:03
@Alizter Alizter requested review from nojb and rgrinberg March 18, 2026 00:04
@Alizter Alizter marked this pull request as ready for review March 18, 2026 00:05
@Alizter Alizter removed request for nojb and rgrinberg March 18, 2026 00:06
@Alizter Alizter marked this pull request as draft March 18, 2026 00:06
@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Mar 18, 2026

I think I will iterate on this a bit further, I'm still not happy with it myself. But others are welcome to take a look.

This change adds support for preserving multi-line block strings ("\|"
and "\>" syntax) when formatting dune files with version >= 3.23.

For dune-lang < 3.23, block strings are converted to:
- Regular escaped strings (if no pforms)
- Templates (if pforms present, to preserve expansion semantics)

Supersedes ocaml#10780 and ocaml#11581.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter force-pushed the push-kxrkwxtlkorp branch from 241c9af to 9f52c4e Compare March 18, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant