实现或修改 IntelliJ `AnAction`,并在 `plugin.xml` 中注册。将显示名称和说明写入消息资源文件,按需设置图标,并通过事件协程作用域启动挂起任务,避免同步处理阻塞 IDE。
- 为 IDE 菜单添加操作
- 修改操作注册或图标
- 整理操作名称和说明
实现或调试 Kotlin、Java 的 JNA 绑定时,核对原生声明、字段顺序、对齐方式、调用约定和资源所有权。还可用 JVM 测试发现布局与反射问题,再进行原生集成测试。
Implement or debug JNA bindings and ABI layouts in Kotlin or Java.
实测评分 未实测
查看安装方法本技能协助实现和调试从 Kotlin 或 Java 调用原生 API 的 JNA 绑定。它建议先检查 JNA Platform 和仓库中已有的映射,若其中类型与原生声明相符,就优先复用。内容包括结构体字段顺序、整数和指针宽度、对齐方式、调用约定、回调与原生内存的生命周期,以及如何按 ABI 定义映射。指南还说明哪些映射类和字段必须对 JNA 反射可见,以及如何保留和检查异常的完整原因链,以便定位问题。
新建原生库连接,或排查结构体大小不匹配、字段访问异常、回调故障时,可以使用本技能。在运行依赖原生界面、权限、硬件或特定操作系统的集成测试之前,也可以先编写 JVM 布局回归测试。
IllegalAccessException 的原因并提出修复办法。”Structure 的大小。”需要核对原生声明、目标架构和所有权规则。依赖权限、硬件或操作系统的原生集成测试,应与布局测试分开处理。
本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。
AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。
不计入评分。 由 AI(OpenAI Codex)于 2026年10月28日 评估。仅供参考,安装前请同时查看原文。
安装前可以查看交给 AI 代理的指令内容。
Treat every mapping as an ABI contract. Verify the native declaration, target architectures, and ownership rules before changing Kotlin or Java code.
Search JNA Platform and the repository before declaring a native type. Prefer a maintained platform mapping when its field types, alignment, and calling convention match the target API.
JNA reflects mapped classes and fields while deriving layouts and invoking callbacks. Make every Structure, Union, callback, and related declaring class JVM-accessible from com.sun.jna:
internal or public mapped classes; never use private, local, or anonymous mapped classes.@JvmField.IllegalAccessException from Structure.getFieldValue.Prefer moving visibility only as far as needed over suppressing reflection errors or opening accessibility globally.
@Structure.FieldOrder.size_t, native booleans, wide strings, and platform-dependent numeric types deliberately. Do not infer their size from Kotlin or Java names.Structure.ByValue; model pointers separately with Pointer or the appropriate reference type.read() and write() at the required ownership boundary.Add a small JVM regression test that constructs each mapped structure and calls size() or otherwise forces JNA to derive its layout. Assert stable sizes or offsets only when they are defined for the tested architecture.
Keep permission-, hardware-, and OS-dependent native integration coverage separate. A layout test should catch visibility and field-order failures before a native callback reaches production code.
When debugging, retain the complete cause chain: wrapper errors often hide the useful IllegalAccessException, invalid field type, alignment error, or callback exception underneath.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
实现或修改 IntelliJ `AnAction`,并在 `plugin.xml` 中注册。将显示名称和说明写入消息资源文件,按需设置图标,并通过事件协程作用域启动挂起任务,避免同步处理阻塞 IDE。
将 IntelliJ JPS 测试模块迁移到 Bazel,并排查仅在 Bazel 中出现的失败。根据症状检查依赖、插件、测试数据和 runfiles,重新生成并验证目标。
按 IntelliJ 项目规范编写或审查 Kotlin 和 Java 代码,涵盖语言选择、格式、密封类型、线程注解及控制流异常处理。
本指南帮助您按 IntelliJ 项目规则拆分更改并撰写提交信息:有工单时使用编号和变更说明,无工单时使用标签与子系统名,并在需要时说明原因和决定。
使用多个 Python 类型检查器比较代码片段或文件的类型推断和报错判断,并汇总各工具的结论、耗时与诊断信息,可保存为 Markdown 报告。
整理 Compose Desktop 界面中的状态和副作用,让可组合函数负责绘制,由展示器或协调器处理应用决策。了解状态归属、Effect、可复用组件接口、延迟列表键、动画和性能,适用于单项界面修改。