13

I wish to use IDEA to edit a directory full of files of no particular type. So, I create a new project of type Empty Project and point it at my directory.

The project view now shows the files in the directory itself. But, it doesn't show any subdirectories. This is very strange.

Even more strangely, I can still use New -> Directory to create a new directory. From the command line I can see that the directory has been created; but, from within IDEA, it's still not appearing.

What's going on here? And, more importantly, how can I actually get it to show me my subdirectories?

This is IntelliJ IDEA 12.1.1. I did find IntelliJ does not show project folders, which sounds similar. But, it is referring to a different version of IDEA and they're not using an Empty Project. So, I don't think it's relevant.

Community
  • 1
  • 1
David Given
  • 13,277
  • 9
  • 76
  • 123
  • 3
    Add a module (for example web module) with the content root set to the project root. – CrazyCoder Apr 18 '13 at 21:23
  • 1
    Given that I can see the _files_ in the project root without a module, that shouldn't be necessary, surely? (Besides, there is no 'Empty Module' type...) – David Given Apr 18 '13 at 22:37
  • It's necessary. Files in the root is a special case, for the directories you have to add a module. – CrazyCoder Apr 19 '13 at 13:43
  • 2
    But why is it necessary? It seems like a very arbitrary limitation. I've created an empty project to make a simple high-fidelity mock-up. It isn't obvious or intuitive that I need a module. – NoBrainer Jul 28 '15 at 17:20

1 Answers1

7

In IntelliJ, you have to create at least one module. As CrazyCoder said in the comments, adding a module sets the root folder of what to display in the Project pane.

Here are steps that I took to show empty folders.

In a terminal window

mkdir one
mkdir one/two
mkdir one/two/three
mkdir one/two/three/four

In Intellij 15.0.2, I created a new project, selected Empty Project and set the Project Location to the one folder.

After creating the project, IntelliJ prompts me with a Project Structure dialog with Modules selected in the navigation tree. I clicked the '+' button in the middle pane to add a module. I chose Static Web as the module type to prevent creation of an additional src folder. I set the Content root and the Module file location of the module to the same one folder.

add module

I clicked Finish and then Ok. This gave me this structure

project structure

Community
  • 1
  • 1
Kirby
  • 15,127
  • 10
  • 89
  • 104