@codingame/monaco-vscode-api 1.76.4 → 1.76.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/polyfill.js +113 -4
- package/package.json +1 -1
package/dist/polyfill.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VSBuffer as VSBuffer$1 } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
2
|
-
import { Disposable, DisposableMap as DisposableMap$1, toDisposable, dispose as dispose$1, DisposableStore, MutableDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
2
|
+
import { Disposable, DisposableMap as DisposableMap$1, toDisposable, dispose as dispose$1, combinedDisposable, DisposableStore, MutableDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
3
|
import { onUnexpectedError, ErrorHandler as ErrorHandler$1, illegalArgument, isCancellationError, BugIndicatingError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
4
4
|
import { registerThemingParticipant, Themable as Themable$1, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
5
5
|
import { ProgressBar as ProgressBar$1 } from 'monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js';
|
|
@@ -47,7 +47,7 @@ import { Color as Color$1, RGBA as RGBA$1 } from 'monaco-editor/esm/vs/base/comm
|
|
|
47
47
|
import { LogService as LogService$1 } from 'monaco-editor/esm/vs/platform/log/common/logService.js';
|
|
48
48
|
import { MultiplexLogger, ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
49
49
|
import { SnippetParser } from 'monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetParser.js';
|
|
50
|
-
import { Keybinding as Keybinding$1, KeyCodeChord as KeyCodeChord$1 } from 'monaco-editor/esm/vs/base/common/keybindings.js';
|
|
50
|
+
import { Keybinding as Keybinding$1, KeyCodeChord as KeyCodeChord$1, decodeKeybinding } from 'monaco-editor/esm/vs/base/common/keybindings.js';
|
|
51
51
|
import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
|
|
52
52
|
import { once } from 'monaco-editor/esm/vs/base/common/functional.js';
|
|
53
53
|
import { Schemas as Schemas$1, FileAccess as FileAccess$1 } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
@@ -126,11 +126,11 @@ import { Scrollable } from 'monaco-editor/esm/vs/base/common/scrollable.js';
|
|
|
126
126
|
import { SmoothScrollableElement } from 'monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js';
|
|
127
127
|
import { Range as Range$1 } from 'monaco-editor/esm/vs/base/common/range.js';
|
|
128
128
|
import { DataTransfers } from 'monaco-editor/esm/vs/base/browser/dnd.js';
|
|
129
|
-
import { SelectActionViewItem as SelectActionViewItem$1 } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems';
|
|
129
|
+
import { SelectActionViewItem as SelectActionViewItem$1 } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
|
|
130
130
|
import { SelectBox } from 'monaco-editor/esm/vs/base/browser/ui/selectBox/selectBox.js';
|
|
131
131
|
import { isFirefox } from 'monaco-editor/esm/vs/base/browser/browser.js';
|
|
132
132
|
import { setupCustomHover } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabelHover.js';
|
|
133
|
-
import { QuickInputService as QuickInputService$1 } from 'monaco-editor/esm/vs/platform/quickinput/browser/quickInputService';
|
|
133
|
+
import { QuickInputService as QuickInputService$1 } from 'monaco-editor/esm/vs/platform/quickinput/browser/quickInputService.js';
|
|
134
134
|
import { QuickAccessController } from 'monaco-editor/esm/vs/platform/quickinput/browser/quickAccess.js';
|
|
135
135
|
import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
136
136
|
import { WorkbenchList } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
@@ -138,6 +138,7 @@ import { QuickInputController } from 'monaco-editor/esm/vs/platform/quickinput/b
|
|
|
138
138
|
import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
139
139
|
import { defaultInputBoxStyles, defaultToggleStyles, defaultCountBadgeStyles, defaultButtonStyles, defaultProgressBarStyles, defaultKeybindingLabelStyles, getListStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
140
140
|
import { ILayoutService } from 'monaco-editor/esm/vs/platform/layout/browser/layoutService.js';
|
|
141
|
+
import { Extensions as Extensions$3 } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
|
|
141
142
|
import { GhostTextController } from 'monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostTextController.js';
|
|
142
143
|
import { getSingletonServiceDescriptors } from 'monaco-editor/esm/vs/platform/instantiation/common/extensions.js';
|
|
143
144
|
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
@@ -3365,6 +3366,112 @@ function compareConfigurationContents(to, from) {
|
|
|
3365
3366
|
}
|
|
3366
3367
|
return { added, removed, updated };
|
|
3367
3368
|
}
|
|
3369
|
+
class KeybindingsRegistryImpl {
|
|
3370
|
+
constructor() {
|
|
3371
|
+
this._coreKeybindings = ( (new LinkedList()));
|
|
3372
|
+
this._extensionKeybindings = [];
|
|
3373
|
+
this._cachedMergedKeybindings = null;
|
|
3374
|
+
}
|
|
3375
|
+
static bindToCurrentPlatform(kb) {
|
|
3376
|
+
if (OS === 1 ) {
|
|
3377
|
+
if (kb && kb.win) {
|
|
3378
|
+
return kb.win;
|
|
3379
|
+
}
|
|
3380
|
+
}
|
|
3381
|
+
else if (OS === 2 ) {
|
|
3382
|
+
if (kb && kb.mac) {
|
|
3383
|
+
return kb.mac;
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
else {
|
|
3387
|
+
if (kb && kb.linux) {
|
|
3388
|
+
return kb.linux;
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
return kb;
|
|
3392
|
+
}
|
|
3393
|
+
registerKeybindingRule(rule) {
|
|
3394
|
+
const actualKb = KeybindingsRegistryImpl.bindToCurrentPlatform(rule);
|
|
3395
|
+
const result = ( (new DisposableStore()));
|
|
3396
|
+
if (actualKb && actualKb.primary) {
|
|
3397
|
+
const kk = decodeKeybinding(actualKb.primary, OS);
|
|
3398
|
+
if (kk) {
|
|
3399
|
+
result.add(this._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, 0, rule.when));
|
|
3400
|
+
}
|
|
3401
|
+
}
|
|
3402
|
+
if (actualKb && Array.isArray(actualKb.secondary)) {
|
|
3403
|
+
for (let i = 0, len = actualKb.secondary.length; i < len; i++) {
|
|
3404
|
+
const k = actualKb.secondary[i];
|
|
3405
|
+
const kk = decodeKeybinding(k, OS);
|
|
3406
|
+
if (kk) {
|
|
3407
|
+
result.add(this._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, -i - 1, rule.when));
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
}
|
|
3411
|
+
return result;
|
|
3412
|
+
}
|
|
3413
|
+
setExtensionKeybindings(rules) {
|
|
3414
|
+
const result = [];
|
|
3415
|
+
let keybindingsLen = 0;
|
|
3416
|
+
for (const rule of rules) {
|
|
3417
|
+
if (rule.keybinding) {
|
|
3418
|
+
result[keybindingsLen++] = {
|
|
3419
|
+
keybinding: rule.keybinding,
|
|
3420
|
+
command: rule.id,
|
|
3421
|
+
commandArgs: rule.args,
|
|
3422
|
+
when: rule.when,
|
|
3423
|
+
weight1: rule.weight,
|
|
3424
|
+
weight2: 0,
|
|
3425
|
+
extensionId: rule.extensionId || null,
|
|
3426
|
+
isBuiltinExtension: rule.isBuiltinExtension || false
|
|
3427
|
+
};
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
this._extensionKeybindings = result;
|
|
3431
|
+
this._cachedMergedKeybindings = null;
|
|
3432
|
+
}
|
|
3433
|
+
registerCommandAndKeybindingRule(desc) {
|
|
3434
|
+
return combinedDisposable(this.registerKeybindingRule(desc), CommandsRegistry.registerCommand(desc));
|
|
3435
|
+
}
|
|
3436
|
+
_registerDefaultKeybinding(keybinding, commandId, commandArgs, weight1, weight2, when) {
|
|
3437
|
+
const remove = this._coreKeybindings.push({
|
|
3438
|
+
keybinding: keybinding,
|
|
3439
|
+
command: commandId,
|
|
3440
|
+
commandArgs: commandArgs,
|
|
3441
|
+
when: when,
|
|
3442
|
+
weight1: weight1,
|
|
3443
|
+
weight2: weight2,
|
|
3444
|
+
extensionId: null,
|
|
3445
|
+
isBuiltinExtension: false
|
|
3446
|
+
});
|
|
3447
|
+
this._cachedMergedKeybindings = null;
|
|
3448
|
+
return toDisposable(() => {
|
|
3449
|
+
remove();
|
|
3450
|
+
this._cachedMergedKeybindings = null;
|
|
3451
|
+
});
|
|
3452
|
+
}
|
|
3453
|
+
getDefaultKeybindings() {
|
|
3454
|
+
if (!this._cachedMergedKeybindings) {
|
|
3455
|
+
this._cachedMergedKeybindings = Array.from(this._coreKeybindings).concat(this._extensionKeybindings);
|
|
3456
|
+
this._cachedMergedKeybindings.sort(sorter);
|
|
3457
|
+
}
|
|
3458
|
+
return this._cachedMergedKeybindings.slice(0);
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
function sorter(a, b) {
|
|
3462
|
+
if (a.weight1 !== b.weight1) {
|
|
3463
|
+
return a.weight1 - b.weight1;
|
|
3464
|
+
}
|
|
3465
|
+
if (a.command && b.command) {
|
|
3466
|
+
if (a.command < b.command) {
|
|
3467
|
+
return -1;
|
|
3468
|
+
}
|
|
3469
|
+
if (a.command > b.command) {
|
|
3470
|
+
return 1;
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
return a.weight2 - b.weight2;
|
|
3474
|
+
}
|
|
3368
3475
|
const IWorkspaceContextService = ( (createDecorator('contextService')));
|
|
3369
3476
|
class WorkspaceFolder {
|
|
3370
3477
|
constructor(data,
|
|
@@ -14428,6 +14535,8 @@ polyfillPrototypeSimple(ListView$1.prototype, ListView.prototype);
|
|
|
14428
14535
|
polyfillPrototypeSimple(CallbackIterable$1.prototype, CallbackIterable.prototype);
|
|
14429
14536
|
polyfillPrototypeSimple(SelectActionViewItem$1.prototype, SelectActionViewItem.prototype);
|
|
14430
14537
|
polyfillPrototypeSimple(QuickInputService$1.prototype, QuickInputService.prototype);
|
|
14538
|
+
const keydinbingsRegistry = ( Registry.as(Extensions$3.EditorModes));
|
|
14539
|
+
polyfillPrototypeSimple(keydinbingsRegistry.constructor.prototype, KeybindingsRegistryImpl.prototype);
|
|
14431
14540
|
TextModel.prototype.equalsTextBuffer = function (other) {
|
|
14432
14541
|
this._assertNotDisposed();
|
|
14433
14542
|
return this._buffer.equals(other);
|