Skip to content

Commit 24f923e

Browse files
authored
Merge pull request #88 from CodinGame/fix-extension-keybindings
Fix extension keybindings handling
2 parents 680b2f7 + 9431001 commit 24f923e

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

scripts/vscode.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ index 8f4a1384e58..5607a27dd0c 100644
2424

2525
try {
2626
await playAudio(url, this.getVolumeInPercent() / 100);
27+
diff --git a/src/vs/platform/keybinding/common/keybindingsRegistry.ts b/src/vs/platform/keybinding/common/keybindingsRegistry.ts
28+
index 9d56a6c8826..d6fb0f1ab0a 100644
29+
--- a/src/vs/platform/keybinding/common/keybindingsRegistry.ts
30+
+++ b/src/vs/platform/keybinding/common/keybindingsRegistry.ts
31+
@@ -76,7 +76,7 @@ export interface IKeybindingsRegistry {
32+
getDefaultKeybindings(): IKeybindingItem[];
33+
}
34+
35+
-class KeybindingsRegistryImpl implements IKeybindingsRegistry {
36+
+export class KeybindingsRegistryImpl implements IKeybindingsRegistry {
37+
38+
private _coreKeybindings: LinkedList<IKeybindingItem>;
39+
private _extensionKeybindings: IKeybindingItem[];
2740
diff --git a/src/vs/workbench/services/configuration/browser/configurationService.ts b/src/vs/workbench/services/configuration/browser/configurationService.ts
2841
index 4d68798fc9a..722c5f53b75 100644
2942
--- a/src/vs/workbench/services/configuration/browser/configurationService.ts

src/polyfill.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ import { QuickInputService as MonacoQuickInputService } from 'monaco-editor/esm/
105105
import { QuickInputService as VScodeQuickInputService } from 'vscode/vs/platform/quickinput/browser/quickInputService.js'
106106
// @ts-ignore Creating a d.ts is not worth it
107107
import { TextModel as MonacoTextModel } from 'monaco-editor/esm/vs/editor/common/model/textModel.js'
108+
// @ts-ignore Creating a d.ts is not worth it
109+
import { Extensions as KeybindingsExtensions } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js'
110+
import { KeybindingsRegistryImpl as VScodeKeybindingsRegistryImpl } from 'vscode/vs/platform/keybinding/common/keybindingsRegistry.js'
108111
import { ITextBuffer } from 'vs/editor/common/model'
109112
import { AudioCue } from 'vs/platform/audioCues/browser/audioCueService'
110113
import { onServicesInitialized } from './service-override/tools'
@@ -185,6 +188,8 @@ polyfillPrototypeSimple(MonacoListView.prototype, VScodeListView.prototype)
185188
polyfillPrototypeSimple(MonacoCallbackIterable.prototype, VScodeCallbackIterable.prototype)
186189
polyfillPrototypeSimple(MonacoSelectActionViewItem.prototype, VScodeSelectActionViewItem.prototype)
187190
polyfillPrototypeSimple(MonacoQuickInputService.prototype, VScodeQuickInputService.prototype)
191+
const keydinbingsRegistry = Registry.as<IConfigurationRegistry>(KeybindingsExtensions.EditorModes)
192+
polyfillPrototypeSimple(keydinbingsRegistry.constructor.prototype, VScodeKeybindingsRegistryImpl.prototype)
188193

189194
MonacoTextModel.prototype.equalsTextBuffer = function (other: ITextBuffer): boolean {
190195
this._assertNotDisposed()

0 commit comments

Comments
 (0)