-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file icon for webview #224858
Comments
Sorry not sure I understand. Do you mean using the icon for the webview tab ( #90616)? Or using the icon inside the webview content? |
inside the webview content(in iframe). |
I have created a demo of treeview with FileIcon on webview. I have reimplemented processIconThemeDocument(toStyleSheet) , getIconClasses(resolveTreeIconClasses), and detectLanguageId. If these become public APIs, we think we can adapt the webview design to vscode. |
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. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
Currently using FileIcon in extension webview requires a very complicated procedure.
Get the active IconTheme with
vscode.workspace.getConfiguration("workbench").get<string>("iconTheme")
.Scan vscode.extensions.all to find the active IconTheme extension.
Generate css rules from the active IconTheme.
equivalent to processIconThemeDocument.
It is necessary to set asWebViewUri of IconTheme as Uri of Font.
Set WebviewOptions#localResourceRoots to the on-disk URI of the active IconTheme extension.
Resolve Icon Class from Uri and ThemeIcon.
equivalent to getIconClasses
Currently, since the detectLanguageId is not public, it is possible to use
vscode.workspace.openDocument
as a substitute, but it is extremely slow.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
The text was updated successfully, but these errors were encountered: