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

refactor(workspace-tree): Future proof icon path resolution #424

Merged

Conversation

cwahbong
Copy link
Contributor

@cwahbong cwahbong commented Oct 24, 2024

Current resource path resolution is using the source file as the base directory, this would fail if we minify the package into single js.

Use extension path as the base directory is more reliable: it is also working for the current packaging, and we just have to make sure the resource layout of the minified package remains the same.

An enum is provided with a test looping through all value and checking the existence of the icon files in extension.

@cwahbong
Copy link
Contributor Author

This fixes the icon issues happened in #421.

@cwahbong cwahbong force-pushed the extension-resource-path-fix branch from 7ee6502 to 70d494d Compare October 24, 2024 16:01
…ied pakcage

Current resource path resolution is using the source file as the base
directory, this would fail if we minify the package into single js.

Use extension path as the base directory is more reliable: it is also
working for the current packaging, and we just have to make sure the
resource layout of the minified package remains the same.

An enum is provided with a test looping through all value and checking
the existance of the icon files in extension.
@cwahbong cwahbong force-pushed the extension-resource-path-fix branch from 70d494d to e3a38f7 Compare October 24, 2024 16:05
src/workspace-tree/bazel_package_tree_item.ts Outdated Show resolved Hide resolved
src/workspace-tree/icons.ts Outdated Show resolved Hide resolved
src/workspace-tree/icons.ts Show resolved Hide resolved
test/resources.test.ts Show resolved Hide resolved
@cwahbong cwahbong requested a review from vogelsgesang October 24, 2024 20:27
@vogelsgesang vogelsgesang merged commit 0bb1fe3 into bazel-contrib:master Oct 24, 2024
1 check passed
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.

2 participants