Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering of example projects removes the | from scala code #4542

Closed
lefou opened this issue Feb 12, 2025 · 0 comments · Fixed by #4544
Closed

Rendering of example projects removes the | from scala code #4542

lefou opened this issue Feb 12, 2025 · 0 comments · Fixed by #4544
Milestone

Comments

@lefou
Copy link
Member

lefou commented Feb 12, 2025

As an example, see example project example/javascriptlib/module/1-common-config/build.mill, which contains the following snippet:

  def generatedSources = Task {
    for (name <- Seq("A", "B", "C")) os.write(
      Task.dest / s"foo-$name.ts",
      s"""export default class Foo$name {
         |  static value: string = "Hello $name"
         |}
      """.stripMargin
    )

    Seq(PathRef(Task.dest))
  }

It's rendered as follows:

Image

https://mill-build.org/mill/main-branch/javascriptlib/module-config.html

If you look closely, you can see that the | (pipe) symbol is missing from the rendered source code.

@lefou lefou changed the title Rendieging of example projects removes the | from scala code Rendering of example projects removes the | from scala code Feb 12, 2025
lefou added a commit to lefou/mill that referenced this issue Feb 12, 2025
Since we use Scala string intrpolation as a low cost template engine,
we need to avoid `.stripMargin`, as it may over-eager strim margin symbols
from the interpolated variables.

Fix com-lihaoyi#4542
@lefou lefou added this to the 0.13.0 milestone Feb 12, 2025
lefou added a commit that referenced this issue Feb 12, 2025
#4544)

Since we use Scala string intrpolation as a low cost template engine,
we need to avoid `.stripMargin`, as it may over-eager strip margin
symbols
from the interpolated variables.

Fix #4542

Pull request: #4544
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 a pull request may close this issue.

1 participant