"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SemanticTokenTypesContributionPoint = void 0;
const tslib_1 = require("tslib");
const di_1 = require("@opensumi/di");
const logger_1 = require("@opensumi/ide-core-browser/lib/logger");
const semantic_tokens_registry_1 = require("@opensumi/ide-theme/lib/common/semantic-tokens-registry");
const common_1 = require("../../../common");
let SemanticTokenTypesContributionPoint = class SemanticTokenTypesContributionPoint 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, 'semanticTokenType', this.logger)) {
                    this.semanticTokenRegistry.registerTokenType(contrib.id, contrib.description, contrib.superType);
                }
            }
        }
    }
};
exports.SemanticTokenTypesContributionPoint = SemanticTokenTypesContributionPoint;
tslib_1.__decorate([
    (0, di_1.Autowired)(logger_1.ILogger),
    tslib_1.__metadata("design:type", Object)
], SemanticTokenTypesContributionPoint.prototype, "logger", void 0);
tslib_1.__decorate([
    (0, di_1.Autowired)(semantic_tokens_registry_1.ISemanticTokenRegistry),
    tslib_1.__metadata("design:type", Object)
], SemanticTokenTypesContributionPoint.prototype, "semanticTokenRegistry", void 0);
exports.SemanticTokenTypesContributionPoint = SemanticTokenTypesContributionPoint = tslib_1.__decorate([
    (0, di_1.Injectable)(),
    (0, common_1.Contributes)('semanticTokenTypes'),
    (0, common_1.LifeCycle)(4 /* LifeCyclePhase.Ready */)
], SemanticTokenTypesContributionPoint);
//# sourceMappingURL=semanticTokenTypes.js.map