英文:
Is it possible to create a VS Code theme extension using JavaScript or TypeScript instead JSON?
问题
我正在为VS Code创建一个主题扩展。我想知道是否可以使用JavaScript或TypeScript文件而不是JSON文件。我不喜欢整个主题都在一个庞大的JSON文件中,我觉得这很混乱和复杂,而且不支持注释。
英文:
I'm creating a theme extension for vs code. And I wanted to know, if it's possible to use JavaScript or TypeScript files instead of a JSON file. I don't like that the whole theme is inside one huge JSON file. I find it very messy and complicated to handle. And also, it does not accept comments.
答案1
得分: 0
以下是翻译好的部分:
据我所知,主题定义文件需要采用JSON格式(另请参阅https://code.visualstudio.com/api/extension-guides/color-theme#create-a-new-color-theme)。
> 我不喜欢整个主题都在一个巨大的JSON文件中。我觉得这样非常混乱和复杂。而且,它不接受注释。
然后,您可以编写一个脚本/脚本,用于生成最终的JSON文件。有几个主题扩展可以实现这一点。这样做还有其他好处,包括能够进行计算以生成修改后的颜色版本,例如根据另一种颜色的修改来定义一种颜色。
英文:
As far as I know, the theme definition file needs to be in JSON format (see also https://code.visualstudio.com/api/extension-guides/color-theme#create-a-new-color-theme).
> I don't like that the whole theme is inside one huge JSON file. I find it very messy and complicated to handle. And also, it does not accept comments.
Then you can write a script / scripts that produce the final JSON file. There are several theme extensions that do this. There are other benefits to doing this, including then being able to do calculations to produce modified versions of colours, such as defining one colour in terms of modifications on another colour.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论