KEMBAR78
Query plugin provider for plugin by explicit attributes by novotnyr · Pull Request #1288 · JetBrains/intellij-plugin-verifier · GitHub
Skip to content

Conversation

novotnyr
Copy link
Collaborator

@novotnyr novotnyr commented Jun 6, 2025

Semantics of findPluginByModule in PluginProvider is historically unclear. In this class, module might be a plugin alias or a content module ID.

Add an additional method that allows to query plugins by searching in an explicit places:

  • plugin identifier
  • plugin name
  • plugin aliases

@novotnyr novotnyr requested a review from Copilot June 6, 2025 07:31
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 the plugin querying mechanism by adding a new method to query plugins via explicit criteria (plugin identifier, plugin name, and plugin aliases) and updating related classes and tests accordingly.

  • Added tests for the new query functionality in IdePluginProviderTest.kt
  • Introduced a PluginQuery builder and corresponding matcher in PluginQuery.java and PluginQueryMatcher.kt
  • Updated the PluginProvider interface and Ide class to support the new query method

Reviewed Changes

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

Show a summary per file
File Description
intellij-plugin-structure/tests/src/test/kotlin/com/jetbrains/plugin/structure/domain/IdePluginProviderTest.kt Introduces tests for resolving plugins by ID, name, and alias
intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/PluginQuery.java Adds a builder-based API for specifying query parameters
intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/PluginProvision.kt Defines a sealed class representing the result of a plugin query
intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/PluginProvider.java Updates the interface to include the new query method
intellij-plugin-structure/structure-ide/src/main/java/com/jetbrains/plugin/structure/ide/PluginQueryMatcher.kt Implements matching logic between a plugin and a PluginQuery
intellij-plugin-structure/structure-ide/src/main/java/com/jetbrains/plugin/structure/ide/Ide.java Integrates the query matcher and refactors the plugin identification logic
Comments suppressed due to low confidence (1)

intellij-plugin-structure/structure-ide/src/main/java/com/jetbrains/plugin/structure/ide/PluginQueryMatcher.kt:13

  • When multiple search criteria flags are enabled in PluginQuery, only the first matching condition is considered. Consider adding validation to ensure only one flag is set or document the precedence to avoid ambiguity.
fun matches(plugin: IdePlugin, query: PluginQuery): PluginProvision {

@novotnyr novotnyr changed the title Query plugin provider Query plugin provider for plugin by explicit attributes Jun 6, 2025
@novotnyr novotnyr merged commit 6e0b772 into master Jun 6, 2025
2 checks passed
@novotnyr novotnyr deleted the query-plugin-provider branch June 6, 2025 07:36
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