13

Say I have project with a lot of modules in Intellij-Idea:

  • A
  • B
    ...
  • Z

In specific time I need to work with only 2 or 3 modules: A, M, Z. So it would be very convenient to hide all other modules from Project Browser. Or to reorder packages like:

  • A
  • M
  • Z
  • B
  • ...

Is there any way to do that?

UPDATE: I don't want to delete inactive modules, I just want to group modules I'm working with.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • To hide all modules from project I'm not working with in current moment. –  Jul 06 '15 at 12:31
  • possible duplicate of [Closing unused modules in intellij idea like in eclipse](http://stackoverflow.com/questions/22527842/closing-unused-modules-in-intellij-idea-like-in-eclipse) – Darek Kay Jul 06 '15 at 12:34
  • Yes, I got that. Why do you want to hide them? What are you doing in the project tab that the additional modules make difficult? Especially with the fuzzy file finding I'm basically never in that view at all. – Dave Newton Jul 06 '15 at 12:35
  • When surfing I have to much unnesissary information in project tab. Surfing from A to M I have to scroll B-N "inactive" projects. –  Jul 06 '15 at 13:05

3 Answers3

14

There is no way to change the order of the modules. But there are two ways you could do what you want.

  1. Module Groups

Create some module groups by going to File > Project Structure > [Modules]. Move modules to a module group by selecting one of more modules, open the context menu (i.e. right click) and select Move Module to Group. You can create a new group, select an existing group, or move them outside any group:

enter image description here

Then in the project view, you can collapse the group(s) with the modules you do not want to focus on. All modules are still present and available (i.e. no modules are deleted). Search Grouping Modules in the help guide for more information.

  1. Scope View

Define a Scope (Settings > Appearance & Behavior > Scopes ) that will only show the modules you are interested in. See the Help page for information on Scope syntax and how to define modules. Then, in the project took window, select the scope view:

enter image description here

The first option is probably the easier of the two.

Javaru
  • 30,412
  • 11
  • 93
  • 70
  • Module groups are deprecated since IntelliJ IDEA 2017.3. Instead a new feature "Group modules by fully qualified names" is recommended. See https://www.jetbrains.com/help/idea/creating-and-managing-modules.html for the details. – user272735 May 17 '23 at 05:49
0

As far as I know IntelliJ sorts the modules alphabetically.

This means you can reorder the modules unfortunately only by renaming the folders they are in, e.g.:

Project
├── .idea
├── 01 Baz
├── 02 Foo
└── 03 Bar

It it a workaround at best, but it is not something you commit to VCS, and it does the trick.


This is how it looks in my case:
File Explorer

IntelliJ

0

UPDATE: I don't want to delete inactive modules, I just want to group modules I'm working with.

Since IntelliJ IDEA 2017.3 the recommended way to group modules is to use a feature "Group modules by fully qualified names".

  1. Open the Project Structure dialog Ctrl+Alt+Shift+S and click Modules.
  2. Select the modules you want to group, open the context menu, and click Change Module Names.
  3. Specify a prefix and apply the changes.

Relevant documentation: https://www.jetbrains.com/help/idea/creating-and-managing-modules.html

user272735
  • 10,473
  • 9
  • 65
  • 96