vaadin / intellij-plugin

Vaadin IntelliJ Plugin
Apache License 2.0
6 stars 1 forks source link

Add a command to retrieve all source roots of the project #142

Closed Artur- closed 3 weeks ago

Artur- commented 3 weeks ago

For copilot to be able to find/handle files in a multi module project, it needs to know where to look for sources. The command should return a list of all source folders (absolute path) so that all ”main” sources are first (most likely to contain what copilot is looking for) and then all ”test” source folders

MarcinVaadin commented 3 weeks ago

It can be achieved using:

ModuleManager.getInstance(project).modules.forEach { module: Module ->
   val moduleRootManager = ModuleRootManager.getInstance(module)
   moduleRootManager.getSourceRoots(JavaSourceRootType.SOURCE)
   moduleRootManager.getSourceRoots(JavaSourceRootType.TEST_SOURCE)    
}