Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

5 Less Known Cool IntelliJ Features

DZone's Guide to

5 Less Known Cool IntelliJ Features

IntelliJ is one of the most popular IDEs for software development. Check out these little-known features to save you some time.

· DevOps Zone ·
Free Resource

Learn more about how CareerBuilder was able to resolve customer issues 5x faster by using Scalyr, the fastest log management tool on the market. 

In this article, I am going to share some cool features I stumbled upon while coding with IntelliJ. These are not the most popular/productivity-improving ones - for these, you should watch this video

1. Set Debugger Breakpoint by Pattern

Problem: You want to check if the debugger steps into some code during the run. Usually you suspect where the flow will end up but sometimes finding the exact line could be hard.

Solution: Breakpoints in Debugger pane -> Click (+) -> Java Method Breakpoint -> Fill class/method pattern. 

For example, this setting will stop the debugger anytime the code enters any method from any class from com.fasterxml.jackson package.

Image title

2. Attaching Custom Log Files to Be Followed After Spring Boot App Startup

Problem: You have your app log configured to write to the file after the startup. However, this makes it harder to read that log because now you have to open this file somehow instead of just checking the console output. 

Solution: Run/Debug Configuration -> Your Spring Boot app -> Logs -> Click (+) -> Fill alias and Log File Location. This will open an additional pane with file content after you run the configuration that is easy to work with. 

Image title

3. Invoke Any Code on the Screen When in Debug Mode

Problem: You want to check the result of invoking some code on the screen but you are to lazy to paste it to Evaluate Expression console.

Solution: When the program is paused in debug mode, hit the alt key and click any fragment you want to see the result.

Image title

4. Compare With Clipboard

Problem: You would like to compare some text the same way Intellij’s VCS diff shows changes in files.

Solution: Copy text to the clipboard -> Select any other text -> Right Click -> Click Compare With Clipboard.

I think it is worth to have a key assigned to this one.

Image title

5. Shelve Changes

Problem: I used to use Git stash command externally to save some changes I didn’t want to commit yet. Is there a way to do this from IntelliJ? 

Solution: VCS -> Local Changes -> Select the files you want to stash -> Right Click -> Shelve changes.

You can move them back from the shelf by right-clicking on the selection and choosing Unshelve.

Image title

Conclusion

I hope you have learned at least one thing that might be helpful at your work. Please share other cool but less-known IntelliJ features in the comment section. 

Find out more about how Scalyr built a proprietary database that does not use text indexing for their log management tool.

Topics:
devops ,intellij ,ide

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}