import { __decorate, __metadata } from "tslib";
import { Autowired } from '@opensumi/di';
import { Domain, CommandContribution, PreferenceScope, PreferenceProvider, } from '@opensumi/ide-core-browser';
/**
 * 内置一些 commands 来调用内部的 service
 */
var ALEX_COMMANDS;
(function (ALEX_COMMANDS) {
    const CATEGORY = 'alex';
    // 提供更改和获取默认偏好设置的能力，这个无法通过 extension 实现
    ALEX_COMMANDS.ALEX_GET_DEFAULT_PREFERENCE = {
        id: 'alex.getDefaultPreference',
        category: CATEGORY,
    };
    ALEX_COMMANDS.ALEX_SET_DEFAULT_PREFERENCE = {
        id: 'alex.setDefaultPreference',
        category: CATEGORY,
    };
})(ALEX_COMMANDS || (ALEX_COMMANDS = {}));
let AlexCommandContribution = class AlexCommandContribution {
    registerCommands(registry) {
        registry.registerCommand(ALEX_COMMANDS.ALEX_GET_DEFAULT_PREFERENCE, {
            execute: (preferenceName, resourceUri, language) => {
                return this.defaultPreference.get(preferenceName, resourceUri, language);
            },
        });
        registry.registerCommand(ALEX_COMMANDS.ALEX_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)
], AlexCommandContribution.prototype, "defaultPreference", void 0);
AlexCommandContribution = __decorate([
    Domain(CommandContribution)
], AlexCommandContribution);
export { AlexCommandContribution };
//# sourceMappingURL=commands.js.map