IntelliJ IDEA 2017.2 EAP Introduces Unloaded Modules

Another week of work for us—something new for you to try: have a look at the fresh IntelliJ IDEA 2017.2 EAP build. In addition to bugfixes, it introduces a new, experimental feature called Unloaded Modules.

This feature is supposed to help you to deal with large codebases by giving you the ability to select what modules you are going to work on in your project. Modules that you are not working with at the moment are marked as Unloaded and IntelliJ IDEA will not index or otherwise touch any files in these modules, which can help to conserve CPU and memory resources.

To access the feature, invoke the Project tree context menu and select Load/Unload Modules:

And now you just select the modules you’d like to work with at the moment.:

If a module you marked as loaded depends on other modules, IntelliJ IDEA will prompt you to load them as well:

When you’re about to refactor something, or are looking for usages of a symbol, you will be warned about the fact that there are unloaded modules that depend on the modules with which you are working, and therefore might contain code that should have been affected by the action, but won’t be:

It’s important to understand that when you exclude a module, consistency of changes in code that belongs to it will not be guaranteed, so be cautious when using this feature.

Even though this feature is openly available, it’s still under development, so please share your feedback, including bug reports in our issue tracker.

Develop with Pleasure!

About Andrey Cheptsov

Part-time dreamer. JVM/JavaScript geek. IntelliJIDEA Marketing Manager at JetBrains.
This entry was posted in EAP Releases, New Features and tagged , . Bookmark the permalink.

16 Responses to IntelliJ IDEA 2017.2 EAP Introduces Unloaded Modules

  1. Carsten Otto says:

    I don’t understand the advantage. First, you say the unloaded modules are not indexed. Then, you describe how refactoring still has knowledge about the unloaded modules, because they were/are indexed. Would active indexing happen to loaded modules, which are just sitting there untouched?

    • Paul Chesnais says:

      The biggest advantage I see here, and it’s why I’m excited about this feature, is when you hop between classes by name. If your codebase is sectioned into modules that each contain similarly or identically named classes (e.g. each module is an adapter for an API or a database), then it quickly becomes tedious to search by name when you’re working on a single adapter.

    • I suspect this is does by tracking the module dependencies in the .iml module definition files, it doesn’t need to maintain an index for that knowledge..

      The advantage for me is not loading and watching 40+ modules when i’m often only working on 3-4 at a given time. And if I AM working on them, often some are on one topic branch, whilst others are on a different set.

      What could be neat is tracking sets of loaded/unloaded modules based on active changeset or something.

      Having a lower working memory footprint would be nice.

      • Nikolay Chashnikov says:

        Yes, Mark is right. As you may see on the screenshot, the message say that there *may be* usages in the unloaded modules. IDEA doesn’t index content of unloaded modules but it knows which loaded modules they depend on.

  2. some dude says:

    When are we getting “native” hassle free gradle-script-kotlin support in intellij?

    • Ilya Chernikov says:

      The gradle-script-kotlin support is a part of the Kotlin plugin. We are working on it and plan to release an improved, as much hassle-free as possible, support in one of the next releases of Kotlin.

  3. Love the idea – can’t wait to try it out. One thing that immediately comes to mind is a warning that a module contains changed files based on VCS. Which would imply some external process has changed the file, and maybe you actually want it loaded…

  4. I love the sound of this.
    What happens when I have 10 unloaded modules and 2 loaded. Those loaded depends on those unloaded.
    Will I be able to extend class for the unloaded (parent module), for example?
    Will I be able to navigate to the super class which sits in the unloaded module?

    It would be super cool if those unloaded modules would have at least one indexing done and assume that developers won’t work on them.

    • will there be an SKD API for this feature? Can we suppress the warning through API?

      • Nikolay Chashnikov says:

        There is an API to load/unload modules (it’s marked as experimental for now though), but it isn’t possible to suppress the warning via API. Why do you want this?

    • Nikolay Chashnikov says:

      Martin, if a class from loaded module depends on a class from unloaded module such reference will be shown as red and compilation will fail, because IDE doesn’t look into unloaded modules and doesn’t include them into compilation classpath. That’s why ‘Load/Unload Modules’ dialog suggest to unload all dependent modules when you unload a module.

      It seems that you want to mark some modules as read-only, not to unload them completely. It can be useful indeed, but it’s a different feature, and it’s much harder to implement. (It’s not enough to index such modules once, because their content may be changed when you update from VCS for example.)

      • Martin Jones says:

        Yes, indeed. I’d like “read only” modules. Perhaps a feature for 2017.3? :)
        Typical hybris projects have 60-90modules which will never be modified by developers. We call it out-of-the-box modules which work as a base for the platform. Projects then customise the platform by adding new modules which inherit from those OOTB.
        90 modules is not a small number from performance point of view.
        I have tried to “hack” IDEA and pass compiled sources as libraries but it’s not ideal solution. read-only feature would be ideal.

  5. Marten Deinum says:

    Sounds like a great feature. I’m writing a book and have loads of modules with code samples. Now I can load only the modules for the sections I’m working on.

    I ran into a glitch (I guess) I have nested structure and when trying to load a top-level project (i.e. a whole chapter) it doesn’t work, I have to go inside the project and select the individual source sets and add those one by one. Quite cumbersome.

    • Nikolay Chashnikov says:

      Could you please file a issue in our tracker, attach your project configuration files (*.iml files and .idea directory) and specify which modules you’re trying to unload?

  6. Michael Gellenthin says:

    In every release of this eap I can’t use xdebug for debugging php-projects. I already get an error “com.intellij.ide.browsers.BrowserLauncherImpl$checkCreatedProcess$1 cannot be cast to java.lang.Runnable”. Is this issue is already known? With my Idea 2017.1.4 the same project works fine…?

  7. Finally! The feature waited for 6 years to be implemented :) However, why the dedicated modal dialog to load/unload modules? Extra item in the context menu makes the long menu even longer, plus the accessibility isn’t coherent with the way we are used to managed module related settings. Why couldn’t be part of the modules dialog where we already have all the controls to managed the settings related to modules?

Leave a Reply

Your email address will not be published. Required fields are marked *