"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SemanticTokenModifiersContributionPoint = void 0;
const tslib_1 = require("tslib");
const di_1 = require("@opensumi/di");
const ide_core_common_1 = require("@opensumi/ide-core-common");
const semantic_tokens_registry_1 = require("@opensumi/ide-theme/lib/common/semantic-tokens-registry");
const common_1 = require("../../../common");
let SemanticTokenModifiersContributionPoint = class SemanticTokenModifiersContributionPoint extends common_1.VSCodeContributePoint {
    contribute() {
        for (const contrib of this.contributesMap) {
            const { contributes } = contrib;
            if (!Array.isArray(contributes)) {
                this.logger.warn("'configuration.semanticTokenTypes' must be an array");
                return;
            }
            for (const contrib of contributes) {
                if ((0, common_1.validateTypeOrModifier)(contrib, 'semanticTokenModifier', this.logger)) {
                    this.semanticTokenRegistry.registerTokenModifier(contrib.id, contrib.description);
                }
            }
        }
    }
};
exports.SemanticTokenModifiersContributionPoint = SemanticTokenModifiersContributionPoint;
tslib_1.__decorate([
    (0, di_1.Autowired)(ide_core_common_1.ILogger),
    tslib_1.__metadata("design:type", Object)
], SemanticTokenModifiersContributionPoint.prototype, "logger", void 0);
tslib_1.__decorate([
    (0, di_1.Autowired)(semantic_tokens_registry_1.ISemanticTokenRegistry),
    tslib_1.__metadata("design:type", Object)
], SemanticTokenModifiersContributionPoint.prototype, "semanticTokenRegistry", void 0);
exports.SemanticTokenModifiersContributionPoint = SemanticTokenModifiersContributionPoint = tslib_1.__decorate([
    (0, di_1.Injectable)(),
    (0, common_1.Contributes)('semanticTokenModifiers'),
    (0, common_1.LifeCycle)(4 /* LifeCyclePhase.Ready */)
], SemanticTokenModifiersContributionPoint);
//# sourceMappingURL=semanticTokenModifiers.js.map