plugins/devkit/intellij.devkit.modules/README.md
This module provides a tool window for IntelliJ Platform projects that displays all JPS modules in the project, their source roots, and dependencies.
The Modules tool window allows developers working on IntelliJ Platform projects to:
The module registers a tool window with ID "Modules" that is anchored to the right side of the IDE. The tool window is created by the ModulesToolWindowFactory class and displays a ModulesPanel.
The module provides four services:
JpsModulesService
JpsModulesServiceJpsModulesServiceImplgetAllModules(): Gets all JPS modules for the project, sorted by namefindXmlFilesInModule(module): Finds plugin.xml and module XML files in a moduleXmlParserService
XmlParserServiceXmlParserServiceImplparsePluginXml(file): Parses a plugin.xml fileparseModuleXml(file): Parses a module XML fileModulesTreeModelService
ModulesTreeModelServiceModulesTreeModelServiceImplupdateModulesList(prefix): Updates the list of modules in the tree based on the current filterModulesTreeReferenceProvider
ModulesTreeReferenceProviderfindReferences(moduleNode, searchScope): Finds references to the specified module nodeassociateElementWithNode(element, moduleNode): Associates a PsiElement with a module nodeThe main UI component is the ModulesPanel class, which:
The module includes utility functions in JpsModelRoutines.kt for loading the JPS model from a project path.
intellij.devkit.modules/
├── resources/
│ └── intellij.devkit.modules.xml # Plugin configuration file
└── src/
└── toolwindow/
├── JpsModelRoutines.kt # Utilities for loading JPS model
├── JpsModulesService.kt # Service interface for JPS modules
├── JpsModulesServiceImpl.kt # Implementation of JpsModulesService
├── ModulesFindUsagesAction.kt # Action for finding usages of modules
├── ModulesPanel.kt # UI panel for displaying modules
├── ModulesToolWindowFactory.kt # Factory for creating the tool window
├── ModulesTreeFindUsagesHandlerFactory.kt # Factory for creating find usages handlers
├── ModulesTreeModel.kt # Model for the modules tree
├── ModulesTreeModelService.kt # Service interface for the tree model
├── ModulesTreeModelServiceImpl.kt # Implementation of the tree model service
├── ModulesTreeNavigator.kt # Navigator for the modules tree
├── ModulesTreeReferenceProvider.kt # Provider for finding references to modules
└── XmlParserService.kt # Service for parsing XML files
The Modules tool window is automatically available in IntelliJ Platform projects. To use it:
This module depends on:
IntelliJProjectUtil.isIntelliJPlatformProject)This module is developed by Junie. Contributions are welcome!