Preview Raw String Literals in IntelliJ IDEA 2018.3
Our drive to develop has taken us into the fast lane, and just look at us go! Even though Java 11 has just come out, we’re already adding initial support for Java 12 in our upcoming IntelliJ IDEA 2018.3!
Please note that Java 12 is not released yet. You must accept the terms of the legal notice of the beta Java specification to enable support for Java 12. The implementation of an early-draft specification developed under the Java Community Process (JCP) is made available for testing and evaluation purposes only and is not compatible with any specification of the JCP.
Raw string literals (JEP 326) are ready for you to preview in IntelliJ IDEA 2018.3 Beta. To take advantage of coding assistance for Java 12, set the language level to “12 (Preview) – Switch expression, raw string literals” in the Project Structure dialog.
You can also run your application on JDK 12, by simply setting the Project SDK to JDK 12.
The IDE provides a quick-fix to convert multi-line string literals to raw string literals, and vice versa:
If your code happens to have redundant leading or trailing backticks (`) around a value in the raw string literals, IntelliJ IDEA detects this and provides a corresponding quick-fix.
Spell-checking works inside raw string literals as well.
Now you can paste a string with line separators not only as a string literal, but also as a raw string literal. The quotes will be adjusted according to the content of the raw string literal.
We’ve also extended the functionality of the intention that breaks a string literal and made it work for raw string literals too.
Please note that even though JEP 326 is targeted at JDK 12, it is still a preview feature. This means that according to JEP 12, it is “fully specified and fully implemented, and yet impermanent.” If its implementation changes in an upcoming release of Java, we’ll make sure to reflect such a change in IntelliJ IDEA as well.
Try this brand new support for raw string literals in the upcoming IntelliJ IDEA 2018.3 and do give us your feedback! Please share your thoughts via the discussion forum, our issue tracker, or on Twitter!
Subscribe to Blog updates
Thanks, we've got you!
The What, Why, and How of JPA Buddy in IntelliJ IDEA
Master JPA entity management with JPA Buddy in IntelliJ IDEA! Our latest article shows you how to simplify your workflow and reduce boilerplate code.
The Best of IntelliJ IDEA’s HTTP Client
In today's fast-paced tech world, easy and efficient management of web services and APIs is crucial. That's where IntelliJ IDEA's HTTP Client steps in, turning complex HTTP requests into a walk in the park. The HTTP Client is a feature-rich, text-based tool in IntelliJ IDEA Ultimate. It seamlessl…
Import Postman Collections to the HTTP Client
We know that many of you use Postman collections and want to stay in the flow while working with them. This means staying inside IntelliJ IDEA and not switching to a different app. Great news! You can now effortlessly transform Postman collections into .http and use them in the HTTP Client …
What’s New in IntelliJ IDEA 2023.1 for Spring Developers
The IntelliJ IDEA 2023.1 release came packed with updates for Spring. This blog post will highlight the most noticeable changes, including full support for Lombok, a reworked Spring tool window, navigation for Spring Security rules, Spring Security 6 support, and more. Remember that these featur…