Little-known features
Language injection
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 pickEdit 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.
Quick Preview
[Check screencast video on YouTube about this feature](https://youtu.be/D6YlYZVprCw)
IntelliJ provides a quick-preview feature called Viewing Definition. Using this feature allows a user to quickly see the contents of a method/class without navigating into the class itself
- OS X - (⌘+Y) or (⌥+Space)
- Unix / Windows - Ctrl+Shift+I
Example: Looking into Arrays.copyOfRange()
:
Verifying if you’ve selected the right class in Search
:
Or a quick look at some project files: