Skip to content

Commit 5739e81

Browse files
committed
Separate checkpoint functionality into dedicated "Checkpoints" and "Create New Checkpoint" commands
1 parent f2f5264 commit 5739e81

4 files changed

Lines changed: 39 additions & 9 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
No-cost AI coding in free chatbots for <a href="https://marketplace.visualstudio.com/items?itemName=robertpiosik.gemini-coder" target="_blank">VS Code</a>, <a href="https://open-vsx.org/extension/robertpiosik/gemini-coder" target="_blank">Cursor and Windsurf</a>.
66

7-
✅ **Initializes free chatbots**—ChatGPT, Claude, Gemini, DeepSeek, and more \
8-
✅ **Applies chat responses**—one-click multi-file changes integration \
9-
🥊 **Beats coding agents**—fast, predictable and accurate edits \
10-
🫰 **Saves money**—zero context overhead and tool calling \
11-
🫶 **Open-source**—released under the GPL-3.0 license
7+
🌐 **Initializes web chats**—ChatGPT, Claude, Gemini, DeepSeek, and more \
8+
🪄 **Applies responses**—signature multi-file changes integration process \
9+
🔋 **Batteries included**—code completions, checkpoints, and more \
10+
🥊 **Beats agents**—excels in blazing fast, accurate edits \
11+
🫰 **Saves money**—zero endless tool-calling \
12+
🫶 **Open-source**—GPL-3.0 license
1213

1314
<p>
1415
<img src="https://github.com/robertpiosik/CodeWebChat/raw/HEAD/packages/shared/src/media/demo.gif" alt="Walkthrough" />
@@ -18,6 +19,7 @@ No-cost AI coding in free chatbots for <a href="https://marketplace.visualstudio
1819

1920
- Don't scrape chat responses
2021
- Operate 100% locally
22+
- Respect user privacy
2123
- Stay free forever
2224

2325
🤌 **CWC is non-agentic, but why?**

‎packages/vscode/package.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@
272272
"category": "Code Web Chat",
273273
"icon": "$(history)"
274274
},
275+
{
276+
"command": "codeWebChat.createNewCheckpoint",
277+
"title": "Create New Checkpoint",
278+
"category": "Code Web Chat"
279+
},
275280
{
276281
"command": "codeWebChat.settings",
277282
"title": "Settings",

‎packages/vscode/src/commands/checkpoints-command.ts‎

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const copy_workspace_to_dir = async (
188188
const create_checkpoint = async (
189189
workspace_provider: WorkspaceProvider,
190190
context: vscode.ExtensionContext
191-
) => {
191+
): Promise<boolean> => {
192192
try {
193193
const timestamp = Date.now()
194194
await vscode.window.withProgress(
@@ -215,10 +215,12 @@ const create_checkpoint = async (
215215
await context.workspaceState.update(CHECKPOINTS_STATE_KEY, checkpoints)
216216
}
217217
)
218+
return true
218219
} catch (err: any) {
219220
vscode.window.showErrorMessage(
220221
`Failed to create checkpoint: ${err.message}`
221222
)
223+
return false
222224
}
223225
}
224226

@@ -638,8 +640,27 @@ const edit_checkpoint = async (params: {
638640
export const checkpoints_command = (
639641
workspace_provider: WorkspaceProvider,
640642
context: vscode.ExtensionContext
641-
) => {
642-
return vscode.commands.registerCommand(
643+
): vscode.Disposable[] => {
644+
const create_new_checkpoint_command = vscode.commands.registerCommand(
645+
'codeWebChat.createNewCheckpoint',
646+
async () => {
647+
if (
648+
!vscode.workspace.workspaceFolders ||
649+
vscode.workspace.workspaceFolders.length == 0
650+
) {
651+
vscode.window.showErrorMessage(
652+
'Checkpoints can only be used in a workspace.'
653+
)
654+
return
655+
}
656+
const success = await create_checkpoint(workspace_provider, context)
657+
if (success) {
658+
vscode.window.showInformationMessage('Checkpoint created successfully.')
659+
}
660+
}
661+
)
662+
663+
const checkpoints_command = vscode.commands.registerCommand(
643664
'codeWebChat.checkpoints',
644665
async () => {
645666
if (
@@ -812,4 +833,6 @@ export const checkpoints_command = (
812833
await show_quick_pick()
813834
}
814835
)
836+
837+
return [checkpoints_command, create_new_checkpoint_command]
815838
}

‎packages/vscode/src/extension.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export async function activate(context: vscode.ExtensionContext) {
9797
rename_command(),
9898
delete_command(),
9999
save_context_command(workspace_provider, context),
100-
checkpoints_command(workspace_provider, context),
100+
...checkpoints_command(workspace_provider, context),
101101
vscode.commands.registerCommand('codeWebChat.duplicateWorkspace', () => {
102102
vscode.commands.executeCommand(
103103
'workbench.action.duplicateWorkspaceInNewWindow'

0 commit comments

Comments
 (0)