Plugin Model Analyzer 是 IntelliJ 平台仓库中的 Product DSL 分析工具,用于查询模块、产品、插件图、加载规则、校验及打包相关信息。它通过 Bazel 运行,不再使用已废弃的 PluginModelAnalyzer MCP 服务。
使用方式:在仓库根目录执行 bazel run --ui_event_filters=-info --noshow_progress //platform/buildScripts:plugin-model-tool -- --json='<request-json>'。输出为带时间戳的 JSON,并包含一个以请求过滤器命名的结果属性。
请求以小型、带类型的 JSON 描述,避免不加过滤的 --json(会输出完整模型,通常过大)。可用短请求 --json='{...}'、标准输入 --json=- 或文件 --json=@路径 传输。JSON 字段包括 filter、module、moduleSet、product、product2、name、location、usesModuleSet、modules、fromModule、toModule、source、target 等选择器,以及 operation、graph、check、loading、strategy、limit、details、threshold 等选项。
常见能力:模块概览(moduleInfo)、模块依赖与依赖路径(moduleDependencies、dependencyPath)、模块归属(moduleOwners)、模块集与产品查询(moduleSetQuery、productQuery)、产品对比与追踪路径(productCompare、productTracePath)、嵌入依赖闭包(embeddedDependencyClosure)、合并或内联影响(mergeImpact)、校验与加载检查(validation、moduleLoading)、重构候选(moduleSetOverlap、productSimilarity、unificationSuggestions、redundantModuleSetRefs、suggestModuleSetsForModules)、废弃 xi:include(deprecatedIncludes)等。旧 MCP 操作名可映射为对应 JSON 请求。
适用场景包括排查模块被何处包含、依赖关系及原因、模块归属、产品与模块集使用情况、模块能否取消嵌入、Product DSL 编辑是否引入放置或加载问题、模块应归属哪个模块集等。
限制:先使用 summary、moduleInfo、moduleSetQuery、productQuery 探索,并用 details:false 和较小 limit;聚焦查询可能返回 error 字段,进程成功退出不一定表示匹配成功;命令在输出 JSON 前失败时以 stderr 为准,无效 JSON 请求以非零退出。location 值为 COMMUNITY 或 ULTIMATE,loading 值为 EMBEDDED、REQUIRED、OPTIONAL、ON_DEMAND 或 UNSPECIFIED。