mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Addressing feedback
This commit is contained in:
@@ -527,8 +527,6 @@ export class Repository implements Disposable {
|
||||
private readonly repository: BaseRepository,
|
||||
globalState: Memento
|
||||
) {
|
||||
const config = workspace.getConfiguration('git');
|
||||
const gitShowStagedChangesResourceGroup = config.get<string>('showStagedChangesResourceGroup');
|
||||
const fsWatcher = workspace.createFileSystemWatcher('**');
|
||||
this.disposables.push(fsWatcher);
|
||||
|
||||
@@ -551,8 +549,11 @@ export class Repository implements Disposable {
|
||||
this._indexGroup = this._sourceControl.createResourceGroup('index', localize('staged changes', "Staged Changes"));
|
||||
this._workingTreeGroup = this._sourceControl.createResourceGroup('workingTree', localize('changes', "Changes"));
|
||||
|
||||
const onConfigListener = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.showStagedChangesResourceGroup'));
|
||||
onConfigListener(this.showStagedChangesResourceGroup, this, this.disposables);
|
||||
this.showStagedChangesResourceGroup();
|
||||
|
||||
this.mergeGroup.hideWhenEmpty = true;
|
||||
this.indexGroup.hideWhenEmpty = !gitShowStagedChangesResourceGroup;
|
||||
|
||||
this.disposables.push(this.mergeGroup);
|
||||
this.disposables.push(this.indexGroup);
|
||||
@@ -651,6 +652,12 @@ export class Repository implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private showStagedChangesResourceGroup(): void {
|
||||
const config = workspace.getConfiguration('git');
|
||||
const gitShowStagedChangesResourceGroup = config.get<string>('showStagedChangesResourceGroup');
|
||||
this.indexGroup.hideWhenEmpty = !gitShowStagedChangesResourceGroup;
|
||||
}
|
||||
|
||||
@throttle
|
||||
async status(): Promise<void> {
|
||||
await this.run(Operation.Status);
|
||||
|
||||
Reference in New Issue
Block a user