Semantic Diff

#9144 Indent copied declarations in created interfaces at their place

2 commits

7249c119e4b590a831809c68ac8546baa05ca6bf..pr-9144

0fd89ab75 · cknitt + Claude · Oct 30, 2026, 20:37 UTC

Indent copied declarations in created interfaces at their place

Why

createInterface copied a type declaration or external with its source column as indentation, so a type written after { on the same line was pushed far right (#9135).

modifiedFormat createInterface output

module Make = (X: {type t}) => {  type u = X.t}
rescript
Before
After
module Make: (module Make: ( X: { X: { type t type t }, },) =>) =>{{ type u = X.t type u = X.t}}

Fixes #9135

Review

  • What happens to the lines after the first? They keep their indentation relative to the line the declaration starts on, re-based onto the interface's indentation.
aae3564ac · cknitt + Claude · Oct 31, 2026, 06:11 UTC

Copy lines inside multi-line string literals verbatim in created interfaces

Answers Codex's finding: reindenting the lines after the first also shifted lines inside a multi-line string or template literal, changing its value, such as an @as name. The extractor now scans the copied text and leaves lines that start inside a literal as they are.