import { __decorate, __metadata } from "tslib";
import { Autowired } from '@opensumi/di';
import { CommandContribution, Domain, PreferenceProvider, PreferenceScope, } from '@opensumi/ide-core-browser';
/**
 * 内置一些 commands 来调用内部的 service
 */
var CODEBLITZ_COMMANDS;
(function (CODEBLITZ_COMMANDS) {
    const CATEGORY = 'alex';
    // 提供更改和获取默认偏好设置的能力，这个无法通过 extension 实现
    CODEBLITZ_COMMANDS.GET_DEFAULT_PREFERENCE = {
        id: 'alex.getDefaultPreference',
        category: CATEGORY,
    };
    CODEBLITZ_COMMANDS.SET_DEFAULT_PREFERENCE = {
        id: 'alex.setDefaultPreference',
        category: CATEGORY,
    };
})(CODEBLITZ_COMMANDS || (CODEBLITZ_COMMANDS = {}));
let CodeBlitzCommandContribution = class CodeBlitzCommandContribution {
    registerCommands(registry) {
        registry.registerCommand(CODEBLITZ_COMMANDS.GET_DEFAULT_PREFERENCE, {
            execute: (preferenceName, resourceUri, language) => {
                return this.defaultPreference.get(preferenceName, resourceUri, language);
            },
        });
        registry.registerCommand(CODEBLITZ_COMMANDS.SET_DEFAULT_PREFERENCE, {
            execute: (preferenceName, value, resourceUri, language) => {
                return this.defaultPreference.setPreference(preferenceName, value, resourceUri, language);
            },
        });
        // TODO OpenSumi 内加入命令
        ['workbench.action.closePanel', 'workbench.action.closeSidebar', 'vscode.setEditorLayout'].map((id) => registry.registerCommand({ id }, { execute: () => { } }));
    }
};
__decorate([
    Autowired(PreferenceProvider, { tag: PreferenceScope.Default }),
    __metadata("design:type", PreferenceProvider)
], CodeBlitzCommandContribution.prototype, "defaultPreference", void 0);
CodeBlitzCommandContribution = __decorate([
    Domain(CommandContribution)
], CodeBlitzCommandContribution);
export { CodeBlitzCommandContribution };
//# sourceMappingURL=commands.js.map