Closed SuperSamus closed 7 months ago
VScode only allows files to be loaded from certain root folders (source).
// Define an initial set of roots we allow loading from
// - appRoot : all files installed as part of the app
// - extensions : all files shipped from extensions
// - storage : all files in global and workspace storage (https://github.com/microsoft/vscode/issues/116735)
On NixOS, the extensionsDir is in the Nix store with links to the different extensions (also in the Nix store).
This issue is that the extensions tries to load the file from the extension's folder directly (/nix/store/wls3y80nfld9hln166zw0b1rhssj5wyk-vscode-extension-eamodio-gitlens-2022.12.604
) and not from the extensions folder (something like /nix/store/xxxxx-vscode-extensions
).
If the path of the font is /nix/store/xxxxx-vscode-extensions/share/vscode/extensions/eamodio.gitlens/dist/glicons.woff2
, it should work (/nix/store/xxxxx-vscode-extensions
must be in the authorised folders whereas /nix/store/wls3y80nfld9hln166zw0b1rhssj5wyk-vscode-extension-eamodio-gitlens-2022.12.604
isn't).
Facing this until today. Anyone has workaround for this issue?
pinging @ratsclub as maintainer
@CedricFinance thanks for the research! Do you think this is something we can substitute in our packaging? Or does it require an upstream fix?
I researched into this as well. I am not really sure how @CedricFinance came to his conclusion, that the problem stems from vscode/vscodium not having permissions to load icons from specific places, if I understood him correctly. Neither do I know how we could test this hypothesis.
EDIT: I was stupid. It's because of the error
vscode-file: Refused to load resource /nix/store/kd22v8wj9fv6f33zv2vg3rww8swbgmdv-vscode-extension-eamodio-gitle
ns-2023.10.1105/share/vscode/extensions/eamodio.gitlens/dist/glicons.woff2 from vscode-file: protocol (original URL: vscode-file://vscode-app/ni
x/store/kd22v8wj9fv6f33zv2vg3rww8swbgmdv-vscode-extension-eamodio-gitlens-2023.10.1105/share/vscode/extensions/eamodio.gitlens/dist/glicons.woff
2)
What I noticed, however, is that the github.copilot
extension has the same problem:
Figure 1 |
---|
Missing GitHub-Copilot Icon |
Furthermore, if I go into my /nix/store/XXXXX-vscode-extensions/share/vscode/extensions/
folder and issues the command rg "\"icons\": \{" --max-columns=100 --max-columns-preview=10 ./*
, I get the following output:
./vscjava.vscode-spring-boot-dashboard/package.json
30: "icons": {
./github.copilot/package.json
304: "icons": {
./eamodio.gitlens/package.json
7665: "icons": {
Not sure about the spring-boot-dashboard extension, but it seems like extensions which define this attribute in their package.json
cannot load their icons.
Describe the bug
In VSCode (and Codium), the extension
eamodio.gitlens
is unable to load icons, and uses generic rectangles instead. Opening VSCode/Codium with--verbose
shows:Steps To Reproduce
Steps to reproduce the behavior:
nix-shell -p "vscode-with-extensions.override {vscodeExtensions = [vscode-extensions.eamodio.gitlens];}"
code
.Expected behavior
GitLens should load the icons correctly.
Screenshots
EDIT: Instead of rectangles, the icons are invisible now.
Additional context
Bug also happens with the extension fetched from https://github.com/nix-community/nix-vscode-extensions (both from vscode-marketplace and open-vsx).
The bug doesn't reproduce with
vscode-fhs
.Notify maintainers
Metadata