Projects

A Metaborg project can contain source files written in Metaborg languages. Such projects are represented by classes derived from the IProject interface. In the IDEA plugin this is the IdeaProject class, but in the JPS plugin this is the MetaborgJpsProject class.

A Metaborg language specification defines a new language. Such projects are represented by IdeaLanguageSpec (IDEA) and JpsLanguageSpec (JPS), both of which derive from the ISpoofaxLanguageSpec interface, which indirectly derives from IProject.

Additionally, there is the ArtifactProject for language artifacts.

Modules

IntelliJ IDEA uses the concept of modules, which are similar to projects in Eclipse. To get the Metaborg project that corresponds to a module, use the IIdeaProjectService methods (in IDEA), or the IJpsProjectService (or JPS) methods.

An IntelliJ module lives in a project, which corresponds to a workspace in Eclipse. And projects live in the application, which is application-wide.

A module has so-called content roots: folders that hold the content of the module. A simple module just has the module’s root folder as a content root, but a more complex module might have several content roots from all over the place. A single file may belong to multiple modules.

Module Type

A language specification project is represented in IntelliJ IDEA as a module with the MetaborgModuleType. Such a module is created and managed by the MetaborgModuleBuilder. Its setupRootModel() method is responsible for setting up the module and creating its files.