Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,18 @@ flake.nix # Nix development environment

### Adding a New Command

1. Register the command in `src/extension.ts` → `activate()`
2. Add to `package.json` → `contributes.commands`
3. Add keybinding in `package.json` → `contributes.keybindings` (optional)
4. Document in `README.md`
1. Register the command in the appropriate module's `register()` function (or in `src/extension.ts` → `activate()` for commands that don't belong to a dedicated module).
2. Decide whether to declare it in `package.json` → `contributes.commands` using the rule below.
3. Add a keybinding in `package.json` → `contributes.keybindings` (optional).
4. Document in `README.md`.

#### Command declaration rule

**Declare** a command in `contributes.commands` (with a `title` and `"category": "Doom"`) if it is **user-invokable**: it has a meaningful human-readable title, should appear in the Command Palette, or represents a named action that a user might discover and run directly.

**Do not declare** commands that are pure internal implementation details — keybinding-only routing helpers, UI-state toggles triggered only by the extension itself, or mid-keystroke mode-state commands that have no standalone meaning when invoked from the palette (e.g. `doom.whichKeyHide`, `doom.sidebarHide`, `doom.panelHide`, `doom.terminalEscapePrefix`, `doom.terminalEscapeSpace`, `doom.terminalSendEscape`).

The test `activates and registers Doom commands` in `src/test/extension.test.ts` enforces this contract automatically: it asserts that every `contributes.commands` entry and every `doom.*` command in `contributes.keybindings` is actually registered by the extension. CI will catch any drift.

### Updating Keybindings

Expand Down
83 changes: 24 additions & 59 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1624,21 +1624,6 @@
"title": "Show Which Key",
"category": "Doom"
},
{
"command": "doom.terminalEscapePrefix",
"title": "Terminal Escape Prefix",
"category": "Doom"
},
{
"command": "doom.terminalEscapeSpace",
"title": "Terminal Escape + Space: Show Which Key",
"category": "Doom"
},
{
"command": "doom.terminalSendEscape",
"title": "Terminal Escape + Escape: Send Escape",
"category": "Doom"
},
{
"command": "doom.whichKeyShowBindings",
"title": "Show Which-Key Bindings",
Expand Down Expand Up @@ -1670,38 +1655,48 @@
"category": "Doom"
},
{
"command": "doom.projectFileMoveDown",
"title": "Project File: Move Selection Down",
"command": "doom.showRecentProjects",
"title": "Show Recent Projects",
"category": "Doom"
},
{
"command": "doom.projectFileMoveUp",
"title": "Project File: Move Selection Up",
"command": "doom.findFile",
"title": "Find File",
"category": "Doom"
},
{
"command": "doom.showRecentProjects",
"title": "Show Recent Projects",
"command": "doom.triggerKey",
"title": "Which-Key: Trigger Key",
"category": "Doom"
},
{
"command": "doom.recentProjectsMoveDown",
"title": "Recent Projects: Move Selection Down",
"command": "doom.windowDelete",
"title": "Delete Window",
"category": "Doom"
},
{
"command": "doom.recentProjectsMoveUp",
"title": "Recent Projects: Move Selection Up",
"command": "doom.createTerminalEditor",
"title": "Open Terminal in Editor",
"category": "Doom"
},
{
"command": "doom.findFile",
"title": "Find File",
"command": "doom.openClaudeCli",
"title": "Open Claude CLI",
"category": "Doom"
},
{
"command": "doom.triggerKey",
"title": "Which-Key: Trigger Key",
"command": "doom.openCopilotCli",
"title": "Open Copilot CLI",
"category": "Doom"
},
{
"command": "doom.openCodexCli",
"title": "Open Codex CLI",
"category": "Doom"
},
{
"command": "doom.openPanelTerminal",
"title": "Open Panel Terminal",
"category": "Doom"
}
],
Expand Down Expand Up @@ -2877,36 +2872,6 @@
"command": "workbench.action.quickInputBack",
"when": "inQuickInput && !whichkeyVisible"
},
{
"key": "ctrl+j",
"command": "doom.recentProjectsMoveDown",
"when": "doom.recentProjectsVisible"
},
{
"key": "ctrl+k",
"command": "doom.recentProjectsMoveUp",
"when": "doom.recentProjectsVisible"
},
{
"key": "ctrl+j",
"command": "doom.projectFileMoveDown",
"when": "doom.projectFileVisible"
},
{
"key": "ctrl+k",
"command": "doom.projectFileMoveUp",
"when": "doom.projectFileVisible"
},
{
"key": "ctrl+j",
"command": "doom.findFileMoveDown",
"when": "doom.findFileVisible"
},
{
"key": "ctrl+k",
"command": "doom.findFileMoveUp",
"when": "doom.findFileVisible"
},
{
"key": "ctrl+j",
"command": "workbench.action.quickOpenSelectNext",
Expand Down
Loading
Loading