Open wkordalski opened 2 years ago
Thanks for the issue !
I wrote some script to automatically set it, but it looks like monaco miss hc-light
.
Edit: The commit you reference is old, they added it since: https://github.com/microsoft/vscode/blob/964dc545abd63c5f6f6c42755f1c11c2c912a0b5/src/vs/monaco.d.ts#L1091
Here is my script that download the package.json
to correct the converted themes:
const themeObj = {};
const themePackageJson = await (await fetch('https://raw.githubusercontent.com/microsoft/vscode/main/extensions/theme-defaults/package.json')).json();
const themesMetadata = themePackageJson.contributes.themes;
themes.forEach(s => {
themeObj[s.name] = s.theme;
themeObj[s.name].base = themesMetadata.find(t=>path.basename(t.path) == s.filename).uiTheme;
themeObj[s.name].inherit = true;
if(themeObj[s.name].colors === undefined) {
themeObj[s.name].colors = {}; // workaround monaco bug: if not set, will throw "Cannot read properties of undefined (reading 'editor.foreground')"
}
});
This is in Python, but I wrote a script that grabs any themes you want from the vs code extensions github, applying the insight Kuinox shared above, plus resolving parent themes by resolving theme myself into one theme (since monaco does not allow you to use custom configs as a base)
https://gist.github.com/connorjclark/07f9d1751eb26490636e50f7e24d42d3
zip attached if someone just wants the results of the handful of themes I converted -
Monaco theme
base
field is alwaysvs-dark
. But, depending on the theme it may be alsovs
orhc-black
(https://github.com/microsoft/vscode/blob/.../src/vs/monaco.d.ts#L1018). We should at least inform users of this library (in README/docs/etc.), that the users of the library should tweak this field by themselves.This field can be obtained from theme entry in
contributes
section ofpackage.json
file of extension defining the theme. For example, see: https://github.com/microsoft/vscode/blob/.../extensions/theme-defaults/package.json