Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
273 views
in Technique[技术] by (71.8m points)

java - How to expand folded package chain in Intellij IDEA?

Intellij IDEA automatically chain packages together if the intermediate ones are otherwise empty. It is a nice feature in general. However, sometimes you don't want them to be chained, especially when you are in the middle of creating new package structures for your new project. I might have come across the setting for disabling this feature for a certain package, but I can't find it where now. So, does anyone know how to control this feature? Thank you very much.

BTW, in case you need clarification, what I mean by package chaining is as follows. Suppose you have this package structure:

$ tree com
com
└── company
    └── project
        └── some
            └── feature

Since there are really nothing else inside the intermediate folders, Intellij IDEA will automatically display it like

com.company.project.some.feature

in the project explorer, which looks like the packages are chained together.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Uncheck "Hide Empty Middle Packages" under the Project View settings dropdown:

Hide Empty Middle Packages


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...