⚡ perf(vscode): 代码阅读预览的文档消息里源码和着色只带一份:块不再各带一份连子块在内的整段源码和上色,编辑框按块的编辑范围从整份源码和着色里取,5126 行的消息 4.3MB → 1.9MB

This commit is contained in:
cruldra committed 2026-10-13 15:50:33 +11:00
1 parent 0371712176
commit 2e3602242e
43 files changed
+501 -239

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import { toBlockViews } from './blockView'
import { blockCodes, toBlockViews } from './blockView'
import { blockReplacement, commonIndent, reindentBlock, replaceLines } from './editText'
import { createPythonAdapter } from './languages/python'
import { createTypeScriptAdapter } from './languages/typescript'
@@ -48,7 +48,7 @@ describe('行替换', () => {
return [view, ...view.children.flatMap(flat)]
})
for (const view of all)
expect(replaceLines(source, view.startLine, view.endLine, view.code), view.id).toBe(source)
expect(replaceLines(source, view.startLine, view.endLine, blockCodes(source)(view)), view.id).toBe(source)
})
})