@theia/keymaps 1.22.0-next.7 → 1.22.1
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/lib/browser/keybinding-schema-updater.d.ts +101 -0
- package/lib/browser/keybinding-schema-updater.d.ts.map +1 -0
- package/lib/browser/keybinding-schema-updater.js +118 -0
- package/lib/browser/keybinding-schema-updater.js.map +1 -0
- package/lib/browser/keymaps-frontend-module.d.ts +1 -1
- package/lib/browser/keymaps-frontend-module.d.ts.map +1 -1
- package/lib/browser/keymaps-frontend-module.js +6 -2
- package/lib/browser/keymaps-frontend-module.js.map +1 -1
- package/lib/browser/keymaps-service.d.ts.map +1 -1
- package/lib/browser/keymaps-service.js +3 -0
- package/lib/browser/keymaps-service.js.map +1 -1
- package/package.json +7 -8
- package/src/browser/keybinding-schema-updater.ts +95 -0
- package/src/browser/keymaps-frontend-module.ts +6 -4
- package/src/browser/keymaps-service.ts +3 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2022 Ericsson and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { CommandRegistry, InMemoryResources } from '@theia/core/lib/common';
|
|
17
|
+
import { JsonSchemaContribution, JsonSchemaRegisterContext } from '@theia/core/lib/browser/json-schema-store';
|
|
18
|
+
import URI from '@theia/core/lib/common/uri';
|
|
19
|
+
export declare class KeybindingSchemaUpdater implements JsonSchemaContribution {
|
|
20
|
+
protected readonly uri: URI;
|
|
21
|
+
protected readonly commandRegistry: CommandRegistry;
|
|
22
|
+
protected readonly inMemoryResources: InMemoryResources;
|
|
23
|
+
protected init(): void;
|
|
24
|
+
registerSchemas(store: JsonSchemaRegisterContext): void;
|
|
25
|
+
protected updateSchema(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare const keybindingSchema: {
|
|
28
|
+
$id: string;
|
|
29
|
+
type: string;
|
|
30
|
+
title: string;
|
|
31
|
+
default: never[];
|
|
32
|
+
definitions: {
|
|
33
|
+
key: {
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
items: {
|
|
39
|
+
type: string;
|
|
40
|
+
defaultSnippets: {
|
|
41
|
+
body: {
|
|
42
|
+
key: string;
|
|
43
|
+
command: string;
|
|
44
|
+
when: string;
|
|
45
|
+
};
|
|
46
|
+
}[];
|
|
47
|
+
allOf: ({
|
|
48
|
+
required: string[];
|
|
49
|
+
properties: {
|
|
50
|
+
command: {
|
|
51
|
+
anyOf: ({
|
|
52
|
+
type: string;
|
|
53
|
+
enum?: undefined;
|
|
54
|
+
enumDescriptions?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
enum: string[];
|
|
57
|
+
enumDescriptions: string[];
|
|
58
|
+
type?: undefined;
|
|
59
|
+
})[];
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
when: {
|
|
63
|
+
type: string;
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
args: {
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
context: {
|
|
70
|
+
type: string;
|
|
71
|
+
description: string;
|
|
72
|
+
deprecationMessage: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
anyOf?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
anyOf: ({
|
|
78
|
+
required: string[];
|
|
79
|
+
properties: {
|
|
80
|
+
key: {
|
|
81
|
+
$ref: string;
|
|
82
|
+
};
|
|
83
|
+
keybinding?: undefined;
|
|
84
|
+
};
|
|
85
|
+
} | {
|
|
86
|
+
required: string[];
|
|
87
|
+
properties: {
|
|
88
|
+
keybinding: {
|
|
89
|
+
$ref: string;
|
|
90
|
+
};
|
|
91
|
+
key?: undefined;
|
|
92
|
+
};
|
|
93
|
+
})[];
|
|
94
|
+
required?: undefined;
|
|
95
|
+
properties?: undefined;
|
|
96
|
+
})[];
|
|
97
|
+
};
|
|
98
|
+
allowComments: boolean;
|
|
99
|
+
allowTrailingCommas: boolean;
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=keybinding-schema-updater.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keybinding-schema-updater.d.ts","sourceRoot":"","sources":["../../src/browser/keybinding-schema-updater.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAO,eAAe,EAAE,iBAAiB,EAAa,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAE9G,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,qBACa,uBAAwB,YAAW,sBAAsB;IAClE,SAAS,CAAC,QAAQ,CAAC,GAAG,MAA+B;IAC5B,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAClD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGnF,SAAS,CAAC,IAAI,IAAI,IAAI;IAMtB,eAAe,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI;IAOvD,SAAS,CAAC,YAAY,IAAI,IAAI;CAYjC;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC5B,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (C) 2022 Ericsson and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.keybindingSchema = exports.KeybindingSchemaUpdater = void 0;
|
|
28
|
+
const common_1 = require("@theia/core/lib/common");
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
31
|
+
let KeybindingSchemaUpdater = class KeybindingSchemaUpdater {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.uri = new uri_1.default(keybindingSchemaId);
|
|
34
|
+
}
|
|
35
|
+
init() {
|
|
36
|
+
this.inMemoryResources.add(new uri_1.default(keybindingSchemaId), '');
|
|
37
|
+
this.updateSchema();
|
|
38
|
+
this.commandRegistry.onCommandsChanged(() => this.updateSchema());
|
|
39
|
+
}
|
|
40
|
+
registerSchemas(store) {
|
|
41
|
+
store.registerSchema({
|
|
42
|
+
fileMatch: ['keybindings.json', 'keymaps.json'],
|
|
43
|
+
url: this.uri.toString(),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
updateSchema() {
|
|
47
|
+
var _a;
|
|
48
|
+
const schema = common_1.deepClone(exports.keybindingSchema);
|
|
49
|
+
const enumValues = schema.items.allOf[0].properties.command.anyOf[1].enum;
|
|
50
|
+
const enumDescriptions = schema.items.allOf[0].properties.command.anyOf[1].enumDescriptions;
|
|
51
|
+
for (const command of this.commandRegistry.getAllCommands()) {
|
|
52
|
+
if (command.handlers.length > 0 && !command.id.startsWith('_')) {
|
|
53
|
+
enumValues.push(command.id);
|
|
54
|
+
enumDescriptions.push((_a = command.label) !== null && _a !== void 0 ? _a : '');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
this.inMemoryResources.update(this.uri, JSON.stringify(schema));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
__decorate([
|
|
61
|
+
inversify_1.inject(common_1.CommandRegistry),
|
|
62
|
+
__metadata("design:type", common_1.CommandRegistry)
|
|
63
|
+
], KeybindingSchemaUpdater.prototype, "commandRegistry", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
inversify_1.inject(common_1.InMemoryResources),
|
|
66
|
+
__metadata("design:type", common_1.InMemoryResources)
|
|
67
|
+
], KeybindingSchemaUpdater.prototype, "inMemoryResources", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
inversify_1.postConstruct(),
|
|
70
|
+
__metadata("design:type", Function),
|
|
71
|
+
__metadata("design:paramtypes", []),
|
|
72
|
+
__metadata("design:returntype", void 0)
|
|
73
|
+
], KeybindingSchemaUpdater.prototype, "init", null);
|
|
74
|
+
KeybindingSchemaUpdater = __decorate([
|
|
75
|
+
inversify_1.injectable()
|
|
76
|
+
], KeybindingSchemaUpdater);
|
|
77
|
+
exports.KeybindingSchemaUpdater = KeybindingSchemaUpdater;
|
|
78
|
+
const keybindingSchemaId = 'vscode://schemas/keybindings';
|
|
79
|
+
exports.keybindingSchema = {
|
|
80
|
+
$id: keybindingSchemaId,
|
|
81
|
+
type: 'array',
|
|
82
|
+
title: 'Keybinding Configuration File',
|
|
83
|
+
default: [],
|
|
84
|
+
definitions: {
|
|
85
|
+
key: { type: 'string', description: common_1.nls.localizeByDefault('Key or key sequence (separated by space)') },
|
|
86
|
+
},
|
|
87
|
+
items: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
defaultSnippets: [{ body: { key: '$1', command: '$2', when: '$3' } }],
|
|
90
|
+
allOf: [
|
|
91
|
+
{
|
|
92
|
+
required: ['command'],
|
|
93
|
+
properties: {
|
|
94
|
+
command: {
|
|
95
|
+
anyOf: [{ type: 'string' }, { enum: [], enumDescriptions: [] }],
|
|
96
|
+
description: common_1.nls.localizeByDefault('Name of the command to execute')
|
|
97
|
+
},
|
|
98
|
+
when: { type: 'string', description: common_1.nls.localizeByDefault('Condition when the key is active.') },
|
|
99
|
+
args: { description: common_1.nls.localizeByDefault('Arguments to pass to the command to execute.') },
|
|
100
|
+
context: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
description: common_1.nls.localizeByDefault('Condition when the key is active.'),
|
|
103
|
+
deprecationMessage: common_1.nls.localize('theia/keybinding-schema-updater/deprecation', 'Use `when` clause instead.')
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
anyOf: [
|
|
109
|
+
{ required: ['key'], properties: { key: { $ref: '#/definitions/key' }, } },
|
|
110
|
+
{ required: ['keybinding'], properties: { keybinding: { $ref: '#/definitions/key' } } }
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
allowComments: true,
|
|
116
|
+
allowTrailingCommas: true,
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=keybinding-schema-updater.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keybinding-schema-updater.js","sourceRoot":"","sources":["../../src/browser/keybinding-schema-updater.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,mDAA4F;AAE5F,4DAAiF;AACjF,oDAA6C;AAG7C,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAApC;QACuB,QAAG,GAAG,IAAI,aAAG,CAAC,kBAAkB,CAAC,CAAC;IA8BzD,CAAC;IAzBa,IAAI;QACV,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,aAAG,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,eAAe,CAAC,KAAgC;QAC5C,KAAK,CAAC,cAAc,CAAC;YACjB,SAAS,EAAE,CAAC,kBAAkB,EAAE,cAAc,CAAC;YAC/C,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;SAC3B,CAAC,CAAC;IACP,CAAC;IAES,YAAY;;QAClB,MAAM,MAAM,GAAG,kBAAS,CAAC,wBAAgB,CAAC,CAAC;QAC3C,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAA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,IAAI;CAC5B,CAAC"}
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
17
16
|
import './keymaps-monaco-contribution';
|
|
18
17
|
import '../../src/browser/style/index.css';
|
|
18
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
19
19
|
declare const _default: ContainerModule;
|
|
20
20
|
export default _default;
|
|
21
21
|
//# sourceMappingURL=keymaps-frontend-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keymaps-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/keymaps-frontend-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC
|
|
1
|
+
{"version":3,"file":"keymaps-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/keymaps-frontend-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,+BAA+B,CAAC;AACvC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAW/D,wBAcG"}
|
|
@@ -15,16 +15,18 @@
|
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
require("./keymaps-monaco-contribution");
|
|
19
|
+
require("../../src/browser/style/index.css");
|
|
18
20
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
21
|
const keymaps_service_1 = require("./keymaps-service");
|
|
20
22
|
const keymaps_frontend_contribution_1 = require("./keymaps-frontend-contribution");
|
|
21
23
|
const common_1 = require("@theia/core/lib/common");
|
|
22
24
|
const keybinding_1 = require("@theia/core/lib/browser/keybinding");
|
|
23
25
|
const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
|
|
24
|
-
require("./keymaps-monaco-contribution");
|
|
25
26
|
const browser_1 = require("@theia/core/lib/browser");
|
|
26
27
|
const keybindings_widget_1 = require("./keybindings-widget");
|
|
27
|
-
require("
|
|
28
|
+
const keybinding_schema_updater_1 = require("./keybinding-schema-updater");
|
|
29
|
+
const json_schema_store_1 = require("@theia/core/lib/browser/json-schema-store");
|
|
28
30
|
exports.default = new inversify_1.ContainerModule(bind => {
|
|
29
31
|
bind(keymaps_service_1.KeymapsService).toSelf().inSingletonScope();
|
|
30
32
|
bind(keymaps_frontend_contribution_1.KeymapsFrontendContribution).toSelf().inSingletonScope();
|
|
@@ -37,5 +39,7 @@ exports.default = new inversify_1.ContainerModule(bind => {
|
|
|
37
39
|
id: keybindings_widget_1.KeybindingWidget.ID,
|
|
38
40
|
createWidget: () => context.container.get(keybindings_widget_1.KeybindingWidget),
|
|
39
41
|
})).inSingletonScope();
|
|
42
|
+
bind(keybinding_schema_updater_1.KeybindingSchemaUpdater).toSelf().inSingletonScope();
|
|
43
|
+
bind(json_schema_store_1.JsonSchemaContribution).toService(keybinding_schema_updater_1.KeybindingSchemaUpdater);
|
|
40
44
|
});
|
|
41
45
|
//# sourceMappingURL=keymaps-frontend-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keymaps-frontend-module.js","sourceRoot":"","sources":["../../src/browser/keymaps-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,4DAA+D;AAC/D,uDAAmD;AACnD,mFAA8E;AAC9E,mDAA+E;AAC/E,mEAA4E;AAC5E,mFAA0F;
|
|
1
|
+
{"version":3,"file":"keymaps-frontend-module.js","sourceRoot":"","sources":["../../src/browser/keymaps-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;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"","sources":["../../src/browser/keymaps-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,aAAa,EAA6B,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAmB,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"keymaps-service.d.ts","sourceRoot":"","sources":["../../src/browser/keymaps-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,aAAa,EAA6B,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAmB,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,UAAU,EAAiB,MAAM,mCAAmC,CAAC;AAG9E,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,qBACa,cAAc;IAGvB,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IAG9C,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;IAG5D,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAGzC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAElD,SAAS,CAAC,QAAQ,CAAC,mBAAmB,gBAAuB;IAC7D,QAAQ,CAAC,kBAAkB,qDAAkC;IAE7D,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC/C,SAAS,CAAC,QAAQ,CAAC,aAAa,8BAAqC;IAErE;;OAEG;cAEa,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAYrC;;OAEG;IACH,SAAS,CAAC,SAAS,IAAI,IAAI;IA0B3B;;;OAGG;IACG,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYvC;;;OAGG;IACG,aAAa,CAAC,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAiDhG;;;OAGG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAWlC,YAAY,CAAC,EAAE,EAAE,MAAM,UAAU,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAiC7E"}
|
|
@@ -74,6 +74,9 @@ let KeymapsService = class KeymapsService {
|
|
|
74
74
|
if (keybinding_2.Keybinding.is(value)) {
|
|
75
75
|
keybindings.push(value);
|
|
76
76
|
}
|
|
77
|
+
else if (keybinding_2.RawKeybinding.is(value)) {
|
|
78
|
+
keybindings.push(keybinding_2.Keybinding.apiObjectify(value));
|
|
79
|
+
}
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keymaps-service.js","sourceRoot":"","sources":["../../src/browser/keymaps-service.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,4DAAiF;AACjF,qDAA2F;AAC3F,mEAAyF;AACzF,
|
|
1
|
+
{"version":3,"file":"keymaps-service.js","sourceRoot":"","sources":["../../src/browser/keymaps-service.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,4DAAiF;AACjF,qDAA2F;AAC3F,mEAAyF;AAC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K,EAAE,cAAc,CAAC,CAAC;aACnE;SACJ;QAAC,OAAO,CAAC,EAAE;YACR,MAAM,OAAO,GAAG,iCAAiC,KAAK,CAAC,GAAG,IAAI,CAAC;YAC/D,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,OAAO,mCAAmC,CAAC,CAAC;YACzE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;SAClC;IACL,CAAC;CAEJ,CAAA;AAtLG;IADC,kBAAM,CAAC,kCAAe,CAAC;8BACM,kCAAe;iDAAC;AAG9C;IADC,kBAAM,CAAC,kDAAsB,CAAC;8BACM,kDAAsB;wDAAC;AAG5D;IADC,kBAAM,CAAC,+BAAkB,CAAC;8BACY,+BAAkB;0DAAC;AAG1D;IADC,kBAAM,CAAC,uBAAa,CAAC;;8CACmB;AAGzC;IADC,kBAAM,CAAC,gCAAc,CAAC;8BACY,gCAAc;sDAAC;AAYlD;IADC,yBAAa,EAAE;;;;0CAWf;AArCQ,cAAc;IAD1B,sBAAU,EAAE;GACA,cAAc,CAyL1B;AAzLY,wCAAc"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/keymaps",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.1",
|
|
4
4
|
"description": "Theia - Custom Keymaps Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.22.
|
|
7
|
-
"@theia/monaco": "1.22.
|
|
8
|
-
"@theia/userstorage": "1.22.
|
|
9
|
-
"@theia/workspace": "1.22.
|
|
6
|
+
"@theia/core": "1.22.1",
|
|
7
|
+
"@theia/monaco": "1.22.1",
|
|
8
|
+
"@theia/userstorage": "1.22.1",
|
|
9
|
+
"@theia/workspace": "1.22.1",
|
|
10
10
|
"@types/lodash.debounce": "4.0.3",
|
|
11
|
-
"ajv": "^6.5.3",
|
|
12
11
|
"jsonc-parser": "^2.2.0"
|
|
13
12
|
},
|
|
14
13
|
"devDependencies": {
|
|
15
|
-
"@theia/ext-scripts": "1.
|
|
14
|
+
"@theia/ext-scripts": "1.22.1",
|
|
16
15
|
"@types/temp": "^0.8.29",
|
|
17
16
|
"temp": "^0.8.3"
|
|
18
17
|
},
|
|
@@ -51,5 +50,5 @@
|
|
|
51
50
|
"nyc": {
|
|
52
51
|
"extends": "../../configs/nyc.json"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "49910aeaecf520a54b253db0215b28c2268bb2f3"
|
|
55
54
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2022 Ericsson and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import { nls, CommandRegistry, InMemoryResources, deepClone } from '@theia/core/lib/common';
|
|
18
|
+
import { JsonSchemaContribution, JsonSchemaRegisterContext } from '@theia/core/lib/browser/json-schema-store';
|
|
19
|
+
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
20
|
+
import URI from '@theia/core/lib/common/uri';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export class KeybindingSchemaUpdater implements JsonSchemaContribution {
|
|
24
|
+
protected readonly uri = new URI(keybindingSchemaId);
|
|
25
|
+
@inject(CommandRegistry) protected readonly commandRegistry: CommandRegistry;
|
|
26
|
+
@inject(InMemoryResources) protected readonly inMemoryResources: InMemoryResources;
|
|
27
|
+
|
|
28
|
+
@postConstruct()
|
|
29
|
+
protected init(): void {
|
|
30
|
+
this.inMemoryResources.add(new URI(keybindingSchemaId), '');
|
|
31
|
+
this.updateSchema();
|
|
32
|
+
this.commandRegistry.onCommandsChanged(() => this.updateSchema());
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
registerSchemas(store: JsonSchemaRegisterContext): void {
|
|
36
|
+
store.registerSchema({
|
|
37
|
+
fileMatch: ['keybindings.json', 'keymaps.json'],
|
|
38
|
+
url: this.uri.toString(),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
protected updateSchema(): void {
|
|
43
|
+
const schema = deepClone(keybindingSchema);
|
|
44
|
+
const enumValues = schema.items.allOf[0].properties!.command.anyOf[1].enum!;
|
|
45
|
+
const enumDescriptions = schema.items.allOf[0].properties!.command.anyOf[1].enumDescriptions!;
|
|
46
|
+
for (const command of this.commandRegistry.getAllCommands()) {
|
|
47
|
+
if (command.handlers.length > 0 && !command.id.startsWith('_')) {
|
|
48
|
+
enumValues.push(command.id);
|
|
49
|
+
enumDescriptions.push(command.label ?? '');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
this.inMemoryResources.update(this.uri, JSON.stringify(schema));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const keybindingSchemaId = 'vscode://schemas/keybindings';
|
|
57
|
+
export const keybindingSchema = {
|
|
58
|
+
$id: keybindingSchemaId,
|
|
59
|
+
type: 'array',
|
|
60
|
+
title: 'Keybinding Configuration File',
|
|
61
|
+
default: [],
|
|
62
|
+
definitions: {
|
|
63
|
+
key: { type: 'string', description: nls.localizeByDefault('Key or key sequence (separated by space)') },
|
|
64
|
+
},
|
|
65
|
+
items: {
|
|
66
|
+
type: 'object',
|
|
67
|
+
defaultSnippets: [{ body: { key: '$1', command: '$2', when: '$3' } }],
|
|
68
|
+
allOf: [
|
|
69
|
+
{
|
|
70
|
+
required: ['command'],
|
|
71
|
+
properties: {
|
|
72
|
+
command: {
|
|
73
|
+
anyOf: [{ type: 'string' }, { enum: <string[]>[], enumDescriptions: <string[]>[] }], description: nls.localizeByDefault('Name of the command to execute')
|
|
74
|
+
},
|
|
75
|
+
when: { type: 'string', description: nls.localizeByDefault('Condition when the key is active.') },
|
|
76
|
+
args: { description: nls.localizeByDefault('Arguments to pass to the command to execute.') },
|
|
77
|
+
context: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: nls.localizeByDefault('Condition when the key is active.'),
|
|
80
|
+
deprecationMessage: nls.localize('theia/keybinding-schema-updater/deprecation', 'Use `when` clause instead.')
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
anyOf: [
|
|
86
|
+
{ required: ['key'], properties: { key: { $ref: '#/definitions/key' }, } },
|
|
87
|
+
{ required: ['keybinding'], properties: { keybinding: { $ref: '#/definitions/key' } } }
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
allowComments: true,
|
|
93
|
+
allowTrailingCommas: true,
|
|
94
|
+
};
|
|
95
|
+
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
+
import './keymaps-monaco-contribution';
|
|
18
|
+
import '../../src/browser/style/index.css';
|
|
17
19
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
20
|
import { KeymapsService } from './keymaps-service';
|
|
19
21
|
import { KeymapsFrontendContribution } from './keymaps-frontend-contribution';
|
|
20
22
|
import { CommandContribution, MenuContribution } from '@theia/core/lib/common';
|
|
21
23
|
import { KeybindingContribution } from '@theia/core/lib/browser/keybinding';
|
|
22
24
|
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
23
|
-
|
|
24
|
-
import './keymaps-monaco-contribution';
|
|
25
25
|
import { WidgetFactory } from '@theia/core/lib/browser';
|
|
26
26
|
import { KeybindingWidget } from './keybindings-widget';
|
|
27
|
-
|
|
28
|
-
import '
|
|
27
|
+
import { KeybindingSchemaUpdater } from './keybinding-schema-updater';
|
|
28
|
+
import { JsonSchemaContribution } from '@theia/core/lib/browser/json-schema-store';
|
|
29
29
|
|
|
30
30
|
export default new ContainerModule(bind => {
|
|
31
31
|
bind(KeymapsService).toSelf().inSingletonScope();
|
|
@@ -39,4 +39,6 @@ export default new ContainerModule(bind => {
|
|
|
39
39
|
id: KeybindingWidget.ID,
|
|
40
40
|
createWidget: () => context.container.get<KeybindingWidget>(KeybindingWidget),
|
|
41
41
|
})).inSingletonScope();
|
|
42
|
+
bind(KeybindingSchemaUpdater).toSelf().inSingletonScope();
|
|
43
|
+
bind(JsonSchemaContribution).toService(KeybindingSchemaUpdater);
|
|
42
44
|
});
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
18
18
|
import { OpenerService, open, WidgetOpenerOptions, Widget } from '@theia/core/lib/browser';
|
|
19
19
|
import { KeybindingRegistry, KeybindingScope } from '@theia/core/lib/browser/keybinding';
|
|
20
|
-
import { Keybinding } from '@theia/core/lib/common/keybinding';
|
|
20
|
+
import { Keybinding, RawKeybinding } from '@theia/core/lib/common/keybinding';
|
|
21
21
|
import { UserStorageUri } from '@theia/userstorage/lib/browser';
|
|
22
22
|
import * as jsoncparser from 'jsonc-parser';
|
|
23
23
|
import { Emitter } from '@theia/core/lib/common/event';
|
|
@@ -85,6 +85,8 @@ export class KeymapsService {
|
|
|
85
85
|
for (const value of json) {
|
|
86
86
|
if (Keybinding.is(value)) {
|
|
87
87
|
keybindings.push(value);
|
|
88
|
+
} else if (RawKeybinding.is(value)) {
|
|
89
|
+
keybindings.push(Keybinding.apiObjectify(value));
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
}
|