1 | "use strict";
|
2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5 | 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;
|
6 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7 | };
|
8 | var __metadata = (this && this.__metadata) || function (k, v) {
|
9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10 | };
|
11 | Object.defineProperty(exports, "__esModule", { value: true });
|
12 | exports.QuickCommandFrontendContribution = void 0;
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | const inversify_1 = require("inversify");
|
29 | const common_1 = require("../../common");
|
30 | const common_frontend_contribution_1 = require("../common-frontend-contribution");
|
31 | const quick_command_service_1 = require("./quick-command-service");
|
32 | const quick_input_service_1 = require("./quick-input-service");
|
33 | let QuickCommandFrontendContribution = class QuickCommandFrontendContribution {
|
34 | registerCommands(commands) {
|
35 | commands.registerCommand(quick_command_service_1.quickCommand, {
|
36 | execute: () => {
|
37 | var _a;
|
38 | (_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.open('>');
|
39 | }
|
40 | });
|
41 | commands.registerCommand(quick_command_service_1.CLEAR_COMMAND_HISTORY, {
|
42 | execute: () => commands.clearCommandHistory(),
|
43 | });
|
44 | }
|
45 | registerMenus(menus) {
|
46 | menus.registerMenuAction(common_frontend_contribution_1.CommonMenus.VIEW_PRIMARY, {
|
47 | commandId: quick_command_service_1.quickCommand.id,
|
48 | label: common_1.nls.localizeByDefault('Command Palette...')
|
49 | });
|
50 | }
|
51 | registerKeybindings(keybindings) {
|
52 | keybindings.registerKeybinding({
|
53 | command: quick_command_service_1.quickCommand.id,
|
54 | keybinding: 'f1'
|
55 | });
|
56 | keybindings.registerKeybinding({
|
57 | command: quick_command_service_1.quickCommand.id,
|
58 | keybinding: 'ctrlcmd+shift+p'
|
59 | });
|
60 | }
|
61 | };
|
62 | __decorate([
|
63 | (0, inversify_1.inject)(quick_input_service_1.QuickInputService),
|
64 | (0, inversify_1.optional)(),
|
65 | __metadata("design:type", Object)
|
66 | ], QuickCommandFrontendContribution.prototype, "quickInputService", void 0);
|
67 | __decorate([
|
68 | (0, inversify_1.inject)(quick_command_service_1.QuickCommandService),
|
69 | (0, inversify_1.optional)(),
|
70 | __metadata("design:type", quick_command_service_1.QuickCommandService)
|
71 | ], QuickCommandFrontendContribution.prototype, "quickCommandService", void 0);
|
72 | QuickCommandFrontendContribution = __decorate([
|
73 | (0, inversify_1.injectable)()
|
74 | ], QuickCommandFrontendContribution);
|
75 | exports.QuickCommandFrontendContribution = QuickCommandFrontendContribution;
|
76 |
|
\ | No newline at end of file |