
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(3235, "Breadcrumb Navigation")),
    order: 101,
    type: "object",
    properties: {
        "breadcrumbs.enabled": {
            description: ( localize(3236, "Enable/disable navigation breadcrumbs.")),
            type: "boolean",
            default: true,
            agentsWindow: {
                default: false
            }
        },
        "breadcrumbs.filePath": {
            description: ( localize(
                3237,
                "Controls whether and how file paths are shown in the breadcrumbs view."
            )),
            type: "string",
            default: "on",
            enum: ["on", "off", "last"],
            enumDescriptions: [( localize(3238, "Show the file path in the breadcrumbs view.")), ( localize(3239, "Do not show the file path in the breadcrumbs view.")), ( localize(
                3240,
                "Only show the last element of the file path in the breadcrumbs view."
            ))]
        },
        "breadcrumbs.symbolPath": {
            description: ( localize(
                3241,
                "Controls whether and how symbols are shown in the breadcrumbs view."
            )),
            type: "string",
            default: "on",
            enum: ["on", "off", "last"],
            enumDescriptions: [( localize(3242, "Show all symbols in the breadcrumbs view.")), ( localize(3243, "Do not show symbols in the breadcrumbs view.")), ( localize(3244, "Only show the current symbol in the breadcrumbs view."))]
        },
        "breadcrumbs.symbolSortOrder": {
            description: ( localize(3245, "Controls how symbols are sorted in the breadcrumbs outline view.")),
            type: "string",
            default: "position",
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            enum: ["position", "name", "type"],
            enumDescriptions: [( localize(3246, "Show symbol outline in file position order.")), ( localize(3247, "Show symbol outline in alphabetical order.")), ( localize(3248, "Show symbol outline in symbol type order."))]
        },
        "breadcrumbs.icons": {
            description: ( localize(3249, "Render breadcrumb items with icons.")),
            type: "boolean",
            default: true
        },
        "breadcrumbs.symbolPathSeparator": {
            description: ( localize(3250, "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(3251, "When enabled breadcrumbs show `file`-symbols."))
        },
        "breadcrumbs.showModules": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3252, "When enabled breadcrumbs show `module`-symbols."))
        },
        "breadcrumbs.showNamespaces": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3253, "When enabled breadcrumbs show `namespace`-symbols."))
        },
        "breadcrumbs.showPackages": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3254, "When enabled breadcrumbs show `package`-symbols."))
        },
        "breadcrumbs.showClasses": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3255, "When enabled breadcrumbs show `class`-symbols."))
        },
        "breadcrumbs.showMethods": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3256, "When enabled breadcrumbs show `method`-symbols."))
        },
        "breadcrumbs.showProperties": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3257, "When enabled breadcrumbs show `property`-symbols."))
        },
        "breadcrumbs.showFields": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3258, "When enabled breadcrumbs show `field`-symbols."))
        },
        "breadcrumbs.showConstructors": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3259, "When enabled breadcrumbs show `constructor`-symbols."))
        },
        "breadcrumbs.showEnums": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3260, "When enabled breadcrumbs show `enum`-symbols."))
        },
        "breadcrumbs.showInterfaces": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3261, "When enabled breadcrumbs show `interface`-symbols."))
        },
        "breadcrumbs.showFunctions": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3262, "When enabled breadcrumbs show `function`-symbols."))
        },
        "breadcrumbs.showVariables": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3263, "When enabled breadcrumbs show `variable`-symbols."))
        },
        "breadcrumbs.showConstants": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3264, "When enabled breadcrumbs show `constant`-symbols."))
        },
        "breadcrumbs.showStrings": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3265, "When enabled breadcrumbs show `string`-symbols."))
        },
        "breadcrumbs.showNumbers": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3266, "When enabled breadcrumbs show `number`-symbols."))
        },
        "breadcrumbs.showBooleans": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3267, "When enabled breadcrumbs show `boolean`-symbols."))
        },
        "breadcrumbs.showArrays": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3268, "When enabled breadcrumbs show `array`-symbols."))
        },
        "breadcrumbs.showObjects": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3269, "When enabled breadcrumbs show `object`-symbols."))
        },
        "breadcrumbs.showKeys": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3270, "When enabled breadcrumbs show `key`-symbols."))
        },
        "breadcrumbs.showNull": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3271, "When enabled breadcrumbs show `null`-symbols."))
        },
        "breadcrumbs.showEnumMembers": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3272, "When enabled breadcrumbs show `enumMember`-symbols."))
        },
        "breadcrumbs.showStructs": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3273, "When enabled breadcrumbs show `struct`-symbols."))
        },
        "breadcrumbs.showEvents": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3274, "When enabled breadcrumbs show `event`-symbols."))
        },
        "breadcrumbs.showOperators": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3275, "When enabled breadcrumbs show `operator`-symbols."))
        },
        "breadcrumbs.showTypeParameters": {
            type: "boolean",
            default: true,
            scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,
            markdownDescription: ( localize(3276, "When enabled breadcrumbs show `typeParameter`-symbols."))
        }
    }
});

export { BreadcrumbsConfig, BreadcrumbsService };
