• IntelliJ IDEA: Structural Search and Replace

    • Translation
    • Tutorial

    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.

    Simple example of the one of the such functions

    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:

    1. 3D-engine for game development, jMonkeyEngine, which is an example of a big, interesting project.
    2. 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...

    Read more →