Skip to content

Commit f415eb5

Browse files
committed
fix: removing activeGroup setting from settings list, storing via Memento
1 parent 7cedf87 commit f415eb5

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,11 @@
229229
"order": 14
230230
},
231231
"refactai.activeGroup": {
232-
"type": "object",
232+
"type": ["object", "null"],
233233
"default": null,
234-
"description": "A hidden setting only editable via settings.json",
235-
"scope": "machine-overridable"
234+
"description": "Active selected group in your Team Workspace. Modify via settings.json in your workspace",
235+
"scope": "machine-overridable",
236+
"included": false
236237
}
237238
}
238239
},

src/extension.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ export function activate(context: vscode.ExtensionContext)
308308
});
309309
context.subscriptions.push(settingsCommand);
310310

311-
const activeGroup = vscode.workspace.getConfiguration().get('refactai.activeGroup');
312-
313311
let logout = vscode.commands.registerCommand('refactaicmd.logout', async () => {
314312
context.globalState.update('codifyFirstRun', false);
315313
await vscode.workspace.getConfiguration().update('refactai.apiKey', undefined, vscode.ConfigurationTarget.Global);

src/sidebar.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -816,20 +816,18 @@ export class PanelWebview implements vscode.WebviewViewProvider {
816816
}
817817

818818
async handleSetActiveGroup (group:TeamsGroup) {
819-
await vscode.workspace.getConfiguration().update(
819+
await this.context.workspaceState.update(
820820
'refactai.activeGroup',
821821
group,
822-
vscode.ConfigurationTarget.Workspace
823822
);
824823
console.log(`[DEBUG]: updated locally active group in ./.vscode/settings.json: `, group);
825824
this.handleSettingsChange();
826825
}
827826

828827
async handleClearActiveGroup () {
829-
await vscode.workspace.getConfiguration().update(
828+
await this.context.workspaceState.update(
830829
'refactai.activeGroup',
831830
undefined,
832-
vscode.ConfigurationTarget.Workspace
833831
);
834832
this.handleSettingsChange();
835833
}
@@ -986,7 +984,7 @@ export class PanelWebview implements vscode.WebviewViewProvider {
986984
const ast = vscode.workspace.getConfiguration()?.get<boolean>("refactai.ast") ?? false;
987985
const apiKey = vscode.workspace.getConfiguration()?.get<string>("refactai.apiKey") ?? "";
988986
const addressURL = vscode.workspace.getConfiguration()?.get<string>("refactai.addressURL") ?? "";
989-
const activeTeamsGroup = vscode.workspace.getConfiguration()?.get<TeamsGroup>("refactai.activeGroup") ?? null;
987+
const activeTeamsGroup = this.context.workspaceState.get<TeamsGroup>('refactai.activeGroup') ?? null;
990988
const port = global.rust_binary_blob?.get_port() ?? 8001;
991989
const completeManual = await getKeyBindingForChat("refactaicmd.completionManual");
992990
const shiftEnterToSubmit = vscode.workspace.getConfiguration()?.get<boolean>("refactai.shiftEnterToSubmit")?? false;

0 commit comments

Comments
 (0)