Reputation: 1723
I'm trying to create an extension that have two commands Activate and Deactivate. My question is: how to make it persist, so when I restart the editor the extension will remember if it is active or inactive?
One idea that come into my mind is to set a Boolean variable on configuration that I can change by commands and check it every time the editor starts, but it not seems a good approach.
Upvotes: 0
Views: 135
Reputation: 2072
Take a look at ExtensionContext. The workspaceState property persists extension-specific data on a per-workspace basis, while the globalState property persists extension-specific data regardless of the workspace.
Upvotes: 2