KEMBAR78
Extract content module resolution to separate classes by novotnyr · Pull Request #1286 · JetBrains/intellij-plugin-verifier · GitHub
Skip to content

Conversation

novotnyr
Copy link
Collaborator

@novotnyr novotnyr commented May 31, 2025

Untangle content modules resolution from PluginCreator.

This is a refactoring; no new functionality is introduced.

  • IdePlugin now keeps track of content-module references. See the contentModule property.
  • PluginCreator no longer keeps track of content modules. This is now the responsibility of IdePlugin.
  • Introduce ContentModuleLoader, which delegates content-module resolution to one of two implementations: file-based or inline CDATA modules.
  • Introduce ModuleDescriptorResolver, which resolves a nested content module to an actual, type-safe IdePlugin class.
  • Add two implementations: FileBasedModuleDescriptorResolver for content modules with external descriptors, and InlineModuleDescriptorResolver for module descriptors declared in inline CDATA.
  • Introduce ContentModuleLoadingResults, containing successfully resolved content modules and failures (mapped to PluginProblems).

@novotnyr novotnyr requested a review from Copilot May 31, 2025 00:57
Copy link
Contributor

@Copilot Copilot AI left a 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 (plus FileBasedModuleDescriptorResolver and InlineModuleDescriptorResolver), and ContentModuleLoadingResults to handle module resolution.
  • Updated IdePlugin, IdePluginImpl, InvalidPlugin, IdeModule, and test mocks to include a new contentModules 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.

novotnyr and others added 2 commits May 31, 2025 10:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@novotnyr novotnyr marked this pull request as ready for review May 31, 2025 08:42
@novotnyr novotnyr merged commit 528fd5f into master Jun 2, 2025
2 checks passed
@novotnyr novotnyr deleted the extract-content-module-resolution-to-classes branch June 2, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant