import { Emitter } from '../../../../base/common/event.js';
import { localizeWithPath } from '../../../../nls.js';
import { Extensions, ConfigurationScope } from '../../../../platform/configuration/common/configurationRegistry.js';
import '../../../../platform/instantiation/common/extensions.js';
import { Registry } from '../../../../platform/registry/common/platform.js';
import '../../../../platform/instantiation/common/instantiation.js';
const _moduleId = "vs/workbench/browser/parts/editor/breadcrumbs";
class BreadcrumbsService {
    constructor() {
        this._map = ( (new Map()));
    }
    register(group, widget) {
        if (( (this._map.has(group)))) {
            throw ( (new Error(`group (${group}) has already a widget`)));
        }
        this._map.set(group, widget);
        return {
            dispose: () => this._map.delete(group)
        };
    }
    getWidget(group) {
        return this._map.get(group);
    }
}
class BreadcrumbsConfig {
    constructor() {
    }
    static { this.IsEnabled = BreadcrumbsConfig._stub('breadcrumbs.enabled'); }
    static { this.UseQuickPick = BreadcrumbsConfig._stub('breadcrumbs.useQuickPick'); }
    static { this.FilePath = BreadcrumbsConfig._stub('breadcrumbs.filePath'); }
    static { this.SymbolPath = BreadcrumbsConfig._stub('breadcrumbs.symbolPath'); }
    static { this.SymbolSortOrder = BreadcrumbsConfig._stub('breadcrumbs.symbolSortOrder'); }
    static { this.Icons = BreadcrumbsConfig._stub('breadcrumbs.icons'); }
    static { this.TitleScrollbarSizing = BreadcrumbsConfig._stub('workbench.editor.titleScrollbarSizing'); }
    static { this.FileExcludes = BreadcrumbsConfig._stub('files.exclude'); }
    static _stub(name) {
        return {
            bindTo(service) {
                const onDidChange = ( (new Emitter()));
                const listener = service.onDidChangeConfiguration(e => {
                    if (e.affectsConfiguration(name)) {
                        onDidChange.fire(undefined);
                    }
                });
                return new (class {
                    constructor() {
                        this.name = name;
                        this.onDidChange = onDidChange.event;
                    }
                    getValue(overrides) {
                        if (overrides) {
                            return service.getValue(name, overrides);
                        }
                        else {
                            return service.getValue(name);
                        }
                    }
                    updateValue(newValue, overrides) {
                        if (overrides) {
                            return service.updateValue(name, newValue, overrides);
                        }
                        else {
                            return service.updateValue(name, newValue);
                        }
                    }
                    dispose() {
                        listener.dispose();
                        onDidChange.dispose();
                    }
                });
            }
        };
    }
}
( (Registry.as(Extensions.Configuration))).registerConfiguration({
    id: 'breadcrumbs',
    title: ( localizeWithPath(_moduleId, 0, "Breadcrumb Navigation")),
    order: 101,
    type: 'object',
    properties: {
        'breadcrumbs.enabled': {
            description: ( localizeWithPath(_moduleId, 1, "Enable/disable navigation breadcrumbs.")),
            type: 'boolean',
            default: true
        },
        'breadcrumbs.filePath': {
            description: ( localizeWithPath(
                _moduleId,
                2,
                "Controls whether and how file paths are shown in the breadcrumbs view."
            )),
            type: 'string',
            default: 'on',
            enum: ['on', 'off', 'last'],
            enumDescriptions: [
                ( localizeWithPath(_moduleId, 3, "Show the file path in the breadcrumbs view.")),
                ( localizeWithPath(_moduleId, 4, "Do not show the file path in the breadcrumbs view.")),
                ( localizeWithPath(
                    _moduleId,
                    5,
                    "Only show the last element of the file path in the breadcrumbs view."
                )),
            ]
        },
        'breadcrumbs.symbolPath': {
            description: ( localizeWithPath(
                _moduleId,
                6,
                "Controls whether and how symbols are shown in the breadcrumbs view."
            )),
            type: 'string',
            default: 'on',
            enum: ['on', 'off', 'last'],
            enumDescriptions: [
                ( localizeWithPath(_moduleId, 7, "Show all symbols in the breadcrumbs view.")),
                ( localizeWithPath(_moduleId, 8, "Do not show symbols in the breadcrumbs view.")),
                ( localizeWithPath(_moduleId, 9, "Only show the current symbol in the breadcrumbs view.")),
            ]
        },
        'breadcrumbs.symbolSortOrder': {
            description: ( localizeWithPath(
                _moduleId,
                10,
                "Controls how symbols are sorted in the breadcrumbs outline view."
            )),
            type: 'string',
            default: 'position',
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            enum: ['position', 'name', 'type'],
            enumDescriptions: [
                ( localizeWithPath(_moduleId, 11, "Show symbol outline in file position order.")),
                ( localizeWithPath(_moduleId, 12, "Show symbol outline in alphabetical order.")),
                ( localizeWithPath(_moduleId, 13, "Show symbol outline in symbol type order.")),
            ]
        },
        'breadcrumbs.icons': {
            description: ( localizeWithPath(_moduleId, 14, "Render breadcrumb items with icons.")),
            type: 'boolean',
            default: true
        },
        'breadcrumbs.showFiles': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 15, "When enabled breadcrumbs show `file`-symbols."))
        },
        'breadcrumbs.showModules': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 16, "When enabled breadcrumbs show `module`-symbols."))
        },
        'breadcrumbs.showNamespaces': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 17, "When enabled breadcrumbs show `namespace`-symbols."))
        },
        'breadcrumbs.showPackages': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 18, "When enabled breadcrumbs show `package`-symbols."))
        },
        'breadcrumbs.showClasses': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 19, "When enabled breadcrumbs show `class`-symbols."))
        },
        'breadcrumbs.showMethods': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 20, "When enabled breadcrumbs show `method`-symbols."))
        },
        'breadcrumbs.showProperties': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 21, "When enabled breadcrumbs show `property`-symbols."))
        },
        'breadcrumbs.showFields': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 22, "When enabled breadcrumbs show `field`-symbols."))
        },
        'breadcrumbs.showConstructors': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 23, "When enabled breadcrumbs show `constructor`-symbols."))
        },
        'breadcrumbs.showEnums': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 24, "When enabled breadcrumbs show `enum`-symbols."))
        },
        'breadcrumbs.showInterfaces': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 25, "When enabled breadcrumbs show `interface`-symbols."))
        },
        'breadcrumbs.showFunctions': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 26, "When enabled breadcrumbs show `function`-symbols."))
        },
        'breadcrumbs.showVariables': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 27, "When enabled breadcrumbs show `variable`-symbols."))
        },
        'breadcrumbs.showConstants': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 28, "When enabled breadcrumbs show `constant`-symbols."))
        },
        'breadcrumbs.showStrings': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 29, "When enabled breadcrumbs show `string`-symbols."))
        },
        'breadcrumbs.showNumbers': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 30, "When enabled breadcrumbs show `number`-symbols."))
        },
        'breadcrumbs.showBooleans': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 31, "When enabled breadcrumbs show `boolean`-symbols."))
        },
        'breadcrumbs.showArrays': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 32, "When enabled breadcrumbs show `array`-symbols."))
        },
        'breadcrumbs.showObjects': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 33, "When enabled breadcrumbs show `object`-symbols."))
        },
        'breadcrumbs.showKeys': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 34, "When enabled breadcrumbs show `key`-symbols."))
        },
        'breadcrumbs.showNull': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 35, "When enabled breadcrumbs show `null`-symbols."))
        },
        'breadcrumbs.showEnumMembers': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 36, "When enabled breadcrumbs show `enumMember`-symbols."))
        },
        'breadcrumbs.showStructs': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 37, "When enabled breadcrumbs show `struct`-symbols."))
        },
        'breadcrumbs.showEvents': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 38, "When enabled breadcrumbs show `event`-symbols."))
        },
        'breadcrumbs.showOperators': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 39, "When enabled breadcrumbs show `operator`-symbols."))
        },
        'breadcrumbs.showTypeParameters': {
            type: 'boolean',
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localizeWithPath(_moduleId, 40, "When enabled breadcrumbs show `typeParameter`-symbols."))
        }
    }
});
export { BreadcrumbsConfig, BreadcrumbsService };
