Skip to content

Commit 509724e

Browse files
committed
docs(changeset): better command on statusbar
1 parent 0e54ff3 commit 509724e

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

.changeset/perfect-ravens-nail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"oh-my-commit": patch
3+
---
4+
5+
better command on statusbar

packages/extension/src/managers/orchestrator.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@
88
import { Inject, Service } from "typedi"
99
import vscode from "vscode"
1010

11-
import {
12-
COMMAND_QUICK_COMMIT,
13-
type ICommitManager,
14-
type ILogger,
15-
type IPreference,
16-
type IProviderManager,
17-
type UiMode,
18-
} from "@shared/common"
11+
import { type ICommitManager, type ILogger, type IPreference, type IProviderManager, type UiMode } from "@shared/common"
1912
import type { IGitCommitManager } from "@shared/server"
2013

2114
import type { IVscodeGit } from "@/managers/vscode-git"
@@ -26,7 +19,6 @@ import type { IWebviewManager } from "@/webview/vscode-webview"
2619
import type { IWebviewMessageHandler } from "@/webview/vscode-webview-message-handler"
2720

2821
import type { ICommitMessageStore } from "./commit-message-store"
29-
import { CommandManager } from "./vscode-command-manager"
3022

3123
export interface IOrchestrator {
3224
// 基础服务
@@ -94,8 +86,6 @@ export class Orchestrator implements IOrchestrator {
9486
})
9587
})
9688

97-
this.statusBar.setClickCommand(COMMAND_QUICK_COMMIT)
98-
9989
this.logger.info("Orchestrator initialized")
10090
}
10191

packages/extension/src/managers/vscode-statusbar.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { Inject, Service } from "typedi"
99
import * as vscode from "vscode"
1010

11-
import { APP_NAME, COMMAND_QUICK_COMMIT, COMMAND_SELECT_MODEL, type ILogger } from "@shared/common"
11+
import { APP_NAME, COMMAND_QUICK_COMMIT, type ILogger } from "@shared/common"
1212

1313
import { EventEmitter, IService, type ServiceEvent } from "@/interface/base-service"
1414
import { TOKENS } from "@/managers/vscode-tokens"
@@ -24,7 +24,6 @@ export interface IStatusBarManager extends IService {
2424
clearWaiting(): void
2525
setText(text: string): void
2626
setModel(model: { name: string }): void
27-
setClickCommand(command: string): void
2827
}
2928

3029
@Service()
@@ -40,6 +39,7 @@ export class StatusBarManager extends EventEmitter<StatusBarEvent> implements IS
4039
super()
4140
this.statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 100)
4241
this.statusBarItem.name = APP_NAME
42+
this.statusBarItem.command = COMMAND_QUICK_COMMIT
4343

4444
this.logger.info("Initializing StatusBar...")
4545
this.statusBarItem.text = `$(sync~spin) (Initializing...)`
@@ -53,9 +53,6 @@ export class StatusBarManager extends EventEmitter<StatusBarEvent> implements IS
5353
if (event.data.tooltip) {
5454
this.statusBarItem.tooltip = event.data.tooltip
5555
}
56-
if (event.data.command) {
57-
this.statusBarItem.command = event.data.command
58-
}
5956
})
6057
}
6158

@@ -103,15 +100,6 @@ export class StatusBarManager extends EventEmitter<StatusBarEvent> implements IS
103100
})
104101
}
105102

106-
setClickCommand(command: string): void {
107-
this.emit("status.update", {
108-
type: "status.update",
109-
data: {
110-
command,
111-
},
112-
})
113-
}
114-
115103
dispose(): void {
116104
this.statusBarItem.dispose()
117105
}

0 commit comments

Comments
 (0)