Skip to content

Conversation

gridbugs
Copy link
Collaborator

Fixes #12311

@gridbugs gridbugs requested a review from ElectreAAS August 26, 2025 07:33
File "dune-project", line 1, characters 0-0:
Error: Invalid first line, expected: (lang <lang> <version>)

Hint: You may want to verify the following depexts are installed:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be updated too with the new line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally yes but I haven't figured out how to express this with Pp. The algorithm that Pp uses for formatting breaks lines in such a way that it breaks between Hint: and the message depending on the length of the message. In this case it splits if the concatenation of all depext names is longer than some threshold even though the depext names are in a vbox so their total width shouldn't matter (only their maximum width).

It might be a bug in Pp though I don't completely understand Pp.

File "dune-project", line 1, characters 0-0:
Error: Invalid first line, expected: (lang <lang> <version>)

Hint: You may want to verify the following depexts are installed:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be updated too with the new line?

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
@@ -8,6 +8,7 @@ let depexts_hint = function
; Pp.enumerate ~f:Pp.verbatim depexts
]
|> Pp.concat_map ~sep:Pp.cut ~f:(fun pp -> Pp.box pp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ~f:Fun.id and you should put Pp.hovbox on the first line and Pp.vbox on the second. Then you should do a Pp.vbox after concatenating. I think this will give you what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants