KEMBAR78
Inline content module dependencies explicitly indicate plugin or module by novotnyr · Pull Request #1289 · JetBrains/intellij-plugin-verifier · GitHub
Skip to content

Conversation

novotnyr
Copy link
Collaborator

@novotnyr novotnyr commented Jun 6, 2025

Inline content module dependencies have explicit indication of plugin or module.

Split the InlineDeclaredModuleV2Dependency into sealed class hierarchy:

  • Plugin for <plugin> dependency in inline CDATA content module <dependencies> element
  • Module for <module> dependency in inline CDATA content module <dependencies> element

Adjust the resolution mechanism as well.

@novotnyr novotnyr requested a review from Copilot June 6, 2025 16:24
Copilot

This comment was marked as outdated.

@novotnyr novotnyr requested a review from Copilot June 6, 2025 16:40
@novotnyr novotnyr changed the title Inline content module dependencies have explicit indication of plugin or module Inline content module dependencies explicitly indicate plugin or module Jun 6, 2025
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 PR refactors inline content module dependencies to explicitly distinguish between plugin and module references and updates the resolver accordingly.

  • Splits InlineDeclaredModuleV2Dependency into two sealed subclasses (Plugin and Module) with distinct toString formats and factory methods.
  • Adjusts InlineModuleDescriptorResolver to map PluginV2Dependency and ModuleV2Dependency to the new subclasses.
  • Adds and updates tests to cover both inline plugin and module dependency cases.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
intellij-plugin-structure/tests/src/test/kotlin/com/jetbrains/plugin/structure/intellij/plugin/InlineDeclaredModuleV2DependencyTest.kt Replaced of factory with onPlugin, added onModule test.
intellij-plugin-structure/structure-intellij/src/test/kotlin/com/jetbrains/plugin/structure/intellij/plugin/module/InlineModuleDescriptorResolverTest.kt Added tests for resolver picking plugin vs. module dependencies.
intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/module/InlineModuleDescriptorResolver.kt Changed dependency mapping to a when on PluginV2Dependency/ModuleV2Dependency.
intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/InlineDeclaredModuleV2Dependency.kt Refactored into sealed class with Plugin and Module data subclasses and new factory methods.
Comments suppressed due to low confidence (3)

intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/InlineDeclaredModuleV2Dependency.kt:56

  • [nitpick] The nested subclass name 'Module' shadows the imported Module type and may cause confusion. Consider renaming this subclass to something like ModuleDependency to avoid ambiguity.
data class Module(

intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/InlineDeclaredModuleV2Dependency.kt:82

  • The onPlugin factory method takes a PluginId while onModule takes a String. For consistency and clarity, use the same type for both IDs (e.g., String) or clearly alias/convert between them.
fun onPlugin(

intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/module/InlineModuleDescriptorResolver.kt:132

  • The else -> it branch allows unsupported PluginDependency types to pass through silently. Consider filtering or explicitly handling only the expected types to prevent unintended dependencies from slipping into the result.
dependencies += when (it) {

@novotnyr novotnyr merged commit c00e9c0 into master Jun 6, 2025
2 checks passed
@novotnyr novotnyr deleted the inline-content-module-deps branch June 6, 2025 16: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