Skip to content

Have formatter insert newlines around multi-line expressions #8960

Open

Description

@rolandpeelen
  module Details = {
    @react.component
    let make = (~input as {filePath}: input) => React.string(filePath)
  }
  module Body = {
    @react.component
    let make = (~input as {filePath, oldString, newString, replaceAll}: input) => <>
      <ToolView.Field label="file" value=filePath />
      <ToolView.Text
        label={replaceAll->Option.getOr(false) ? "replace all" : "replace"} text=oldString
      />
      {newString == ""
        ? <ToolView.Field label="with" value="(nothing)" />
        : <ToolView.Text label="with" text=newString />}
    </>
  }
  module Output = Tool.TextResult.Output
  let failed = Tool.TextResult.failed

It seems that some AIs love writing very dense code, and it makes things rather unreadable. It would be amazing if we could print in a way that adds white-spacing / makes the formatting consistent. Just like we remove double white-spacing in the formatter

I have a draft PR (vibed) here: #8961

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions