Skip to content

Commit 7ec5fac

Browse files
author
Eric Wheeler
committed
docs: update settings.md with comprehensive steps
Update the settings documentation to include all necessary steps for adding a new configuration item, including schema definitions, type definitions, and critical steps for persistence and UI display. This ensures the documentation accurately reflects the complete process required when adding new settings to the application. Signed-off-by: Eric Wheeler <[email protected]>
1 parent 5fa555e commit 7ec5fac

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

cline_docs/settings.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
## For All Settings
22

3-
1. Add the setting to ExtensionMessage.ts:
3+
1. Add the setting to schema definitions:
44

5-
- Add the setting to the ExtensionState interface
6-
- Make it required if it has a default value, optional if it can be undefined
7-
- Example: `preferredLanguage: string`
5+
- Add the item to `globalSettingsSchema` in `schemas/index.ts`
6+
- Add the item to `globalSettingsRecord` in `schemas/index.ts`
7+
- Example: `terminalCommandDelay: z.number().optional(),`
88

9-
2. Add test coverage:
9+
2. Add the setting to type definitions:
10+
11+
- Add the item to `exports/types.ts`
12+
- Add the item to `exports/roo-code.d.ts`
13+
- Add the setting to `shared/ExtensionMessage.ts`
14+
- Add the setting to the WebviewMessage type in `shared/WebviewMessage.ts`
15+
- Example: `terminalCommandDelay?: number | undefined`
16+
17+
3. Add test coverage:
1018
- Add the setting to mockState in ClineProvider.test.ts
1119
- Add test cases for setting persistence and state updates
1220
- Ensure all tests pass before submitting changes
@@ -64,7 +72,8 @@
6472
```
6573

6674
5. Add the setting to handleSubmit in SettingsView.tsx:
67-
- Add a vscode.postMessage call to send the setting's value when clicking Done
75+
- Add a vscode.postMessage call to send the setting's value when clicking Save
76+
- This step is critical for persistence - without it, the setting will not be saved when the user clicks Save
6877
- Example:
6978
```typescript
7079
vscode.postMessage({ type: "multisearchDiffEnabled", bool: multisearchDiffEnabled })
@@ -98,6 +107,7 @@
98107
- Add the setting to the return value in getState with a default value
99108
- Add the setting to the destructured variables in getStateToPostToWebview
100109
- Add the setting to the return value in getStateToPostToWebview
110+
- This step is critical for UI display - without it, the setting will not be displayed in the UI
101111
- Add a case in setWebviewMessageListener to handle the setting's message type
102112
- Example:
103113
```typescript

0 commit comments

Comments
 (0)