Repository navigation
keyboard: Add support for rewrap - #3385
AndreasArvidsson merged 2 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8be0197de
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "unfoldRegion", | ||
| "wrap" | ||
| "wrap", | ||
| "rewrap" |
There was a problem hiding this comment.
Remove the stale ID from the structured action enum
When a user chooses the object-form keybinding { "actionId": "rewrapWithPairedDelimiter" }, this enum still marks it valid at line 1035, but KeyboardActionType.ts now excludes that ID and getTokenTypeKeyMaps accepts only wrap/rewrap, so KeyboardConfig.getTokenKeyMap silently drops the binding. The string branch was corrected in this commit; remove the old ID from this object branch too so VS Code does not advertise a configuration that creates a dead key.
Useful? React with 👍 / 👎.
|
|
|
No code change in this round. Keyboard |
29ba23b
Bug
Keyboard mode had a
wrapaction but norewrap, sorewrapcould not be bound to a keyboard key (issue #2423).Change
rewrapis a keyboard action alongsidewrap, andrewrapWithPairedDelimiteris excluded from the simple keyboard actions, since it is only reachable through the wrap path.wrap/rewrapto the paired-delimiter command moved intogetPairedDelimiterCommandName.ts, which has novscodeimport, so the handler's choice is unit tested.KeyboardCommandHandlernow calls it.rewrapWithPairedDelimitercase inKeyboardCommandsTargeted.performSimpleActionOnTargetwas removed. Simple keyboard action tokens are built only fromsimpleKeyboardActionNames, which now excludes that action, so the case cannot be reached from keyboard input.Testing
getPairedDelimiterCommandName.test.tschecks thatwrapmaps towrapWithPairedDelimiterandrewrapmaps torewrapWithPairedDelimiter. It passes on this change (ℹ pass 2). On the base commit the helper module does not exist, so the test fails withERR_MODULE_NOT_FOUND.tsc --noEmit -p tsconfig.jsonforpackages/app-vscodereports no type errors.oxlintonpackages/app-vscode/src/keyboardreports 0 warnings and 0 errors.test:vscode) was not run.A new
rewraptest case was added togrammar.test.ts(+16 lines).Regression test: fails on base twice (/ERR_MODULE_NOT_FOUND|Cannot find module/), passes on fix twice (
node_modules/.bin/tsx -e 'const t=require("node:test");Object.assign(globalThis,{suite:t.describe,test:t.it,setup:t.beforeEach});import("./packages/app-vscode/src/keyboard/getPairedDelimiterCommandName.test.ts")')Fixes #2423