#7 - Fix for excluding null values

This commit is contained in:
Elio Struyf
2020-03-25 17:50:24 +01:00
parent bd82913ec7
commit 060ffc0591
4 changed files with 12 additions and 4 deletions

2
.vscode/launch.json vendored
View File

@@ -16,7 +16,7 @@
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "npm: webpack"
// "preLaunchTask": "npm: webpack"
},
{
"name": "Extension Tests",

8
.vscode/tasks.json vendored
View File

@@ -15,6 +15,14 @@
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "webpack",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View File

@@ -123,7 +123,7 @@ export class Settings {
crntTags = [...crntTags, ...tags];
// Update the tags and filter out the duplicates
crntTags = [...new Set(crntTags)];
crntTags = crntTags.sort();
crntTags = crntTags.sort().filter(t => !!t);
await config.update(SETTING_TAXONOMY_TAGS, crntTags);
// Retrieve the currently known tags, and add the new ones
@@ -132,7 +132,7 @@ export class Settings {
crntCategories = [...crntCategories, ...categories];
// Update the categories and filter out the duplicates
crntCategories = [...new Set(crntCategories)];
crntCategories = crntCategories.sort();
crntCategories = crntCategories.sort().filter(c => !!c);
await config.update(SETTING_TAXONOMY_CATEGORIES, crntCategories);
// Done

View File

@@ -31,7 +31,7 @@ export class SettingsHelper {
const config = vscode.workspace.getConfiguration(CONFIG_KEY);
const configSetting = type === TaxonomyType.Tag ? SETTING_TAXONOMY_TAGS : SETTING_TAXONOMY_CATEGORIES;
options = [...new Set(options)];
options = options.sort();
options = options.sort().filter(o => !!o);
await config.update(configSetting, options);
}
}