package confusion with Intellij 2017.2.6

Answered

Not totally sure if this is the right forum for this question, but since I'm attempting to add a module to the intellij-community source it probably fits.

Anyways, so I have the project opened already. The attached pictures show the some of steps I go through to do this. 

The trouble comes when I attempt to create a new module.

Say I create a new module called "foo" (I go to structure view, right click on an existing module group > click add > > "new module"). This seems to get done correctly, and it creates the expected module in the project pane with a source root folder (in blue) called "src":

Then I right click the src folder and select "Java package". I then type "biz.bar.baz" and press enter. Once I do I get this:

 

That is, it collapses my packages into the src folder! I expected to see the blue "src" folder, then "bar.baz.biz" under it. This goes on when I create a new file as well: 

It treats the module and src directory as if they are packages! what's going on here? I tried this in a default empty project and it didn't do this.. I haven't tried messing with .iml files and would prefer not to (as these are for the IDE, as I understand it). So is there some intricacy to creating new modules in the context of the large "intellj-community" project that I'm missing here?

I can attach more details/pictures of the entire process I used as needed. Am I going crazy here?

 

0
9 comments

Please show the project structure dialog, it looks like the source root is set for the directory above src.

0

is this what you needed?

0

Check you did not set the package prefix by clicking on the P icon on the right of the src folder.

0

There is no package prefix set. 

0

It looks like some module specifies a directory above foo as the source root.

0

Right. I'm not sure though how I tell it not to do that :)

0

I just don't get it. It says my content root is "foo", and I've marked "src" as a source root. It's as if it's just treating "intellij-community" as my source root, even though I've set it to something else. 

Could it just be that the  source root setting capability is unimplemented? If so, I don't see how anybody could even edit code in the community edition sources. Indeed, if I go into another package (say, python) and add a new java file T.java into com.jetbrains, it correctly sets the package to "package com.jetbrains" in the created file. But whenever I were to try something similar, it would do: take "mypython.src.com.jetbrains" ... really puzzling.

0

O.k., I might've gotten it working? I'll update this once I figure out how I did it :)

0

Please sign in to leave a comment.