提交 ec0c9f22 编写于 作者: J Joao Moreno

fixes #25281

上级 a9802a92
...@@ -123,6 +123,9 @@ class MainThreadSCMProvider implements ISCMProvider { ...@@ -123,6 +123,9 @@ class MainThreadSCMProvider implements ISCMProvider {
private _onDidChangeCommitTemplate = new Emitter<string>(); private _onDidChangeCommitTemplate = new Emitter<string>();
get onDidChangeCommitTemplate(): Event<string> { return this._onDidChangeCommitTemplate.event; } get onDidChangeCommitTemplate(): Event<string> { return this._onDidChangeCommitTemplate.event; }
private _onDidChangeStatusBarCommands = new Emitter<Command[]>();
get onDidChangeStatusBarCommands(): Event<Command[]> { return this._onDidChangeStatusBarCommands.event; }
private _onDidChange = new Emitter<void>(); private _onDidChange = new Emitter<void>();
get onDidChange(): Event<void> { return this._onDidChange.event; } get onDidChange(): Event<void> { return this._onDidChange.event; }
...@@ -142,6 +145,10 @@ class MainThreadSCMProvider implements ISCMProvider { ...@@ -142,6 +145,10 @@ class MainThreadSCMProvider implements ISCMProvider {
if (typeof features.commitTemplate !== 'undefined') { if (typeof features.commitTemplate !== 'undefined') {
this._onDidChangeCommitTemplate.fire(this.commitTemplate); this._onDidChangeCommitTemplate.fire(this.commitTemplate);
} }
if (typeof features.statusBarCommands !== 'undefined') {
this._onDidChangeStatusBarCommands.fire(this.statusBarCommands);
}
} }
$registerGroup(handle: number, id: string, label: string): void { $registerGroup(handle: number, id: string, label: string): void {
......
...@@ -170,7 +170,7 @@ export class StatusBarController implements IWorkbenchContribution { ...@@ -170,7 +170,7 @@ export class StatusBarController implements IWorkbenchContribution {
this.focusDisposable.dispose(); this.focusDisposable.dispose();
if (repository) { if (repository) {
this.focusDisposable = repository.provider.onDidChange(() => this.render(repository)); this.focusDisposable = repository.provider.onDidChangeStatusBarCommands(() => this.render(repository));
} }
this.render(repository); this.render(repository);
......
...@@ -59,6 +59,7 @@ export interface ISCMProvider extends IDisposable { ...@@ -59,6 +59,7 @@ export interface ISCMProvider extends IDisposable {
readonly count?: number; readonly count?: number;
readonly commitTemplate?: string; readonly commitTemplate?: string;
readonly onDidChangeCommitTemplate?: Event<string>; readonly onDidChangeCommitTemplate?: Event<string>;
readonly onDidChangeStatusBarCommands?: Event<Command[]>;
readonly acceptInputCommand?: Command; readonly acceptInputCommand?: Command;
readonly statusBarCommands?: Command[]; readonly statusBarCommands?: Command[];
readonly onDidChange: Event<void>; readonly onDidChange: Event<void>;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册