Repository navigation
feat(plugins): 独立编辑器高亮与动作 API,复用普通函数调用 - #1617
Merged
Merged
Conversation
- languages 2:插件语言可带 Monarch 语法和编辑器配置,Core 校验,纯语法插件免重启 - runMarkers 1:backend 2 插件函数回答可运行行,编辑器画运行按钮,点击经 commands/didRun 带 runMarker - 契约、fixture、Agent Note、计划文档与功能矩阵同步更新;Windows 暂不支持 Refs #570
xiaoyumuxi
marked this pull request as ready for review
October 31, 2026 04:35
Lithe Review结论: ⛔ 有阻塞 Findings
Scope Check
Suggestions
另外,请补充本次高亮及运行按钮的界面截图,已有界面提供前后对比;合并前提供两个官方 SDK 的 Summary共享校验与平台适配的边界清晰,但真实插件加载链和公开文档版本存在阻塞问题。当前测试主要覆盖解析与直接注入的贡献集合,尚未覆盖这些完整用户路径。 Verification
|
保留 PR 原实现及 preview 合并历史;最终源码沿用已通过本地验证的 a75cb52,不恢复 runMarkers 专用协议。
区分包内静态 JSON 贡献与尚未开放的运行期 Provider 注册、替换和释放;说明独立语义 Provider、新引擎适配及平台、SDK 和验收限制。同步计划、架构笔记、正式契约与功能矩阵。
动作刷新立即确认调度并隔离非致命失败,整批收集共享八秒期限并在撤销时清理计时任务。 Core 保留校验后的 grammar 原始文本,worker 按源顺序解析 cases 并显式默认 root;配置-only 别名借用既有 tokenizer,重映射 token 语言身份以保留独立注释配置。 模块状态观察弱引用 runtime,补齐有界、确定性的 Swift/Rust/WebKit 回归与测试文档模型清理,同步契约、Agent Note 和功能矩阵。 验证:57 项 Swift、1459 项 Rust、39 项编辑器和 119 项真实 WebKit 测试通过;静态边界、i18n、只读 bundle、资源复用与矩阵门禁通过。未执行 Windows 原生构建或打包安装验收。 Refs #1617, #570
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.
概述
重写本 PR 的插件编辑器接入方案:普通工具插件可以独立贡献高亮、编辑配置和文本位置动作,不要求实现 LSP、Build、Run、Test 或 Debug Provider。
原方案的
runMarkers[]/requires.runMarkers和commands/didRun.runMarker已移除。 点击位置动作复用既有插件函数调用,原命令通知与领域协议保持不变。Refs #570;原 Issue 的 Windows 产品能力不由本 PR 完成。
设计边界与评审依据
功能点
1. 独立的静态高亮与编辑配置
languages:2的包内 Monarch grammar 和注释、括号、自动配对配置,不需要语言服务器、后端或激活事件;仅配置贡献也生效。textmate-worker.js和固定 Monaco 引擎;不新增下载,不把“项目还没有 TextMate/WASM”当作选型前提。2. 独立
editor/registerActions宿主 APIlithe/host/editor/registerActions,通过getCapabilities发现,不提高顶层pluginAPIVersion或函数协议版本。backend:2、documents.read和明确的editor.actions权限;新增中英权限说明。旧宿主不认识新权限时明确拒绝,不能宣称同一包无条件降级。subscriptionID,使用原订阅释放机制。documentID、contentVersion、相对路径和当前脏缓冲,不再使用 WebView 桥接 revision 作为公开文档版本。{actions:[{id,range,title,icon,invoke:{functionID,params}}]}。共享 Core 校验一基 UTF-16 范围、代理对边界、重复 ID、数量及字节预算;HTTP/SQL 业务数据保持不透明。commands/didRun {commandID,context?}不变。3. 生命周期、安全与独立后端
docs/ci-builds.md。4. Skill、契约和文档
develop-lithe新增“同领域统一模型,不把独立能力硬塞进领域”,审查规则同步检查工具名特判、封闭格式枚举、固定 ID、第二工具复用和临时迁移退出条件。plugin-editor-grammars与plugin-editor-actions,分别描述可独立验收的能力;未做的 Windows 与完整产品验收没有标为通过。验证
node scripts/sdk-e2e.mjs --source <本地工作树> --ref <精确验证快照>:Node、Java、Rust 示例 E2E 全部通过;未修改 SDK 源码或直接改契约副本。a75cb52a4逐字节相同。已知边界与后续
onWorkspaceOpen,未实现按文件懒启动或后端热安装。node scripts/contract.mjs sync --revision <commit>并提交;对外使用指南与 SDK helper 属于该仓库,不在这里另存 SDK。提交说明
本次保留 PR 原提交及其 preview 合并历史,合入重写后的已验证源码,不强推、不恢复旧 runMarker 方案。保留当前 ready 状态,没有反复 push 触发完整 CI。