Skip to content
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

Integrate codicons with webviews #136

Merged

Conversation

hoangphamEclipse
Copy link
Contributor

@hoangphamEclipse hoangphamEclipse commented May 3, 2023

This commit adds a reference to the codicons CSS file to enable codicons inside the TraceViewPanel of the vs-code trace extension. It follows the example provided in the vs-code webview sample.

Fixes #89.

Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems right. However, it doesn't fix the missing icon described in #71, i.e. the filter icon is still now show.

Also, should we do the same for the other webviews (e.g. opened traces) in this project?

@hoangphamEclipse
Copy link
Contributor Author

Hi Bernd, I tested the code on my end, I have the filter icons displayed on the DATA_TREE view mentioned in #71.

image

Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works now when running it from the development environment using the launch configuration. However, after building the vsix (yarn vsce:package) and installing it in VsCode using install from vsix, then it doesn't work, i.e. the filter icon is not shown. I suspect that the packaging has to be adapted as well.

@hoangphamEclipse
Copy link
Contributor Author

Looks like it is a known-issue with Codicons. You can read about it here. There is a work-around. I will try to see if that works.

@hoangphamEclipse
Copy link
Contributor Author

Turns out the support for yarn workspace is not quite there yet for vsce package. Will continue to look for work around.

This commit adds a reference to the codicons CSS file to enable
codicons inside the TraceViewPanel of the vs-code trace extension. It
follows the example provided in the vs-code webview sample [1].

[1] https://github.com/microsoft/vscode-extension-samples/tree/main/webview-codicons-sample

Fixes eclipse-cdt-cloud#89.

Signed-off-by: Hoang Thuan Pham <[email protected]>
@hoangphamEclipse
Copy link
Contributor Author

hoangphamEclipse commented May 16, 2023

I used the copy-webpack-plugin to copy the Codicons CSS and font files automatically during the packaging process, so that they are available after the extension is packaged. The files are stored within lib/codicons. Please let me know we need to change file location.

Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. I tested with VsCode and Theia and the icons are now visible.

@hoangphamEclipse hoangphamEclipse merged commit 6d04877 into eclipse-cdt-cloud:master May 16, 2023
@hoangphamEclipse hoangphamEclipse deleted the codicons branch May 16, 2023 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate codicons with webviews
2 participants