diff --git a/CHANGELOG.md b/CHANGELOG.md index 37e3f74..f711d1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,17 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] + +### ✨ Added +- New command: **CodeCritter: Rename Pet ✏️** to rename your pet. + + ### Fixed - Query diagnostics only for visible documents and count split editors once per document, avoiding a workspace-wide scan on every diagnostics event. +--- + ## [2.0.0] - 2026-09-25 *The massive Companion Update! Bringing new pet species, a persistent sidebar view, wearables, and interactivity to CodeCritter.* diff --git a/extension.js b/extension.js index 02cecaf..079a117 100644 --- a/extension.js +++ b/extension.js @@ -269,6 +269,26 @@ function activate(context) { } }); + /** Rename the pet using an input box */ + const cmdRenamePet = vscode.commands.registerCommand('codecritter.petName', async () => { + const current = petName(); + const val = await vscode.window.showInputBox({ + title: 'CodeCritter — Rename Pet Name', + prompt: 'What would you like to name your pet?', + value: current, + validateInput: v => { + if (v.trim() === '') return 'Pet name cannot be empty.'; + if (v.trim().length > 20) return 'Pet name must be 20 characters max.'; + return null; + } + }); + if (val !== undefined) { + const newName = val.trim(); + await cfg().update('petName', newName, vscode.ConfigurationTarget.Global); + vscode.window.showInformationMessage(`✏️ Your pet has been renamed to ${newName}!`); + } + }); + // ── Event: File Saved ── const onSave = vscode.workspace.onDidSaveTextDocument(() => { lastActivity = Date.now(); @@ -433,6 +453,7 @@ function activate(context) { cmdChooseTheme, cmdExportStats, cmdImportStats, + cmdRenamePet, onSave, onChange, onDiagnostics, diff --git a/package.json b/package.json index 0adc507..bfe2e80 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,11 @@ "command": "codecritter.playPet", "title": "CodeCritter: Play with Pet 🎾", "category": "CodeCritter" + }, + { + "command": "codecritter.petName", + "title": "CodeCritter: Rename Pet ✏️", + "category": "CodeCritter" } ], "viewsContainers": {