Files
MemRelay/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/决策:编辑器高亮用 Shiki(TextMate)替代 Monarch.md
T

20 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 决策:编辑器高亮用 Shiki(TextMate)替代 Monarch
type: decision
permalink: main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/决策编辑器高亮用-shiki-text-mate-替代-monarch
stable_id: 52d53ae2-ce5b-4207-9813-0c9d3de029ce
scope: project
project_id: d5a7f581-c442-4554-87b9-ee723b8b0258
memory_type: decision
status: active
revision: 1
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
created_at: '2026-09-23T15:09:51.052290+00:00'
updated_at: '2026-09-23T15:09:51.052351+00:00'
tags:
- decision
- editor
- monaco
---
Monaco 内置 Monarch Python 语法对多行 f-string(f\"\"\"...\"\"\")断行失步,后续代码全被当字符串渲染。引入 shiki + @shikijs/monaco(web/src/utils/monacoHighlight.ts,ensureShikiHighlighting 懒加载注册 16 种语言 + dark-plus/light-plus 主题),获得 VSCode 级 TextMate 高亮;脚本编辑器(CodeEditor.vue)与 SQL 编辑器(MonacoEditor.vue)共用。选 Shiki 而非手写 Monarch 补丁:与用户“不手写关键字、引入库实现”的偏好一致,且修复面覆盖全语言。