Open wudicom520 opened 3 weeks ago
If you are not using the theme and textmate service overrides, using monaco.editor.defineTheme
is perfectly fine
updateUserConfiguration
allows to update the user configuration, it has nothing to do with the color theme
if you are using the textmate and theme service overrides, themes are registered by VSCode extensions. You need one to register your custom theme. Either by using an existing extension vsix
file, or programmatically:
import { ExtensionHostKind, registerExtension } from 'vscode/extensions'
const { registerFileUrl } = registerExtension({
name: 'myTheme',
publisher: 'me',
version: '1.0.0',
engines: {
vscode: '*'
},
contributes: {
themes: [
{
id: "My Theme Id",
label: "My Theme Name",
uiTheme: "vs-dark",
path: "./themes/mytheme.json",
}
]
}
)
// The theme content can be registered using its content via a base64 urls
registerFileUrl('./themes/mytheme.json', 'data:text/javascript;base64,' + window.btoa(JSON.stringify(themeJsonContent)))
// Or reference a json file from the disk
registerFileUrl('./themes/mytheme.json', new URL('./the/file/on/the/disk.json', import.meta.url))
I am using Vite+Vue3 The latest monaco-vscode-api package used
I read #465 ,but I'm confused.
Yes, this way I can configure some font operations. What if I want to configure my own defined theme The original method of using Monaco was relatively simple, eg
Of course, I made some attempts but it didn't work. e.g
I admit that my programming ability is weak, and I hope you can provide beginners with a rich set of operation and learning documents.
I read #517 Benefiting greatly But it's been several days now and there hasn't been any progress.
Thanks