microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.71k stars 29.46k forks source link

file icon for webview #224858

Open ykawakamy opened 3 months ago

ykawakamy commented 3 months ago

Currently using FileIcon in extension webview requires a very complicated procedure.

I would like you to provide the functions corresponding to processIconThemeDocument, getIconClasses, and detectLanguageId. Otherwise, add WebviewOptions#useFileIconStyleSheet. if set, FileIcon stylesheets to be automatically embedded in the webview like acquireVsCodeApi.

This issue is related to #191387, but there is no answer to Webview there.

-- Sorry, I'm not good at English.

This is off the topic but... , I'm somtimes confused Webview, WebviewView, WebviewPanel

mjbvz commented 3 months ago

Sorry not sure I understand. Do you mean using the icon for the webview tab ( #90616)? Or using the icon inside the webview content?

ykawakamy commented 3 months ago

inside the webview content(in iframe).

ykawakamy commented 3 months ago

I have created a demo of treeview with FileIcon on webview. (tested it with the default seti icon theme.) https://github.com/ykawakamy/treeview-demo-extension

image

I have reimplemented processIconThemeDocument(toStyleSheet) , getIconClasses(resolveTreeIconClasses), and detectLanguageId.

If these become public APIs, we think we can adapt the webview design to vscode.

ArthurLobopro commented 2 months ago

I think I have the same problem

I have a CodeSnap like extension with Windows window style. I wanted to add the file icon as a Window Icon, but there are no public APIs to do it in VSCode. I would like if there is a way to get file icons

image

vs-code-engineering[bot] commented 4 days ago

Hey @mjbvz, this issue might need further attention.

@ykawakamy, you can help us out by closing this issue if the problem no longer exists, or adding more information.