"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MenuExtendContributionPoint = void 0;
const tslib_1 = require("tslib");
const di_1 = require("@opensumi/di");
const next_1 = require("@opensumi/ide-core-browser/lib/menu/next");
const common_1 = require("../../../common");
let MenuExtendContributionPoint = class MenuExtendContributionPoint extends common_1.VSCodeContributePoint {
    contribute() {
        for (const contrib of this.contributesMap) {
            const { extensionId, contributes } = contrib;
            for (const menuPosition of Object.keys(contributes)) {
                const menuActions = contributes[menuPosition];
                this.addDispose(this.menuRegistry.registerMenuExtendInfo(menuPosition, menuActions.map((extendInfo) => {
                    var _a;
                    return ({
                        ...extendInfo,
                        extraDesc: this.getLocalizeFromNlsJSON((_a = extendInfo === null || extendInfo === void 0 ? void 0 : extendInfo.extraDesc) !== null && _a !== void 0 ? _a : '', extensionId),
                    });
                })));
            }
        }
    }
};
exports.MenuExtendContributionPoint = MenuExtendContributionPoint;
tslib_1.__decorate([
    (0, di_1.Autowired)(next_1.IMenuRegistry),
    tslib_1.__metadata("design:type", next_1.IMenuRegistry)
], MenuExtendContributionPoint.prototype, "menuRegistry", void 0);
exports.MenuExtendContributionPoint = MenuExtendContributionPoint = tslib_1.__decorate([
    (0, di_1.Injectable)(),
    (0, common_1.Contributes)('menu-extend'),
    (0, common_1.LifeCycle)(3 /* LifeCyclePhase.Starting */)
], MenuExtendContributionPoint);
//# sourceMappingURL=menu-extend.js.map