-
Notifications
You must be signed in to change notification settings - Fork 57
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
'Go To Type ' not working for srcDirs with include #421
Comments
I have tried this and I'm not experiencing the same issue. Do you have a sample project to try this with? |
You can find a sample project here. |
I'm assuming this has something to do with the modules. Does it happen if you disable modules in the project properties? (Java Modules/Allow Modules) |
Since disabling modules is a bit of a hack, you might want to restart NB after that. |
I updated to the latest plugin version and disabled the java modules globally. But as the project is only JDK8, that had no effect. It's still not working. I checked the logs and found these entries:
The rest of the logs looks unsuspicious |
Does "/SOME_PATH/nb-gradle-test/a/" actually exist? Can you still try disabling modules to check if there is really nothing because of that (to check if the module support does not create a problem in your case for some weird reason)? |
The path "/SOME_PATH/nb-gradle-test/a/" does exist. It's an empty folder which exists for each of the submodules. Java 9 modules have been disabled in global settings and NB was restarted. The issue still persists. |
I'm not sure because it works for me fine. Have you tried removing the NB cache? |
Yes I tried all of that. I removed the nb cache as well as the .gradle folder and the .nb-gradle settings file. I also tried it with NB 8.2 - 10.0. Can you please try to add a new class to one of the subprojects. That should break the demo project for sure. |
Hmmm, now I can reproduce it in NB 8.2 (without adding new classes) but not in 10. I'll try to find out what might be happening. |
The NB repo says its temporary unavailable, so I can't build the plugin for 8.2 at the moment. I'll check it tomorrow. |
I think I know what the issue is (not 100% because I didn't track down the issue to what actually happening in NB). That is, this is the problem: Your project has the same source root (regardless that it is distinctly filtered) for multiple projects and this confuses NB, because NB requires ownership for files and dirs, and now multiple projects provides source roots with the same root. So, the ownership is ambigous, and can (and does) confuse NB completely. I don't think this is fixable, because this is such an integral part of the NB infrastructure. So, I recommend you not share source root between projects if possible but if you need it shared then have a 3rd project which includes both (this I have done with buildSrc, and should work). |
That solves the issue although I don't like to have IDE specific settings in the gradle files especially when working in a team where different iDEs are in use. But that's at least better than being forced to switch to eclipse. Thanks for your help. |
You can always use an init script and pass an afterEvaluate there (you can check for some properties, if you are in the right build, or check for the presence of an excluded build script, and apply that). |
I was looking into that but did not find a reliable way to add an addition subproject from the init.gradle without any modifications to the project gradle files. Any hints would be appreciated. |
I have a multi-module project which has only one src directory for all subprojects. The srcDirs then use an include to select the correct packages:
This works as far as all packages, that are not included, are empty in the project view. Java files in included packages are correctly shown in the project view.
If I try to open a class that I can clearly see in the project view via "Go To Type", the class is not found. This also affects imports of classes from the same subproject. The imports are highlighted with "package not found".
The text was updated successfully, but these errors were encountered: