Skip to content

Commit 75ae2b4

Browse files
committed
Refactor configuration update to use Workspace target and enhance CheckoutToCommand constructor; comment out unused mode details logic in StatusBarManager
1 parent 3f0de87 commit 75ae2b4

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@
148148
"Auto stash and apply in new branch"
149149
],
150150
"default": "manual",
151-
"description": "Checkout stash mode"
151+
"description": "Checkout stash mode",
152+
"scope": "resource"
152153
},
153154
"git-smart-checkout.logging.enabled": {
154155
"type": "boolean",

src/commands/checkoutToCommand/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ export const LABEL_CREATE_NEW_BRANCH = `${ICON_PLUS} Create new branch...`;
3838
export const LABEL_CREATE_NEW_BRANCH_FROM = `${ICON_PLUS} Create new branch from...`;
3939

4040
export class CheckoutToCommand extends BaseCommand {
41-
private configManager: ConfigurationManager;
42-
43-
constructor(configManager: ConfigurationManager, logService: LoggingService) {
41+
constructor(
42+
private configManager: ConfigurationManager,
43+
logService: LoggingService
44+
) {
4445
super(logService);
45-
46-
this.configManager = configManager;
4746
this.logService = logService;
4847
}
4948

src/configuration/configurationManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class ConfigurationManager {
4343

4444
public async updateMode(mode: ExtensionConfig['mode']): Promise<void> {
4545
const config = workspace.getConfiguration(EXTENSION_NAME);
46-
await config.update('mode', mode, ConfigurationTarget.Global);
46+
await config.update('mode', mode, ConfigurationTarget.Workspace);
4747
}
4848

4949
public async updateLoggingEnabled(enabled: boolean): Promise<void> {

src/statusBar/statusBarManager.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,18 @@ export class StatusBarManager implements Disposable {
8787
this.loggingService.info(`New mode: ${newMode}, newModeLabel: ${newModeLabel}`);
8888

8989
if (newMode && newMode !== currentMode) {
90-
const modeDetails = AUTO_STASH_MODES_DETAILS[newMode];
90+
// const modeDetails = AUTO_STASH_MODES_DETAILS[newMode];
9191
await this.configManager.updateMode(newMode);
9292
this.updateStatusBar();
9393
this.loggingService.info(`Mode switched to: ${newMode}`);
9494

95-
window
96-
.showInformationMessage(`Extension mode changed to: ${modeDetails.label}`, 'Open Settings')
97-
.then((selection) => {
98-
if (selection === 'Open Settings') {
99-
commands.executeCommand(`${EXTENSION_NAME}.openSettings`);
100-
}
101-
});
95+
// window
96+
// .showInformationMessage(`Extension mode changed to: ${modeDetails.label}`, 'Open Settings')
97+
// .then((selection) => {
98+
// if (selection === 'Open Settings') {
99+
// commands.executeCommand(`${EXTENSION_NAME}.openSettings`);
100+
// }
101+
// });
102102
}
103103
}
104104

0 commit comments

Comments
 (0)