feat(monaco): 报错治理 + diff 滚动条总览标尺(体验优化)#85
Merged
Conversation
只用 Monaco 做只读 diff + 语法着色(着色走 tokenizer,与语言服务无关),不需要补全 / 悬浮 /
符号 / 诊断等。但内置 typescript/javascript · json · css/scss/less · html/handlebars/razor 这 4
个带 worker 后端的语言族会主动向对应 *.worker 发 RPC(getNavigationTree / getSyntacticDiagnostics /
doValidation …),而我们只注册 base editor.worker → 找不到 handler,抛 `Missing requestHandler
or method: …`(此前靠 window 兜底降级为 console.warn)。
对这 4 族各 *Defaults 传空 ModeConfiguration(字段全 optional,缺省即不注册对应 provider),
从源头不再产生这类 RPC,整族报错消失;window 兜底退化为纯保险。其余 80+ 语言是 monarch
tokenizer 纯着色、无 worker,不受影响。着色不依赖语言服务,ts/js/json/css/html 仍正常上色。
注:contribution 子模块运行期具名导出 *Defaults,但 .d.ts 误为 `export {}`(monaco 0.55 ESM
打包缺陷),故 namespace 引入 + 经 unknown 转已知形状取用,不引入 any。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
不走 diff 专属的 renderOverviewRuler 宽列(并排会多出独立列),改用编辑模式风格:内层编辑器 自带的 overview ruler(overviewRulerLanes=3 → 按 1/3 分道,中间留白)+ 装饰投影。 - DiffPane:关 diff 合并标尺、显式 3 道,色条更细、minimap 保持关闭 - useDiffOverviewMarks:diff 增/改绿(左道,按行高)、删红;并排红画在左侧 original 编辑器 ruler,统一视图红 tick 与绿同走左道(被删行是 view zone 无 model 行,只能在删除点点标) - useCommentZones:评论锚点装饰加 overviewRuler 投影到右道(蓝),滚动条一眼可见哪些行有评论 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`Missing requestHandler …`(已从源头关闭语言服务,留作双保险)与 `TextModel got disposed
before DiffEditorWidget model got reset`(DiffEditor 切换 model 的 dispose 竞态)均为 Monaco
上游已知问题、不影响渲染、应用侧无法根除,作为已知问题默认静默(不再打 console.warn 噪音)。
需诊断时 localStorage.setItem('meebox.monacoDebug','1') 再刷新即可看到被吞的报错明细。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
- Added:Diff 滚动条总览标尺(增删 + 评论锚点,编辑模式风格、无 minimap) - Changed:前端结构重构补记 DiffView 组合根化 / 三单体组件拆分 / common barrel - Fixed:Monaco 报错治理(关闭 worker 语言服务消除 Missing requestHandler + benign 报错默认静默) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
背景
一组 Monaco 体验优化:消除 console 噪音报错,并让 diff 的增删 / 评论锚点在滚动条总览标尺上一眼可见(不启用 minimap)。
三笔独立 commit:
1.
refactor(monaco)从源头关闭带 worker 后端的语言服务只用 Monaco 做只读 diff + 语法着色(着色走 tokenizer,与语言服务无关)。typescript/javascript · json · css/scss/less · html/handlebars/razor 这 4 族会主动向对应
*.worker发 RPC(getNavigationTree/getSyntacticDiagnostics/doValidation…),而只注册了 base editor.worker → 抛Missing requestHandler or method: …。对这 4 族传空 ModeConfiguration(字段全 optional,缺省即不注册 provider),从源头消除整族报错。着色不受影响。2.
feat(diff)滚动条总览标尺展示 diff 增删与评论锚点不走 diff 专属的
renderOverviewRuler宽列(并排会多出独立列、偏宽),改用编辑模式风格:内层编辑器自带 overview ruler(overviewRulerLanes=3→ 按 1/3 分道、中间留白)+ 装饰投影。3.
chore(monaco)benign 报错默认静默 + debug 开关Missing requestHandler …(已从源头关闭,留作双保险)与TextModel got disposed before DiffEditorWidget model got reset(DiffEditor 切换 model 的 dispose 竞态)均为 Monaco 上游已知问题、应用侧无法根除 → 作为已知问题默认静默(不再打 console.warn 噪音)。需诊断时localStorage.setItem('meebox.monacoDebug','1')再刷新即可看到被吞明细。仅命中两条白名单消息,其它异常照常抛出。验证
lint零警告 ✓ ·typecheck✓ ·build✓ ·test(仅 packages;repo-mirror 5 个 git-CLI 环境性失败属已知、与本改动无关)。关联里程碑 体验优化 (#4)。
🤖 Generated with Claude Code