实现或修改 IntelliJ `AnAction`,并在 `plugin.xml` 中注册。将显示名称和说明写入消息资源文件,按需设置图标,并通过事件协程作用域启动挂起任务,避免同步处理阻塞 IDE。
- 为 IDE 菜单添加操作
- 修改操作注册或图标
- 整理操作名称和说明
将 IntelliJ JPS 测试模块迁移到 Bazel,并排查仅在 Bazel 中出现的失败。根据症状检查依赖、插件、测试数据和 runfiles,重新生成并验证目标。
Migrate IntelliJ JPS module tests to Bazel; debug Bazel-only failures.
实测评分 未实测
查看安装方法本指南介绍如何将 IntelliJ JPS 测试模块迁移到 Bazel,并排查只在 Bazel 环境中出现的失败。流程包括确认实际测试模块和 Bazel 标签、以 .iml 作为依赖依据、重新生成 BUILD.bazel,并用计划运行的目标进行验证。指南还按常见症状指出需要检查的位置,例如编译期依赖缺失、运行时找不到类或资源、插件注册、测试数据以及 runfiles。对于 TeamCity 上变慢或超时的测试,也说明如何定位最先出现的耗时操作。可以先运行范围最小的失败测试,再验证整个迁移目标。
迁移现有 JPS 测试模块、调查仅在 Bazel 中失败的测试,或确认迁移是否完成时,可以参考本指南。它也适用于检查依赖、插件和测试数据配置。
迁移和验证步骤需要使用 Bazel 命令及仓库中的构建脚本。指南建议不要通过排除测试或修改断言来掩盖失败。
本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。
AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。
不计入评分。 由 AI(OpenAI Codex)于 2026年10月28日 评估。仅供参考,安装前请同时查看原文。
安装前可以查看交给 AI 代理的指令内容。
Use this skill when switching an IntelliJ JPS test module to Bazel, fixing a Bazel-only test failure, or reviewing migration wiring.
Identify the real test module and Bazel label.
@community//....//....Treat .iml as the source of truth.
.iml first.scope="TEST" for new test-only dependencies.RUNTIME only when the dependency must be present as a runtime plugin/resource/classpath entry and TEST is not enough.BUILD.bazel sections except for intentionally custom jps_test sections protected by ### skip generation section.Regenerate after every .iml or BUILD.bazel metadata change.
community/tools/bun.cmd build/jps-module.mjs register path/to/module.iml --fix-iml-eof
./build/jpsModelToBazel.cmd
./bazel.cmd test --cache_test_results=no @community//path/to/package:target_test
For a community-only module in a standalone community checkout, run the same package as //path/to/package:target_test.
jps_test sections at the top when a module already needs custom test options.### skip generation section `test module.name`
tags, timeout, env, jvm_flags, and data.community/build/bazel-migrated-test-modules.txt only after the target is fully migrated and verified. The community JPS aggregator then skips the module, and tests.cmd refuses it. The file documents its format.copy_file to patch missing jars or descriptors into runfiles. Prefer normal .iml dependencies, target runtime/data dependencies, or the existing shared mechanism for that class of test.Use the smallest dependency that matches what failed:
.iml.jps_test.data or ensure the existing generator includes it; do not rely on source-tree paths under Bazel.Before changing tests, verify whether the failure is really a test assertion issue or just missing runtime/plugin/testdata wiring.
Check that test classes are in the generated *_test_lib, the Bazel target points to that test library, and the class names match the runner convention. If the module truly has no tests, there may be nothing to migrate.
Search for the extension/action/inspection id and identify the descriptor that registers it. Add the owning plugin/module dependency. Do not manually register production extensions in test setup unless the test is explicitly about a local fake extension.
Example: an action registered into EditorGutterVcsPopupMenu needs the VCS implementation descriptor that owns that group, not just VCS API classes.
If plugin A registers an action into a group contributed by plugin/module B, plugin A must depend on B or move the action registration into a B-aware optional/content descriptor. Fix the descriptor dependency when production loading is also inconsistent; fix the test dependency only when the test product intentionally omits an otherwise valid product plugin.
When integration tests invoke JPS compilation, failures like missing JPS jars or compile-server plugin classpaths usually mean Bazel runfiles cannot resolve a plugin/module path the same way JPS does.
If code expects Bazel-only properties such as target mappings or runfiles metadata, pass them through the jps_test target using the established option (jvm_flags, env, or data) and add the backing file to runfiles.
Re-check labels, repo mappings, and generated runfiles. A target can pass as @community//... from Ultimate and fail as //... in standalone community if the test relies on parent-repo runfiles or missing repo mapping.
Look for the first expensive operation under Bazel: indexing, plugin loading, coroutine dispatch, first service initialization, or filesystem/runfiles traversal. Prefer moving one-time initialization to setup or making the test wait for the actual condition. Avoid raising timeouts as the first fix.
Keep test edits minimal.
BUILD.bazel.idea.log, test.log, and JUnit XML if present..iml files.runtime_deps, deps, data, env, and jvm_flags..iml or plugin descriptors.--cache_test_results=no.git diff --check before finishing.A module is migrated only when:
--cache_test_results=no;BUILD.bazel matches .iml;还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
实现或修改 IntelliJ `AnAction`,并在 `plugin.xml` 中注册。将显示名称和说明写入消息资源文件,按需设置图标,并通过事件协程作用域启动挂起任务,避免同步处理阻塞 IDE。
按 IntelliJ 项目规范编写或审查 Kotlin 和 Java 代码,涵盖语言选择、格式、密封类型、线程注解及控制流异常处理。
本指南帮助您按 IntelliJ 项目规则拆分更改并撰写提交信息:有工单时使用编号和变更说明,无工单时使用标签与子系统名,并在需要时说明原因和决定。
使用多个 Python 类型检查器比较代码片段或文件的类型推断和报错判断,并汇总各工具的结论、耗时与诊断信息,可保存为 Markdown 报告。
整理 Compose Desktop 界面中的状态和副作用,让可组合函数负责绘制,由展示器或协调器处理应用决策。了解状态归属、Effect、可复用组件接口、延迟列表键、动画和性能,适用于单项界面修改。
审查 Compose Desktop 界面代码的架构和运行时问题,检查状态管理、副作用、协程、延迟列表、动画与重组,并按优先级列出发现。