From 7b4d4fa4ace2c8f0be283be9624c48d5f2d4f5dc Mon Sep 17 00:00:00 2001 From: Remco van Hooff Date: Sun, 8 Dec 2024 00:50:52 +0100 Subject: [PATCH] Add symbols.defaultAssociations option to allow users to exclude default associations --- package.json | 5 +++++ src/lib/config.js | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/package.json b/package.json index b8f522c..6511e7b 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,11 @@ "default": false, "description": "Hide arrow icons in the explorer section." }, + "symbols.defaultAssociations": { + "type": "boolean", + "default": true, + "description": "Include a set of predefined file and folder associations." + }, "symbols.folders.associations": { "type": "object", "default": {}, diff --git a/src/lib/config.js b/src/lib/config.js index 4031d2f..ed01323 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -55,6 +55,15 @@ function themeJSONToConfig(themeDef) { function updateConfig(config) { const themeJSON = getSoureFile(); + const useDefaultAssociations = vscode.workspace.getConfiguration("symbols").get("defaultAssociations", true); + log.info(`🤖 symbols.defaultAssociations changed, updating to ${useDefaultAssociations}`); + if (useDefaultAssociations === false) { + themeJSON.fileExtensions = {}; + themeJSON.fileNames = {}; + themeJSON.languageIds = {}; + themeJSON.folderNames = {}; + } + for (const key in config) { log.info(`🤖 symbols.${key} changed, updating to ${config[key]}`); const updateHandler = updateThemeJSONHandlers[key];