UNPKG

3.91 kBJavaScriptView Raw
1"use strict";
2var __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};
8var __metadata = (this && this.__metadata) || function (k, v) {
9 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10};
11Object.defineProperty(exports, "__esModule", { value: true });
12exports.QuickCommandFrontendContribution = void 0;
13// *****************************************************************************
14// Copyright (C) 2017 TypeFox and others.
15//
16// This program and the accompanying materials are made available under the
17// terms of the Eclipse Public License v. 2.0 which is available at
18// http://www.eclipse.org/legal/epl-2.0.
19//
20// This Source Code may also be made available under the following Secondary
21// Licenses when the conditions for such availability set forth in the Eclipse
22// Public License v. 2.0 are satisfied: GNU General Public License, version 2
23// with the GNU Classpath Exception which is available at
24// https://www.gnu.org/software/classpath/license.html.
25//
26// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
27// *****************************************************************************
28const inversify_1 = require("inversify");
29const common_1 = require("../../common");
30const common_frontend_contribution_1 = require("../common-frontend-contribution");
31const quick_command_service_1 = require("./quick-command-service");
32const quick_input_service_1 = require("./quick-input-service");
33let 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);
72QuickCommandFrontendContribution = __decorate([
73 (0, inversify_1.injectable)()
74], QuickCommandFrontendContribution);
75exports.QuickCommandFrontendContribution = QuickCommandFrontendContribution;
76//# sourceMappingURL=quick-command-frontend-contribution.js.map
\No newline at end of file