Eclipse and Jigsaw modules
See also: bug 479483 - [1.9] Define what is Module in Eclipse
- A module (binary/source) in Eclipse is represented by an IPackageFragmentRoot. (Note: It will be represented by others too, for e.g. ClasspathEntry, ClasspathDirectory etc. depending on the context)
- API: IPackageFragmentRoot#isModule. (Note: Clearly this API needs rethinking. Perhaps it should denote whether or not it is a named module)
- Binary modules (as JARs): Above API returns true for ModulePackageFragmentRoot
- Source modules (as source folders):
- What is the criterion for a source folder to be a module (for the API to return true)? - Presence of module-info.java file in it?
- If some source folder in a project does not contain a module-info.java file, is it considered as an "unnamed module"?
- In that case, will the API return true for all source folders? Then, how do we differentiate between named and unnamed modules via API, or we don't need to?
- Can we have multiple source folders in a project, each having its own module-info.java file? Hence, having multiple modules in a project.
- How to create a module-info.java file in a source folder?
1) File > New > File > Select the source folder and create file.
2) A new option on "New Source Folder" dialog to create it along with the source folder? (Similar to package-info.java on "New Java Package" dialog.)
- Place the module-info.java file in the default package of that source folder.
- The file will have the normal "J" icon of a .java file.
Functionality required in module-info.java editor
- Content assist for keywords, modules, types etc.
- Syntax coloring for keywords, modules, types etc.
- Mark occurrences
- Javadoc hover on type names
- Navigation (Ctrl+click) to types