redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 440 forks source link

Expect that intellisense can work in java file which is in root folder of multi-modules project #3601

Open yuyully opened 6 months ago

yuyully commented 6 months ago
Environment
Steps To Reproduce
  1. Open https://github.com/redhat-developer/vscode-java/tree/master/test/resources/projects/maven/multimodule
  2. Create a new java file in root folder
Current Result

Currently intellisense (such as class, main) doesn't work in java file which is in root folder of multi-modules project.

Expected Result

Expect that intellisense can work in java file which is in root folder of multi-modules project.

rgrunber commented 6 months ago

Since it's a Maven project, the pom files need to be configured to support this and the import will respect it. Currently that project is configured with only the default source locations of src/main/java and src/test/java for each sub-module.

Note : It should be possible to open a source file and have intellisense working if the file is external to the project.