-
Notifications
You must be signed in to change notification settings - Fork 50
Extract content module resolution to separate classes #1286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
novotnyr
merged 21 commits into
master
from
extract-content-module-resolution-to-classes
Jun 2, 2025
Merged
Extract content module resolution to separate classes #1286
novotnyr
merged 21 commits into
master
from
extract-content-module-resolution-to-classes
Jun 2, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This refactoring extracts content module resolution out of PluginCreator
and IdePluginManager
into dedicated classes, and updates the IdePlugin
API to include content module tracking.
- Introduced
ContentModuleLoader
,ModuleDescriptorResolver
(plusFileBasedModuleDescriptorResolver
andInlineModuleDescriptorResolver
), andContentModuleLoadingResults
to handle module resolution. - Updated
IdePlugin
,IdePluginImpl
,InvalidPlugin
,IdeModule
, and test mocks to include a newcontentModules
property. - Revised tests (
InlineModuleTest
,PluginCreatorTest
) to validate content module collection after resolution.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/src/test/kotlin/.../MockIdePlugin.kt | Added contentModules property and import to the mock plugin. |
tests/src/test/kotlin/.../InlineModuleTest.kt | Added assertions on plugin.contentModules . |
structure-intellij/src/test/.../PluginCreatorTest.kt | Updated test to use pluginCreator.plugin.contentModules . |
structure-intellij/src/main/java/.../ModuleDescriptorResolver.kt | New abstract base class for module descriptor resolution. |
structure-intellij/src/main/java/.../InlineModuleDescriptorResolver.kt | New implementation for inline module descriptors. |
structure-intellij/src/main/java/.../FileBasedModuleDescriptorResolver.kt | New implementation for file-based module descriptors. |
structure-intellij/src/main/java/.../ContentModuleLoadingResults.kt | New data structure collecting resolved modules and errors. |
structure-intellij/src/main/java/.../ContentModuleLoader.kt | New loader coordinating resolution via resolvers. |
structure-intellij/src/main/java/.../PluginCreator.kt | Removed inline resolution code and switched to use contentModules . |
structure-intellij/src/main/java/.../InvalidPlugin.kt | Added contentModules property to invalid-plugin implementation. |
structure-intellij/src/main/java/.../IdePluginManager.kt | Replaced inline resolution logic with ContentModuleLoader . |
structure-intellij/src/main/java/.../IdePluginImpl.kt | Added mutable contentModules list and cloning behavior. |
structure-intellij/src/main/java/.../IdePlugin.kt | Added contentModules property to the IdePlugin interface. |
.../src/main/java/com/jetbrains/plugin/structure/intellij/plugin/loaders/ContentModuleLoader.kt
Outdated
Show resolved
Hide resolved
.../src/main/java/com/jetbrains/plugin/structure/intellij/plugin/loaders/ContentModuleLoader.kt
Show resolved
Hide resolved
...intellij/src/test/kotlin/com/jetbrains/plugin/structure/intellij/plugin/PluginCreatorTest.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Untangle content modules resolution from
PluginCreator
.This is a refactoring; no new functionality is introduced.
IdePlugin
now keeps track of content-module references. See thecontentModule
property.PluginCreator
no longer keeps track of content modules. This is now the responsibility ofIdePlugin
.ContentModuleLoader
, which delegates content-module resolution to one of two implementations: file-based or inline CDATA modules.ModuleDescriptorResolver
, which resolves a nested content module to an actual, type-safeIdePlugin
class.FileBasedModuleDescriptorResolver
for content modules with external descriptors, andInlineModuleDescriptorResolver
for module descriptors declared in inline CDATA.ContentModuleLoadingResults
, containing successfully resolved content modules and failures (mapped toPluginProblem
s).