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

[Feature request] Add code highlighting for String interpolation in Scala #3284

Closed
jeanmarc opened this issue Dec 28, 2021 · 3 comments · Fixed by #3293
Closed

[Feature request] Add code highlighting for String interpolation in Scala #3284

jeanmarc opened this issue Dec 28, 2021 · 3 comments · Fixed by #3293

Comments

@jeanmarc
Copy link

I would like to know if it is possible to add highlighting of code that is part of Scala's string interpolation:

  val data = lines.map(_.toInt).sliding(2).toList
  println(s"We have ${data.size} pairs")

The part between ${ and } in a string that starts with s" should be highlighted as if it is actual code.

@jeanmarc
Copy link
Author

Test drive:
image
IntelliJ:
image

@RunDevelopment
Copy link
Member

Yes, it's possible. I'll add it next week.

@RunDevelopment RunDevelopment self-assigned this Dec 28, 2021
@jeanmarc
Copy link
Author

That sounds great. Do you know the Scala syntax for string interpolation? The string must be prefixed wits s or f, and then can contain $var and ${expression} parts (plus a formatting suffix in case of an f prefix). More info on https://docs.scala-lang.org/overviews/core/string-interpolation.html

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

Successfully merging a pull request may close this issue.

2 participants