🐛 fix(vscode): 写注释时改已有说明,不再在声明上面另插一行
This commit is contained in:
1 parent
63dfb658e9
commit
7f39345d03
11 files changed
+196
-36
No files matched your search
@@ -435,7 +435,7 @@ describe('卡片上的「注释」一行', () => {
|
||||
const [, load] = await views(ts, 'typescript', typescriptZhTranslator, source)
|
||||
expect('properties' in load && load.properties.map(row => row.label).slice(0, 4)).toEqual(['名称', '说明', '注释', '访问级别'])
|
||||
expect(commentText(load)).toBe('讲 load\n\n第二段')
|
||||
expect(load).toMatchObject({ startLine: 2, commentTarget: { kind: 'replace', startLine: 2, endLine: 4 } })
|
||||
expect(load).toMatchObject({ startLine: 2, commentTarget: { kind: 'replace', startLine: 5, endLine: 5 } })
|
||||
const [check, returned] = load.children
|
||||
expect(check).toMatchObject({ kind: 'if', startLine: 7, rows: [{ label: '注释', value: { markdown: '先检查' } }] })
|
||||
expect(returned).toMatchObject({ kind: 'return', commentTarget: { kind: 'insert', line: 11 } })
|
||||
@@ -449,7 +449,7 @@ describe('卡片上的「注释」一行', () => {
|
||||
embedded: languageId => languageId === 'shellscript' ? { adapter: shell, translator: bashZhTranslator } : undefined,
|
||||
})
|
||||
const run = flatten(blocks).find(view => view.kind === 'run')
|
||||
expect(run?.commentTarget).toEqual({ kind: 'insert', line: 1 })
|
||||
expect(run?.commentTarget).toEqual({ kind: 'insert', line: 1, shell: '# _' })
|
||||
expect(run?.children.length).toBeGreaterThan(0)
|
||||
expect(run?.children.every(step => step.commentTarget === undefined)).toBe(true)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user