Skip to content

feat: add coderm.workbench.openReadme command#227

Merged
j4rviscmd merged 2 commits into
mainfrom
feat/open-readme-cmd
Jul 3, 2026
Merged

feat: add coderm.workbench.openReadme command#227
j4rviscmd merged 2 commits into
mainfrom
feat/open-readme-cmd

Conversation

@j4rviscmd

Copy link
Copy Markdown
Owner

Summary

Adds a new Coderm command coderm.workbench.openReadme ("Open README") that opens the workspace root's README.md (first workspace folder) on a best-effort basis. If README.md is absent or no workspace folder is open, it falls back to the upstream workbench.action.files.newUntitledFile command.

Behavior

  • README.md present in the first workspace folder → opens it (pinned tab)
  • README.md absent, or empty workspace (no folders) → runs workbench.action.files.newUntitledFile (new untitled file)
  • Only the first workspace folder is consulted — multi-root workspaces do not scan every folder (intentional simplicity trade-off)

Files

  • src/vs/workbench/contrib/coderm/browser/openReadme.ts (new) — Action2 + registerAction2
  • src/vs/workbench/contrib/coderm/browser/coderm.contribution.ts — side-effect import
  • README.md / README.ja.md — command table entry

The fallback delegates to the upstream newUntitledFile command via ICommandService.executeCommand(NEW_UNTITLED_FILE_COMMAND_ID) rather than re-implementing it, so upstream behavior changes are tracked for free.

Follows Coderm conventions: command lives under contrib/coderm/browser/, no default keybinding (users assign their own, like other Coderm commands).

Related to #105 — this adds a manual command variant. #105 additionally asks for automatic open on startup when no editor pane exists (not covered here).

Checklist

  • Build passes (gulp compile, 0 errors)
  • ESLint passes (0 errors)
  • README.md / README.ja.md synced

j4rviscmd and others added 2 commits July 3, 2026 22:37
Add a command that opens the workspace root's README.md (first workspace folder), falling back to the upstream workbench.action.files.newUntitledFile command when README.md is absent or no workspace folder is open.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@j4rviscmd j4rviscmd added the enhancement New feature or request label Jul 3, 2026
@j4rviscmd j4rviscmd merged commit 11a4825 into main Jul 3, 2026
3 checks passed
@j4rviscmd j4rviscmd deleted the feat/open-readme-cmd branch July 3, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant