import { StandaloneServices, IConfigurationService } from '@codingame/monaco-vscode-api';
import { configurationRegistry } from '@codingame/monaco-vscode-configuration-service-override';
export { getUserConfiguration, onUserConfigurationChange, updateUserConfiguration } from '@codingame/monaco-vscode-configuration-service-override';

configurationRegistry.registerDefaultConfigurations([
    {
        overrides: {
            'editor.codeLens': false,
            'editor.fontSize': 12,
            'editor.maxTokenizationLineLength': 1000,
            'editor.quickSuggestions': false,
            'files.eol': '\n',
            'editor.semanticTokenColorCustomizations': {
                rules: {
                    '*.static': {
                        fontStyle: 'italic'
                    },
                    '*.final.static': {
                        fontStyle: 'italic bold'
                    },
                    '*.readonly': {
                        fontStyle: 'bold'
                    },
                    '*.deprecated': {
                        fontStyle: 'strikethrough'
                    }
                }
            }
        }
    }
]);
function onConfigurationChanged(listener) {
    const configurationService = StandaloneServices.get(IConfigurationService);
    return configurationService.onDidChangeConfiguration(listener);
}
function getConfiguration(language, section = 'editor') {
    const configurationService = StandaloneServices.get(IConfigurationService);
    return configurationService.getValue(section, { overrideIdentifier: language });
}
function registerConfigurations(configurations, validate) {
    configurationRegistry.registerConfigurations(configurations, validate);
}
function registerDefaultConfigurations(defaultConfigurations) {
    configurationRegistry.registerDefaultConfigurations(defaultConfigurations.map((overrides) => ({ overrides })));
}

export { getConfiguration, onConfigurationChanged, registerConfigurations, registerDefaultConfigurations };
