✨ feat(vscode): 问 AI 和重写注释各用各的 profile,设置里加重写注释默认模型

This commit is contained in:
cruldra committed 2026-10-12 16:30:41 +11:00
1 parent 925f1ed39a
commit b83c445dd0
25 files changed
+363 -111

No files matched your search

+11 -1
View File
@@ -58,7 +58,7 @@ describe('saveSettings 落盘', () => {
}
})
it('文件问答默认模型独立落盘,重启读取且不受旧的上次选择影响', async () => {
it('问答默认模型独立落盘,重启读取且不受旧的上次选择影响', async () => {
const dir = tempDir()
const ctx = fakeCtx(dir, { 'superpowers.codeReader.askProfile': 'sonnet' })
expect(getSettings(ctx).defaultAskProfilePath).toBe('')
@@ -71,6 +71,16 @@ describe('saveSettings 落盘', () => {
expect(getSettings(fakeCtx(dir)).defaultAskProfilePath).toBe('')
})
it('问答、重写注释的默认模型各存各的:没配时都是空(用默认),改一个不动另一个', async () => {
const dir = tempDir()
const ctx = fakeCtx(dir)
expect(getSettings(ctx).defaultRewriteProfilePath).toBe('')
await saveSettings(ctx, { defaultAskProfilePath: '/p/sonnet.json', defaultRewriteProfilePath: ' /p/dsflash.json ' })
expect(getSettings(fakeCtx(dir))).toMatchObject({ defaultAskProfilePath: '/p/sonnet.json', defaultRewriteProfilePath: '/p/dsflash.json' })
await saveSettings(ctx, { defaultRewriteProfilePath: '' })
expect(getSettings(fakeCtx(dir))).toMatchObject({ defaultAskProfilePath: '/p/sonnet.json', defaultRewriteProfilePath: '' })
})
it('默认配置保存后通知订阅者,取消订阅后不再通知', async () => {
const ctx = fakeCtx(tempDir())
const { onDidChangeSettings } = await import('./store.js')