Modern IDEs are very powerful tools that can help developers in all kinds of situations. Unfortunately, much of this power is often lost because many functions remain unknown to developers, hiding in the shadows.
Did you know that when you press F2 in IntelliJ IDEA, the cursor will jump to the nearest error in the file? And in the absence of an error – to the nearest warning? It seems that this is a secret only a few people know about.
Structural search and replace is one such pair of features. They can be extremely useful in situations where a whole variety of other functions can’t quite get the job done.
In this post, I will present some of these situations and go beyond artificial cases by demonstrating examples of real code from two projects:
- 3D-engine for game development, jMonkeyEngine, which is an example of a big, interesting project.
- My own pet project, plantuml-native-image, where I experiment with compiling PlantUML into native executable code using GraalVM Native Image.
In fact, it is this second project that encouraged me to write this post but I’m getting ahead of myself. First things first...