feat: Ability to add KeyBindings using a ConfigMap#754
Conversation
|
Hi! I'm che-ai-assistant — I help with your pull requests. Available commands:
|
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-754-amd64 |
a2e691f to
0ea8496
Compare
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Assisted-by: Cursor AI
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Assisted-by: Cursor AI
0ea8496 to
0d1984c
Compare
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-754-amd64 |
1 similar comment
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-754-amd64 |
📝 WalkthroughWalkthroughThe change loads optional Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ConfigMap
participant WebClientServer
participant WebMain
participant CheKeybindingsInitializer
participant IndexedDB
ConfigMap->>WebClientServer: provide keybindings.json
WebClientServer->>WebMain: send cheInitialKeybindings
WebMain->>CheKeybindingsInitializer: initialize configured keybindings
CheKeybindingsInitializer->>IndexedDB: read existing entries
CheKeybindingsInitializer->>IndexedDB: write merged entries
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@code/src/vs/server/node/che/webClientServer.ts`:
- Around line 22-27: Update getCheInitialKeybindings to be async and replace
existsSync/readFileSync with fs.promises.readFile, returning undefined when the
configuration file is unavailable. In _handleRoot within webClientServer.ts,
await getCheInitialKeybindings and preserve the existing response behavior.
In `@code/src/vs/workbench/browser/che/web.ts`:
- Around line 76-85: Update the existing keybindings parsing flow around
JSON.parse so parse failures abort initialization instead of continuing with the
default empty userEntries and overwriting the file. Either parse the content
with VS Code’s JSONC parser to support comments and trailing commas, or
return/propagate from the enclosing initialization method inside the catch while
preserving ConfigMap entries safely.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 195468f5-a341-4f7c-b3a9-09b47b0301ff
📒 Files selected for processing (10)
.rebase/CHANGELOG.md.rebase/replace/code/src/vs/server/node/webClientServer.ts.json.rebase/replace/code/src/vs/workbench/browser/web.api.ts.json.rebase/replace/code/src/vs/workbench/browser/web.main.ts.jsoncode/src/vs/server/node/che/webClientServer.tscode/src/vs/server/node/webClientServer.tscode/src/vs/workbench/browser/che/web.tscode/src/vs/workbench/browser/web.api.tscode/src/vs/workbench/browser/web.main.tsrebase.sh
…revent data loss Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Assisted-by: Cursor AI
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Assisted-by: Cursor AI
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-754-amd64 |
|
/che-ai-assistant generate-che-doc Task completed. |
|
Documentation PR created: eclipse-che/che-docs#3166 |
TODO:
What does this PR do?
Adds ability to provide keybindings via the
vscode-editor-configurationsConfigMap.keybindings.jsonfrom the ConfigMap mount path and passes content to the browserCheKeybindingsInitializermerges ConfigMap keybindings intoIndexedDBon every workspace start"_source": "configmap"and appended at the end of the array — VS Code gives them priority (later entries win)What issues does this PR fix?
https://redhat.atlassian.net/browse/CRW-9166
How to test this PR?
keybindings.jsonto thevscode-editor-configurationsConfigMap, see https://eclipse.dev/che/docs/stable/administration-guide/editor-configurations-for-microsoft-visual-studio-code/ctrl+shift+topens a terminalctrl+shift+kkills a terminalalt+cmd+ndoes not create a new file anymore: there is-before the commandDoes this PR contain changes that override default upstream Code-OSS behavior?
git rebasewere added to the .rebase folderSummary by CodeRabbit
New Features
Bug Fixes