Example
If you want to write strings containing other languages (JSON, regexes), it's hard to keep up with escaping symbols, and it would be nice to get some code assist.
- Put your cursor inside an empty string
ALT + ENTER
- Pick "Inect language or reference"
- Pick the desirable language (
RegExp
in my case) from the pop-up
- Again use
ALT + ENTER
and pick Edit regex fragment
- In the new tool window enter the regex - note how it's automatically mapped to a properly escaped Java string. Similarly for JSON the indents will be placed properly.