Skip to content

Commit 51a15de

Browse files
committed
update seti theme. fixes microsoft#118912
1 parent 7f43e5c commit 51a15de

File tree

3 files changed

+302
-277
lines changed

3 files changed

+302
-277
lines changed

extensions/theme-seti/build/update-icon-theme.js

+28-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,16 @@ function darkenColor(color) {
182182
return res;
183183
}
184184

185+
function mergeMapping(to, from, property) {
186+
if (from[property]) {
187+
if (to[property]) {
188+
to[property].push(...from[property]);
189+
} else {
190+
to[property] = from[property];
191+
}
192+
}
193+
}
194+
185195
function getLanguageMappings() {
186196
let langMappings = {};
187197
let allExtensions = fs.readdirSync('..');
@@ -204,7 +214,22 @@ function getLanguageMappings() {
204214
if (Array.isArray(filenames)) {
205215
mapping.fileNames = filenames.map(function (f) { return f.toLowerCase(); });
206216
}
207-
langMappings[languageId] = mapping;
217+
let existing = langMappings[languageId];
218+
219+
if (existing) {
220+
// multiple contributions to the same language
221+
// give preference to the contribution wth the configuration
222+
if (languages[k].configuration) {
223+
mergeMapping(mapping, existing, 'extensions');
224+
mergeMapping(mapping, existing, 'fileNames');
225+
langMappings[languageId] = mapping;
226+
} else {
227+
mergeMapping(existing, mapping, 'extensions');
228+
mergeMapping(existing, mapping, 'fileNames');
229+
}
230+
} else {
231+
langMappings[languageId] = mapping;
232+
}
208233
}
209234
}
210235
}
@@ -216,6 +241,8 @@ function getLanguageMappings() {
216241
return langMappings;
217242
}
218243

244+
245+
219246
exports.copyFont = function () {
220247
return downloadBinary(font, './icons/seti.woff');
221248
};

extensions/theme-seti/icons/seti.woff

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)