-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project tree shows confusing directory structure #437
Comments
I believe this is an upstream bug with IntelliJ. If you import that exact same project as a plain IntelliJ project (without the bazel plugin) does it still occur? |
@brendandouglas If I import it as a regular IntelliJ project (without the bazel plugin) then I get the following "Project" tree: |
I don't mean importing from scratch, but importing the exact project created by the bazel plugin, but with the bazel plugin disabled (you should see a 'Required plugins weren't loaded' error). When I do that, and check 'compact empty middle packages' (the source of this problem), I see all main/test files and directories disappear, except src/main/resources/dummy.txt |
So there's an upstream bug and/or a bug with the project definition written by the bazel plugin. The project definition looks valid to me, so this appears to be an upstream bug. |
@brendandouglas Okay, so, a workaround for this issue is to disable "compact empty middle packages". I can confirm that this produces the expected project tree. I've tested loading the project with the Bazel plugin disabled, and as you say the
I'm afraid, I don't know enough about IntelliJ to make that judgement. Could I ask you to file an issue for this upstream? I'm happy to provide additional information if required. |
@aherrmann if you check in the project definition, and point to that in an upstream ticket it should be enough to go on. |
If you can write here the issue we’d love to follow it as we have the same
problem
…On Sun, 11 Nov 2018 at 17:07 brendandouglas ***@***.***> wrote:
@aherrmann <https://github.com/aherrmann> if you check in the project
definition, and point to that in an upstream ticket it should be enough to
go on.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#437 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF4PtzeUSxEB9nHNHZ27MeHfyppWoks5uuD05gaJpZM4YSb4z>
.
|
Thanks for tracking it down. That still seems like a bug in IntelliJ. What if this test project actually had nested source directories? |
Conceptually, having nested source directories doesn't make much sense for a conventional maven-like project structure. Multiple source directories that don't overlap is fine (e.g. |
I agree it wouldn't be common, and we should stop marking the root directories as source roots by default. |
if you'll "stop marking the root directories as source roots by default"
what will you mark as source roots? How will we mark source roots?
…On Tue, Nov 13, 2018 at 9:48 PM brendandouglas ***@***.***> wrote:
I agree it wouldn't be common, and we should stop marking the root
directories as source roots by default.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#437 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF_HMIePqS-qkC1YrLM3j7KUT6j2Qks5uuyIogaJpZM4YSb4z>
.
|
Marking the root directory as a source root regardless of its contents was a hack (which happened to make sense internally). We also detected source roots during sync by looking for java-like sources built by bazel targets in the project, and checking their package path using a set of heuristics (up to actually reading the file contents via our aspect). You shouldn't notice any regression when the release after next lands, or need to manually mark source roots. |
Awesome, thanks!
…On Wed, 14 Nov 2018 at 16:41 brendandouglas ***@***.***> wrote:
Marking the root directory as a source root regardless of its contents was
a hack (which happened to make sense internally). We also detected source
roots during sync by looking for java-like sources built by bazel targets
in the project, and checking their package path using a set of heuristics
(up to actually reading the file contents via our aspect
<https://github.com/bazelbuild/intellij/blob/194f34b0690827918356eab5ae84fe85c8f6c50c/aspect/tools/src/com/google/idea/blaze/aspect/PackageParser.java>
).
You shouldn't notice any regression when the release after next lands, or
need to manually mark source roots.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#437 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF8Yljs9LsQEZNsH8MTQvaDhFqI-aks5uvCu0gaJpZM4YSb4z>
.
|
Sounds great, thanks! |
IntelliJ shows a confusing picture of the directory structure in the project tree pane.
Example 1
The following directory tree
is shown like this:
I.e. the
test
directory is omitted, and it is not obvious where the lowerscala
folder belongs to.I would expect the project tree to match the actual directory structure.
Example 2
The following directory tree
is shown like this:
I.e. the
main
andtest
directories are omitted. It is not obvious where the two "floating"scala
folders belong to.I would expect the project tree to match the actual directory strucuture.
Version information
IntelliJ:
Bazel plugin:
A full reproduction of this issue is available here: https://github.com/aherrmann/reproduce-intellij-project-view-issue
The text was updated successfully, but these errors were encountered: