From 3b04afc27506cd6245e62763d3a11a3a23cffafc Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 13 Oct 2026 20:18:29 +0800 Subject: [PATCH] =?UTF-8?q?style(=E4=BB=A3=E7=A0=81=E9=85=8D=E8=89=B2):=20?= =?UTF-8?q?printf=20=E9=87=8C=E7=9A=84=20%d=E3=80=81%.2f=20=E5=92=8C=20Pyt?= =?UTF-8?q?hon=20f-string=20=E7=9A=84=20{=20}=20=E6=9C=89=E4=BA=86?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E7=9A=84=E9=A2=9C=E8=89=B2=EF=BC=9BPython=20?= =?UTF-8?q?=E7=9A=84=20from=20/=20as=20/=20with=20=E5=92=8C=20import=20?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=A2=9C=E8=89=B2=EF=BC=8C=E8=B7=9F=20VS=20C?= =?UTF-8?q?ode=20=E4=B8=80=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lezer 把整个字符串当一个词,占位符另外扫一遍(shared/formatPlaceholder.ts),编辑器挂装饰、 静态代码拆 span,用同一份正则。Python 解析器补了几条 styleTags,编辑器和静态代码共用。 CodeEditor.vue 原来自己抄了一份语言选择,改成用 languageExtension。 Co-Authored-By: Claude Opus 5.5 --- apps/web/src/shared/components/CodeEditor.vue | 9 +--- .../shared/extensions/formatPlaceholder.ts | 45 +++++++++++++++++++ apps/web/src/shared/extensions/language.ts | 24 +++++++++- apps/web/src/shared/formatPlaceholder.ts | 27 +++++++++++ apps/web/src/shared/highlight.css | 13 ++++++ apps/web/src/shared/highlight.ts | 30 ++++++++++--- 6 files changed, 134 insertions(+), 14 deletions(-) create mode 100644 apps/web/src/shared/extensions/formatPlaceholder.ts create mode 100644 apps/web/src/shared/formatPlaceholder.ts diff --git a/apps/web/src/shared/components/CodeEditor.vue b/apps/web/src/shared/components/CodeEditor.vue index dba2f45..d62d901 100644 --- a/apps/web/src/shared/components/CodeEditor.vue +++ b/apps/web/src/shared/components/CodeEditor.vue @@ -1,7 +1,4 @@