✨ feat(vscode): 代码阅读把说明里的 @param / @return / @throws 拆到参数表、输出、异常表

This commit is contained in:
cruldra committed 2026-10-08 07:17:26 +08:00
1 parent c2982537d7
commit 0958506681
43 files changed
+1300 -323

No files matched your search

+3 -3
View File
@@ -454,7 +454,7 @@ function optionsCell(options: Option[], env: Env): Inline[] {
/** 注释的原文(翻译插件去掉 #),几条连成一段。 */
function commentText(comments: Node[], env: Env): Inline[] {
const text = comments.map(comment => env.context.doc(comment)?.markdown).filter(Boolean).join(' ')
const text = comments.map(comment => env.context.doc(comment)?.body?.markdown).filter(Boolean).join(' ')
return text ? [{ text, role: 'comment' }] : []
}
@@ -490,7 +490,7 @@ function beatBlock(app: Node, schedule: Node, settings: [string, Node][], doc: N
const entries = entriesOf(schedule)
const spreads = entries.filter(entry => entry.spread).length
const withOptions = entries.some(entry => extraOptions(entry).length > 0)
const markdown = doc && context.doc(doc)
const markdown = doc && context.doc(doc)?.body
const rows: PropertyRow[] = [
{ label: labels.app, value: context.translate(app) },
...(markdown ? [{ label: labels.doc, value: markdown }] : []),
@@ -515,7 +515,7 @@ function appBlock(target: Node, call: Call, doc: Node | undefined, env: Env): Ru
call.positional.forEach((arg, i) => parameters.set(APP_PARAMETERS[i] ?? String(i), arg))
for (const [key, value] of call.keywords)
parameters.set(key, value)
const markdown = doc && context.doc(doc)
const markdown = doc && context.doc(doc)?.body
const named = new Set<string>(APP_NAMED)
const rows: PropertyRow[] = [
{ label: labels.name, value: target.type === 'identifier' ? [name(target, 'variable')] : context.translate(target) },