
import { Emitter } from '../../../../base/common/event.js';
import { localize } 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';

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.SymbolPathSeparator = BreadcrumbsConfig._stub("breadcrumbs.symbolPathSeparator");
    }
    static {
        this.Icons = BreadcrumbsConfig._stub("breadcrumbs.icons");
    }
    static {
        this.TitleScrollbarSizing = BreadcrumbsConfig._stub("workbench.editor.titleScrollbarSizing");
    }
    static {
        this.TitleScrollbarVisibility = BreadcrumbsConfig._stub("workbench.editor.titleScrollbarVisibility");
    }
    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: ( localize(3116, "Breadcrumb Navigation")),
    order: 101,
    type: "object",
    properties: {
        "breadcrumbs.enabled": {
            description: ( localize(3117, "Enable/disable navigation breadcrumbs.")),
            type: "boolean",
            default: true
        },
        "breadcrumbs.filePath": {
            description: ( localize(
                3118,
                "Controls whether and how file paths are shown in the breadcrumbs view."
            )),
            type: "string",
            default: "on",
            enum: ["on", "off", "last"],
            enumDescriptions: [( localize(3119, "Show the file path in the breadcrumbs view.")), ( localize(3120, "Do not show the file path in the breadcrumbs view.")), ( localize(
                3121,
                "Only show the last element of the file path in the breadcrumbs view."
            ))]
        },
        "breadcrumbs.symbolPath": {
            description: ( localize(
                3122,
                "Controls whether and how symbols are shown in the breadcrumbs view."
            )),
            type: "string",
            default: "on",
            enum: ["on", "off", "last"],
            enumDescriptions: [( localize(3123, "Show all symbols in the breadcrumbs view.")), ( localize(3124, "Do not show symbols in the breadcrumbs view.")), ( localize(3125, "Only show the current symbol in the breadcrumbs view."))]
        },
        "breadcrumbs.symbolSortOrder": {
            description: ( localize(3126, "Controls how symbols are sorted in the breadcrumbs outline view.")),
            type: "string",
            default: "position",
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            enum: ["position", "name", "type"],
            enumDescriptions: [( localize(3127, "Show symbol outline in file position order.")), ( localize(3128, "Show symbol outline in alphabetical order.")), ( localize(3129, "Show symbol outline in symbol type order."))]
        },
        "breadcrumbs.icons": {
            description: ( localize(3130, "Render breadcrumb items with icons.")),
            type: "boolean",
            default: true
        },
        "breadcrumbs.symbolPathSeparator": {
            description: ( localize(3131, "The separator used when copying the breadcrumb symbol path.")),
            type: "string",
            default: ".",
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE
        },
        "breadcrumbs.showFiles": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3132, "When enabled breadcrumbs show `file`-symbols."))
        },
        "breadcrumbs.showModules": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3133, "When enabled breadcrumbs show `module`-symbols."))
        },
        "breadcrumbs.showNamespaces": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3134, "When enabled breadcrumbs show `namespace`-symbols."))
        },
        "breadcrumbs.showPackages": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3135, "When enabled breadcrumbs show `package`-symbols."))
        },
        "breadcrumbs.showClasses": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3136, "When enabled breadcrumbs show `class`-symbols."))
        },
        "breadcrumbs.showMethods": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3137, "When enabled breadcrumbs show `method`-symbols."))
        },
        "breadcrumbs.showProperties": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3138, "When enabled breadcrumbs show `property`-symbols."))
        },
        "breadcrumbs.showFields": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3139, "When enabled breadcrumbs show `field`-symbols."))
        },
        "breadcrumbs.showConstructors": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3140, "When enabled breadcrumbs show `constructor`-symbols."))
        },
        "breadcrumbs.showEnums": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3141, "When enabled breadcrumbs show `enum`-symbols."))
        },
        "breadcrumbs.showInterfaces": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3142, "When enabled breadcrumbs show `interface`-symbols."))
        },
        "breadcrumbs.showFunctions": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3143, "When enabled breadcrumbs show `function`-symbols."))
        },
        "breadcrumbs.showVariables": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3144, "When enabled breadcrumbs show `variable`-symbols."))
        },
        "breadcrumbs.showConstants": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3145, "When enabled breadcrumbs show `constant`-symbols."))
        },
        "breadcrumbs.showStrings": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3146, "When enabled breadcrumbs show `string`-symbols."))
        },
        "breadcrumbs.showNumbers": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3147, "When enabled breadcrumbs show `number`-symbols."))
        },
        "breadcrumbs.showBooleans": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3148, "When enabled breadcrumbs show `boolean`-symbols."))
        },
        "breadcrumbs.showArrays": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3149, "When enabled breadcrumbs show `array`-symbols."))
        },
        "breadcrumbs.showObjects": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3150, "When enabled breadcrumbs show `object`-symbols."))
        },
        "breadcrumbs.showKeys": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3151, "When enabled breadcrumbs show `key`-symbols."))
        },
        "breadcrumbs.showNull": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3152, "When enabled breadcrumbs show `null`-symbols."))
        },
        "breadcrumbs.showEnumMembers": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3153, "When enabled breadcrumbs show `enumMember`-symbols."))
        },
        "breadcrumbs.showStructs": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3154, "When enabled breadcrumbs show `struct`-symbols."))
        },
        "breadcrumbs.showEvents": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3155, "When enabled breadcrumbs show `event`-symbols."))
        },
        "breadcrumbs.showOperators": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3156, "When enabled breadcrumbs show `operator`-symbols."))
        },
        "breadcrumbs.showTypeParameters": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3157, "When enabled breadcrumbs show `typeParameter`-symbols."))
        }
    }
});

export { BreadcrumbsConfig, BreadcrumbsService };
