I\'m planning to write a Visual Studio Code extension and it need to save some information for example a counter. The user can press a shortcut to increase or decrease the c
You're probably looking for the Memento API. The ExtensionContext has two different memento instances you can access:
workspaceState
A memento object that stores state in the context of the currently opened workspace.
globalState
A memento object that stores state independent of the current opened workspace.
Both survive VSCode updates to my knowledge.