✨ feat(vscode): 代码阅读的注释和函数说明按 Markdown 渲染

This commit is contained in:
cruldra committed 2026-09-25 14:28:23 +08:00
1 parent aae9012f14
commit a53c2a6aac
18 files changed
+394 -66

No files matched your search

+3 -3
View File
@@ -1,4 +1,4 @@
import type { BlockKind, CodeBlock, LanguageAdapter, Node, PropertyRow, Segment, SourceRange, TokenRole, Translator } from './contract'
import type { BlockKind, CodeBlock, LanguageAdapter, Node, PreviewText, PropertyRow, Segment, SourceRange, TokenRole, Translator } from './contract'
import type { TreeSitterRuntime } from './runtime'
import { commonIndent, splitLines } from './editText'
@@ -18,8 +18,8 @@ interface BlockViewBase {
children: BlockView[]
}
/** 发给 webview 的一块(可序列化):函数、导入、常量、变量块预览时是属性表,其余是一行译文。 */
export type BlockView = BlockViewBase & ({ translation: Segment[] } | { properties: PropertyRow[] })
/** 发给 webview 的一块(可序列化):函数、导入、常量、变量块预览时是属性表,注释块是 Markdown 说明,其余是一行译文。 */
export type BlockView = BlockViewBase & ({ translation: PreviewText } | { properties: PropertyRow[] })
interface Line { start: number, end: number }