Skip to content

Switch To Using ExtensionContext.globalState to Store Information Rather Than On User's Filesystem #48

@chrstinalin

Description

@chrstinalin

I was curious when (if ever) the workspace arg would be undefined, so I started poking through some VSCode docs. While trying to look up information about vscode.ExtensionContext I found some docs that state (emphasis mine):

ExtensionContext.globalState: A global storage where you can write key/value pairs. VS Code manages the storage and will restore it for each extension activation. You can selectively synchronize key/value pairs in global storage by setting the keys for sync using setKeysForSync method on globalState.

On the surface this seems like it would be preferable to use this over manually reading/writing our own files on the user's filesystem.

Originally posted by @dotproto in #41 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    nice-to-haveFunctionality or features that would be nice to have in Assay.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions