How do I get IntelliJ IDEA to display directories?

2019-01-21 10:05发布

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 IDEA to display the directories in the project directory in the Project view. Even if I manually add a directory, it refuses to display it.

I think this probably has something to do with the fact that it tries to apply Java conventions, but when I imported an old Eclipse project, it showed all directories just fine.

Do I have to use Eclipse to create projects and import in IDEA to get the directories visible, or is there some other trick?

I am using IDEA version 8.1.3, and the code is just a plain bunch of HTML and JavaScript files, not in any kind of a Java environment.

14条回答
一夜七次
2楼-- · 2019-01-21 10:43

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.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-01-21 10:47

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.

查看更多
登录 后发表回答