Skip to content

Commit c55f874

Browse files
committed
Rename codeWebChat.editContextSystemInstructions configuration to codeWebChat.editFilesSystemInstructions and add migration
- rename 'editContextSystemInstructions' to 'editFilesSystemInstructions'
1 parent 1b74ee6 commit c55f874

7 files changed

Lines changed: 54 additions & 5 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@
891891
"type": "string",
892892
"scope": "resource"
893893
},
894-
"codeWebChat.editContextSystemInstructions": {
894+
"codeWebChat.editFilesSystemInstructions": {
895895
"type": "string",
896896
"scope": "resource"
897897
},

‎apps/editor/src/extension.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import {
1515
migrate_remove_preset_groups_and_separators,
1616
migrate_merge_chat_presets,
1717
migrate_chat_presets_to_web_configurations,
18-
migrate_configurations_to_api_configurations
18+
migrate_configurations_to_api_configurations,
19+
migrate_edit_context_to_edit_files_system_instructions
1920
} from './migrations'
2021
import {
2122
apply_chat_response_command,
@@ -82,6 +83,8 @@ export const activate = async (context: vscode.ExtensionContext) => {
8283
await migrate_chat_presets_to_web_configurations(context)
8384
// 26 June 2026
8485
await migrate_configurations_to_api_configurations(context)
86+
// 1 July 2026
87+
await migrate_edit_context_to_edit_files_system_instructions(context)
8588
}
8689

8790
await migrations()

‎apps/editor/src/migrations/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ export * from './migrate-remove-preset-groups-and-separators'
1010
export * from './migrate-merge-chat-presets'
1111
export * from './migrate-chat-presets-to-web-configurations'
1212
export * from './migrate-configurations-to-api-configurations'
13+
export * from './migrate-edit-context-to-edit-files-system-instructions'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import * as vscode from 'vscode'
2+
import { Logger } from '@shared/utils/logger'
3+
4+
const MIGRATION_ID =
5+
'edit-context-to-edit-files-system-instructions-migration-20260701'
6+
7+
export async function migrate_edit_context_to_edit_files_system_instructions(
8+
context: vscode.ExtensionContext
9+
): Promise<void> {
10+
try {
11+
if (context.globalState.get(MIGRATION_ID)) {
12+
return
13+
}
14+
15+
const config = vscode.workspace.getConfiguration('codeWebChat')
16+
const inspect = config.inspect<string>('editContextSystemInstructions')
17+
18+
if (inspect?.globalValue !== undefined) {
19+
await config.update(
20+
'editFilesSystemInstructions',
21+
inspect.globalValue,
22+
vscode.ConfigurationTarget.Global
23+
)
24+
await config.update(
25+
'editContextSystemInstructions',
26+
undefined,
27+
vscode.ConfigurationTarget.Global
28+
)
29+
}
30+
31+
await context.globalState.update(MIGRATION_ID, true)
32+
Logger.info({
33+
function_name: 'migrate_edit_context_to_edit_files_system_instructions',
34+
message:
35+
'Successfully migrated editContextSystemInstructions to editFilesSystemInstructions'
36+
})
37+
} catch (error) {
38+
Logger.error({
39+
function_name: 'migrate_edit_context_to_edit_files_system_instructions',
40+
message:
41+
'Error migrating editContextSystemInstructions to editFilesSystemInstructions',
42+
data: error instanceof Error ? error.message : String(error)
43+
})
44+
}
45+
}

‎apps/editor/src/views/panel/backend/message-handlers/handle-edit-context.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ export const handle_edit_context = async (
386386
const system_instructions =
387387
vscode.workspace
388388
.getConfiguration('codeWebChat')
389-
.get<string>('editContextSystemInstructions') ||
389+
.get<string>('editFilesSystemInstructions') ||
390390
default_system_instructions
391391

392392
const part1 = `<files>\n${collected.other_files}`

‎apps/editor/src/views/settings/backend/message-handlers/handle-get-edit-context-system-instructions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const handle_get_edit_context_system_instructions = async (
77
): Promise<void> => {
88
const config = vscode.workspace.getConfiguration('codeWebChat')
99
const instructions =
10-
config.get<string>('editContextSystemInstructions') ||
10+
config.get<string>('editFilesSystemInstructions') ||
1111
default_system_instructions
1212
provider.postMessage({
1313
command: 'EDIT_CONTEXT_SYSTEM_INSTRUCTIONS',

‎apps/editor/src/views/settings/backend/message-handlers/handle-update-edit-context-system-instructions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const handle_update_edit_context_system_instructions = async (
88
await vscode.workspace
99
.getConfiguration('codeWebChat')
1010
.update(
11-
'editContextSystemInstructions',
11+
'editFilesSystemInstructions',
1212
message.instructions == '' ||
1313
message.instructions == default_system_instructions
1414
? undefined

0 commit comments

Comments
 (0)