♻️ refactor(vscode): 代码阅读的块数据去掉没人用的「注释」一行下标 commentRow

This commit is contained in:
cruldra committed 2026-10-08 08:04:51 +08:00
1 parent ebea984852
commit 5cf96af740
6 files changed
+15 -27

No files matched your search

@@ -120,7 +120,6 @@ describe('「注释」一行和「重写注释」按钮', () => {
it('属性表卡片:「注释」一行照属性表画,按钮在右上角那排,不在这一行上', () => {
const card = view('1', 'function', '', {
properties: [{ label: '名称', value: [{ text: 'find', role: 'function' }] }, comment, { label: '异步', value: [{ text: '否', role: 'storage' }] }],
commentRow: 1,
commentTarget: { kind: 'replace', startLine: 0, endLine: 0 },
})
const markup = html(card)
@@ -129,7 +128,7 @@ describe('「注释」一行和「重写注释」按钮', () => {
})
it('一行译文的卡片:「注释」一行排在译文下面,按钮同样在右上角那排', () => {
const markup = html(view('2', 'statement', 'save()', { rows: [comment], commentRow: 0, commentTarget: { kind: 'replace', startLine: 0, endLine: 0 } }))
const markup = html(view('2', 'statement', 'save()', { rows: [comment], commentTarget: { kind: 'replace', startLine: 0, endLine: 0 } }))
expect(markup.indexOf('save()')).toBeLessThan(markup.indexOf('按名字找'))
inToolbar(markup, '按注释规范重写')
})
@@ -143,8 +143,6 @@ interface BlockViewBase {
attributes: Record<string, string>
/** 这块认出来的概念,从左到右。webview 按图标名画,不自己用种类查 */
concepts: BlockConcept[]
/** 「注释」一行(讲这块的普通注释)排在第几行,0 起:属性表卡片是 properties 里的下标,一行译文的卡片是 rows 里的下标;没有注释就没有 */
commentRow?: number
/** 「重写注释」写到哪(扩展端用,这边只看有没有、是换掉还是新写);没有就不显示按钮 */
commentTarget?: CommentTarget
/** 库规则的卡片才有:卡片边框的颜色,筛选栏里这个种类的名字。和类块一样默认收起子块 */