How to fix package names in IntelliJ?

前端 未结 2 1555
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 11:04

Is it possible to fix all the package names in a given folder in IntelliJ?

If files are manually imported into IntelliJ, and their package names are all wrong (inclu

2条回答
  •  独厮守ぢ
    2021-01-01 11:32

    It seems you can't change a full package name like this one: "com.example.xml.xml", but you can change each fragment, for that you can go to "View Options" (a little wheel) in the project view, disable "compact empty middle packages" options, and do something like renaming the second "xml" from the end, so the final package could get into something like:

    com
     -example
       -bar
         -xml
    

    Then you can drag and drop all contents in the last "xml" to "bar" package and finally delete the last "xml". In your case it seems you won't need to rename the package just move the contents

提交回复
热议问题