-
Notifications
You must be signed in to change notification settings - Fork 50
Reenable download of optional nonbundled dependencies #1294
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
Conversation
6e4248e
to
31c9f5e
Compare
… performance improvement
31c9f5e
to
5e663b0
Compare
Structure library extracts the ZIP. This process is repeated in Plugin Verification. Reuse the intermediate extracted directory
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
Re-enable download of optional non-bundled dependencies, add ZIP plugin resource caching, and extend plugin/provider APIs for module-based lookup.
- Bridge between IntelliJ Structure’s
PluginProvider
and Plugin Verifier’sDependencyFinder
for dependency downloads. - Introduce
PluginResourceCache
to cache and reuse extracted ZIP plugin directories. - Extend
PluginProvider
/PluginQuery
with module-ID search,findPluginByIdOrModuleId
,containsPlugin
, and addCompositePluginProvider
.
Reviewed Changes
Copilot reviewed 68 out of 68 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
EmptyPluginResourceCache.kt | No-op implementation of PluginResourceCache . |
PluginQuery.java | Add searchContentModuleId flag, builder method, and update toString() . |
PluginProvision.kt | Add CONTENT_MODULE_ID source and override toString() for better messaging. |
PluginProviderResult.java | Introduce result wrapper with resolution Type enum (PLUGIN/MODULE). |
PluginProvider.java | Add findPluginByIdOrModuleId , containsPlugin , and getPresentableName . |
PluginCreator.kt | Track and propagate ZipPluginResource instances and delete them on failure. |
InlineDeclaredModuleV2Dependency.kt | Correct isModule flags and refine toString() wording. |
IdePluginManager.kt | Refactor ZIP extraction flow with deleteExtractedDirectory flag and resource cleanup. |
CompositePluginProvider.kt | Implement multi-source lookup for both plugin ID and module ID. |
IdePluginClassesFinder.kt | Integrate PluginResourceCache to reuse extracted plugin directories. |
ClassSearchContext.kt | Encapsulate cache and extract directory in a search context. |
BundledPluginClassesFinder.kt | Pass ClassSearchContext to IdePluginClassesFinder . |
PluginQueryMatcher.kt | Match searchContentModuleId in IDE-side query logic. |
Ide.java | Delegate module-ID lookup via PluginProviderResult and add helper methods. |
CachingPluginDependencyResolverProvider.kt | Parameterize IDE module predicate/dependencies modifier and simplify resolver creation. |
DelegatingResolver.kt | Add DelegatingNamedResolver for lazy delegate initialization. |
Jar.kt | Catch NoSuchElementException to throw clearer JarArchiveException . |
Deletable.kt | Add Deletable interface for resource cleanup. |
BasePluginProblem.kt | Fix minor grammar in Javadoc. |
PluginCreationResult.kt | Extend success result with closeable resources list. |
Comments suppressed due to low confidence (2)
intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/CompositePluginProvider.kt:35
- The implementation of findPluginByIdOrModuleId does not return the result of the let expression. Each call creates a PluginProviderResult but it’s never returned. Add
return
before the provider lookup so found results are actually returned.
provider.findPluginById(pluginIdOrModuleId)?.let { PluginProviderResult(PLUGIN, it) }
intellij-plugin-structure/structure-intellij/src/main/java/com/jetbrains/plugin/structure/intellij/plugin/IdePluginManager.kt:159
- The variable
plugin
is not defined in this scope. You likely intended to pass theIdePlugin
instance managed by the PluginCreator. Update this reference to use the correct variable (for example,this.plugin
or a properly named variable from the surrounding context).
resources += ZipPluginResource.of(pluginFile, extractedDir, plugin)
Dependency Download
DefaultClassResolverProvider
is able to download missing plugin dependencies even when theDependencyTree
is used.DependencyFinderPluginProvider
as a bridge betweenPluginProvider
from the IntelliJ Structure library andDependencyFinder
from the Plugin Verifier library. This allows to download dependencies via JetBrains Marketplace or local caches.DefaultPluginDetailsProvider
has a flag whether to provide missing dependencies from other sources.ZIP-based Plugin handling
OptionalDependencyResolver
can extract ZIP plugins and retain their extracted directories as a file-system cache for further processing of classpaths.Let
PluginCreator
maintain additional resources that can be closed. This is used for extracted ZIP archives.Let
PluginCreationResult
carry additional resources that can be closed. This is used for extracted ZIP archives.DefaultPluginDetailsProvider
is now stateful as it collects extracted directories of ZIP plugins that were downloaded from JetBrains Marketplace.Make
DefaultPluginDetailsProvider
stateful. For ZIP plugins, reuse their extracted directories as a plugin construction sources.Introduce
PluginResourceCache
that is able to maintain a list of extracted directories corresponding to ZIP archives. IntelliJ Structure and IntelliJ Plugin Verifier will share this cache in order toclasspath
point to real files in the filesystemThis cache is used in all places when plugin is scanned for classes.
Plugin and Module resolution
CachingPluginDependencyResolverProvider
is updated with an ability to decide if a plugin is an IDE moduleCachingPluginDependencyResolverProvider
is updated with an ability to augment list of dependencies. This is used to contribute Java module for legacy plugins.Ide
is able to provide plugin or module by ID and indicate the source of this provision.CompositePluginProvider
for searching in multiple providers.PluginProvider
now provides a method to find plugin by ID or module ID. Since the semantics can be complex, an exact source of the plugin is provided.PluginProvider
now provides a method to indicate if a plugin with a specified ID is present.BundledPluginDependencyFinder
to consult an IDE instance for bundled plugins.Optimizations
DependencyTree
mechanism has been optimized to prevent unnecessary resolution of plugins or modules.DependencyTree
is able to distinguish between plugins or modules by an external predicate.LegacyPluginDependencyContributor
to consult an IDE instance for Java module.