Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to exclude default associations #266

Merged
merged 2 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
"default": false,
"description": "Hide arrow icons in the explorer section."
},
"symbols.defaultAssociations": {
"type": "boolean",
"default": true,
"description": "Allows you to use the default icons for files and folders or disable them and specify your own via symbols.files.associations and symbols.folders.associations."
},
"symbols.folders.associations": {
"type": "object",
"default": {},
Expand Down
9 changes: 9 additions & 0 deletions src/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Loading