Repository navigation
docs(reference): 宿主方法按 API 编号逐个登记用途、首次加入的日期和 PR - #21
Merged
Merged
Conversation
API 总表的宿主方法和通知改为每个方法一行,补上用途;更新记录新增“宿主方法(按 API 编号)”索引,时间线加 API 编号列,修正 #1653 漏掉的 dispose、onExit,维护步骤要求新方法逐个登记。
This was referenced Nov 5, 2026
xiaoyumuxi
marked this pull request as ready for review
November 5, 2026 05:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
一个 API 编号下面常有多个宿主方法,例如 API-24 有
terminal/create、show、close、reopen、dispose、onExit六个。这些方法可以分几个 PR 陆续加入;函数协议 3 里向后兼容地新增方法也不升协议版本。原来的文档有两个问题:这个 PR 改成按方法登记,格式参照 1lck/Lithe-IDEA#1653 描述里“原计划编号 | 新增公共方法 | 用途”那张表。API 编号仍是 API 实施计划的规划编号,和协议版本、能力版本分开记录。
改动
reference/api-catalog.md(中英两半同步改)API | 方法 | 用途 | 权限 | 协议,按 API 编号排列;新增“用途”一列,共 35 个方法。API | 通知 | 用途 | 授予条件,补上用途。例如commands/didRun只是事件,不表示命令的业务操作成功;didChangeContexts带revision,后端再调listContexts。keymapImport/listInputs、readChunk属于litheKeymapImport协议,不在 API-01–44 内,并链接到快捷键导入页。reference/protocol-changelog.md(只有中文)preview的 first-parent 历史逐个方法用git log -S查出的首次加入 commit:credentials/*,协议 2;editor/registerActions;debugAdapters是 API-30,vcsProviders是 API-31,页面上也写明了这一点。create、show、close、reopen,漏了dispose、onExit。现在六个都列上,并按 PR 描述写明各自的作用。editor/registerActions后面标出 API-27。说明
editor/reveal的说法出自宿主实现:“只处理已打开的文件,没打开时返回plugin.host.notFound”这一点来自 macOS 宿主(PluginHostEditorService.swift抛出documentNotOpen,映射到plugin.host.notFound/-32016)。契约 README 只写了它和editor/open参数相同,以后应补进契约。contract/v1/和“记录到”都没变,也没有登记新的 PR,所以没有 @ 修改人。AGENTS.md的登记规则会另开 PR 补上“新增方法逐个登记 API 编号”。验证
node scripts/contract.mjs verify:91 个文件和锁定的644afdaac一致。node --test scripts/contract.test.mjs:13 个测试全部通过。reference/下 19 个文件的 1089 个相对链接和锚点,0 个断链。API 总表指向新锚点#宿主方法按-api-编号的链接也检查过。plugin_function.rs核对过。