How do I get IntelliJ IDEA to display directories?

前端 未结 15 1239
臣服心动
臣服心动 2020-12-12 23:29

I\'ve been trying out IntelliJ IDEA for JavaScript editing, and I like it so far, but I\'m having a small problem with a new project.

I can\'t seem to be able to get

相关标签:
15条回答
  • 2020-12-12 23:49

    I think this is happening to you as intellij's Project window has the 'Compact Empty Middle Packages' option as checked by default. You will find this option under Setting section of the Projects tab.

    0 讨论(0)
  • 2020-12-12 23:53

    Platform : Intellij2019.3 Macos10.12

    • The solution is:
      1. go to the File - project structure - Modules
      2. In the left column, + Add Content Root, and add the folder you hope to use as the root directory.
      3. mark the folder you want to compile as source root
      4. rebuild
    0 讨论(0)
  • 2020-12-12 23:56

    In the project explorer window (where all the classes are), switch from "packages" view to "project" view. Then all files, not just classes are displayed.

    0 讨论(0)
  • 2020-12-12 23:57

    I've been struggling with this same problem and found another reason why directories may not show up correctly. Make sure the "Content Root" is correct.

    • Click on the project
    • Select "File"->"Project Structure"
    • Select "modules" from the left column, and select a module.

    On the sources tab you will see the current "Content Root" along with a button to add a new content root.

    Make sure that content root is correct. When in the project structure view you will only see files below the "Content Root". I'm fairly new to IntelliJ but I think of the content root as the basedir in ant terms.

    These instructions are for IntelliJ 9.x

    Hope this helps someone.

    0 讨论(0)
  • 2020-12-13 00:00

    Here is how I was able to "display" all folders in my project:

    1. Somehow get to the Project Settings page (for me it was right-click the project then select Modules)

    2. Make sure the Sources tab is selected

    3. You should see a section in the middle entitled "Excluded Folders" under Source\Folders"

    4. Click on the X next to it to remove it from being excluded and it becomes visible.

    Hope it this helps.

    0 讨论(0)
  • 2020-12-13 00:02

    I found the solution thanks to Thurman Sanders and decided to post a more clear answer, in case it helps anyone else. I know an answer like this would have saved me 5 minutes of fumbling around.

    Problem

    Some folders are excluded, by default. In most cases, this is exactly what you want. Other times, you need to see your "build" or "target" folder, for example.

    Solution

    Make Intellij stop excluding the folder you want to see

    1. Open the Module Settings
      • select the module and press F4
      • or right click the module and choose "open module settings"
      • or press cmd; to open project settings, then select your module
    2. Follow the steps in the picture, below:
      • select the 'sources' tab
      • select the folder you want to see
      • disable the 'excluded' option
    3. Press OK
      • When you're done, the folder will turn orange and finally be visible in the project view!

    enter image description here

    0 讨论(0)
提交回复
热议问题