[英]VSCode extension api – file type/extension icons using ThemeIcon
We are building an extension that visualizes some data for workspace files in our view using a class derived from TreeDataProvider
.我们正在构建一个扩展,它使用从
TreeDataProvider
派生的类在我们的视图中可视化工作区文件的一些数据。 We wonder if there is a way to use file icons contributed by the current File Icons Theme for our custom tree items.我们想知道是否有一种方法可以将当前文件图标主题贡献的文件图标用于我们的自定义树项目。 Base icon class has a field
icon: ThemeIcon
which supports product icons.基础图标类有一个字段
icon: ThemeIcon
支持产品图标的icon: ThemeIcon
。 Wonder if something similar exists for referring to file-type icons?想知道是否存在用于引用文件类型图标的类似内容?
Thanks谢谢
Seems like using resourceUri
and ThemeIcon.File
is the way to do it:似乎使用
resourceUri
和ThemeIcon.File
是这样做的方法:
this.iconPath = ThemeIcon.File;
this.resourceUri = Uri.parse('_.js');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.