Skip to content

Commit

Permalink
Allow mirrord to be enabled or disabled by default in settings (#143)
Browse files Browse the repository at this point in the history
* Add mirrord.enabledByDefault setting

* Add changelog
  • Loading branch information
gememma authored Aug 14, 2024
1 parent 61ddb97 commit 5db9e6a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/131.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the option for mirrord to be enabled by default on startup by setting mirrord.enabledByDefault
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@
],
"default": true,
"description": "Automatically update mirrord binary."
},
"mirrord.enabledByDefault": {
"type": [
"boolean"
],
"default": false,
"description": "Enable mirrord by default on startup."
}
}
},
Expand Down
5 changes: 3 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ export let globalContext: vscode.ExtensionContext;
export async function activate(context: vscode.ExtensionContext) {
globalContext = context;

context.workspaceState.update('enabled', false);
const enabled = vscode.workspace.getConfiguration().get<boolean | null>("mirrord.enabledByDefault");
context.workspaceState.update('enabled', enabled);
vscode.debug.registerDebugConfigurationProvider('*', new ConfigurationProvider(), 2);

// start mirrord binary updates, so that we avoid downloading mid session
await getMirrordBinary(true);

Expand Down

0 comments on commit 5db9e6a

Please sign in to comment.