function migrate()

in generators/app/generate-colortheme.js [238:285]


function migrate(content, tmThemeFileName, generator) {
    let result = {};
    var theme;
    try {
        theme = plistParser.parse(content);
    } catch (e) {
        throw new Error(tmThemeFileName + " not be parsed: " + e.toString());
    }
    let settings = theme.settings;
    if (Array.isArray(settings)) {
        let colorMap = {};
        for (let entry of settings) {
            let scope = entry.scope;
            if (scope) {
                let parts = scope.split(',').map(p => p.trim());
                if (parts.length > 1) {
                    entry.scope = parts;
                }
            } else {
                var entrySettings = entry.settings;
                let notSupported = [];
                for (let entry in entrySettings) {
                    let mapping = mappings[entry];
                    if (mapping) {
                        for (let newKey of mapping) {
                            colorMap[newKey] = entrySettings[entry];
                        }
                        if (entry !== 'foreground' && entry !== 'background') {
                            delete entrySettings[entry];
                        }
                    } else {
                        notSupported.push(entry);
                    }
                }
                if (notSupported.length > 0) {
                    generator.log('Note: the following theming properties are not supported by VSCode and will be ignored: ' + notSupported.join(', '))
                }
            }
        }
        if (!tmThemeFileName) {
            result.tokenColors = settings;
        } else {
            result.tokenColors = './' + tmThemeFileName;
        }
        result.colors = colorMap;
    }
    return result;
};