Closed Stunkymonkey closed 3 months ago
why is this not implemented with ExtensionContext.globalState
/ExtensionContext.globalStorageUri
? Feels for me like the perfect fit.
@equinusocio we could replace https://github.com/material-theme/vsc-material-theme/blob/main/src/core/extension-manager.ts#L47
posix.join(extensionFolderUri.path, USER_CONFIG_FILE_NAME)
with
posix.join(ExtensionContext.globalStorageUri.fsPath, USER_CONFIG_FILE_NAME)
But I think this would be a breaking change. see: #1295
Should not be a breaking change if we write/read the user config from the same place, so in the PR make sure to apply the change in every place we write or read it.
This is an internal mechanic that keeps user settings like theme accent and last installed version.
I can't help so much because I'm not the author of that code and ts is not really my thing. The whole code ts code is not maintained.
@equinusocio I guess the PR already covers all places, where we read and write, because that is the only place USER_CONFIG_FILE_NAME
is used.
Describe the bug On NixOS the extension is placed on a read-only filesystem. So writing for the
user.material-theme.config.json
fails.To Reproduce Steps to reproduce the behavior:
Expected behavior No error message.
Error message
What I tried
material-theme.config.json
touser.material-theme.config.json
jq '.changelog.lastversion = "34.3.1"'
.resulting in
user.material-theme.config.json
Is there a good way you can provide a fix? Do you suggest to patch (/remove) the code for the user config on NixOS? Shouldn't the config be placed into the users home directory?