@codingame/monaco-vscode-scm-service-override 7.1.0 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +62 -95
- package/vscode/src/vs/workbench/contrib/scm/browser/media/scm.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +16 -5
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +112 -164
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +54 -24
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +3 -7
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +598 -380
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.js +2 -3
- package/vscode/src/vs/workbench/contrib/scm/browser/workingSet.js +39 -43
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import './media/scm.css.js';
|
|
3
|
-
import {
|
|
3
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
4
4
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
5
5
|
import { VIEWLET_ID } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm';
|
|
6
6
|
import { ISCMViewService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
@@ -15,7 +15,6 @@ import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/co
|
|
|
15
15
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
16
16
|
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
17
17
|
|
|
18
|
-
const _moduleId = "vs/workbench/contrib/scm/browser/scmViewPaneContainer";
|
|
19
18
|
let SCMViewPaneContainer = class SCMViewPaneContainer extends ViewPaneContainer {
|
|
20
19
|
constructor(scmViewService, layoutService, telemetryService, instantiationService, contextMenuService, themeService, storageService, configurationService, extensionService, contextService, viewDescriptorService) {
|
|
21
20
|
super(VIEWLET_ID, { mergeViewWithContainerWhenSingleView: true }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService);
|
|
@@ -29,7 +28,7 @@ let SCMViewPaneContainer = class SCMViewPaneContainer extends ViewPaneContainer
|
|
|
29
28
|
return 400;
|
|
30
29
|
}
|
|
31
30
|
getTitle() {
|
|
32
|
-
return (
|
|
31
|
+
return ( localize(6356, "Source Control"));
|
|
33
32
|
}
|
|
34
33
|
getActionsContext() {
|
|
35
34
|
return this.scmViewService.visibleRepositories.length === 1 ? this.scmViewService.visibleRepositories[0].provider : undefined;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { Disposable, DisposableMap, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import 'vscode/vscode/vs/base/common/arrays';
|
|
4
|
+
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
5
|
+
import { autorunWithStore, autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
6
|
+
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
7
|
+
import 'vscode/vscode/vs/base/common/cancellation';
|
|
4
8
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
9
|
+
import { observableConfigValue } from 'vscode/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
5
10
|
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
6
11
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
7
12
|
import { getProviderKey } from './util.js';
|
|
@@ -10,62 +15,54 @@ import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor
|
|
|
10
15
|
import { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
11
16
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
12
17
|
|
|
13
|
-
let SCMWorkingSetController = class SCMWorkingSetController {
|
|
18
|
+
let SCMWorkingSetController = class SCMWorkingSetController extends Disposable {
|
|
14
19
|
static { this.ID = 'workbench.contrib.scmWorkingSets'; }
|
|
15
20
|
constructor(configurationService, editorGroupsService, scmService, storageService, layoutService) {
|
|
21
|
+
super();
|
|
16
22
|
this.configurationService = configurationService;
|
|
17
23
|
this.editorGroupsService = editorGroupsService;
|
|
18
24
|
this.scmService = scmService;
|
|
19
25
|
this.storageService = storageService;
|
|
20
26
|
this.layoutService = layoutService;
|
|
27
|
+
this._enabledConfig = observableConfigValue('scm.workingSets.enabled', false, this.configurationService);
|
|
21
28
|
this._repositoryDisposables = ( new DisposableMap());
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.scmService.onDidAddRepository(this._onDidAddRepository, this, this._scmServiceDisposables);
|
|
36
|
-
this.scmService.onDidRemoveRepository(this._onDidRemoveRepository, this, this._scmServiceDisposables);
|
|
37
|
-
for (const repository of this.scmService.repositories) {
|
|
38
|
-
this._onDidAddRepository(repository);
|
|
39
|
-
}
|
|
29
|
+
this._store.add(autorunWithStore((reader, store) => {
|
|
30
|
+
if (!this._enabledConfig.read(reader)) {
|
|
31
|
+
this.storageService.remove('scm.workingSets', StorageScope.WORKSPACE);
|
|
32
|
+
this._repositoryDisposables.clearAndDisposeAll();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this._workingSets = this._loadWorkingSets();
|
|
36
|
+
this.scmService.onDidAddRepository(this._onDidAddRepository, this, store);
|
|
37
|
+
this.scmService.onDidRemoveRepository(this._onDidRemoveRepository, this, store);
|
|
38
|
+
for (const repository of this.scmService.repositories) {
|
|
39
|
+
this._onDidAddRepository(repository);
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
40
42
|
}
|
|
41
43
|
_onDidAddRepository(repository) {
|
|
42
44
|
const disposables = ( new DisposableStore());
|
|
43
|
-
disposables.add(
|
|
44
|
-
|
|
45
|
+
disposables.add(autorun(async (reader) => {
|
|
46
|
+
const historyProvider = repository.provider.historyProvider.read(reader);
|
|
47
|
+
const currentHistoryItemGroupId = historyProvider?.currentHistoryItemGroupId.read(reader);
|
|
48
|
+
if (!currentHistoryItemGroupId) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const providerKey = getProviderKey(repository.provider);
|
|
52
|
+
const repositoryWorkingSets = this._workingSets.get(providerKey);
|
|
53
|
+
if (!repositoryWorkingSets) {
|
|
54
|
+
this._workingSets.set(providerKey, { currentHistoryItemGroupId, editorWorkingSets: ( new Map()) });
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (repositoryWorkingSets.currentHistoryItemGroupId === currentHistoryItemGroupId) {
|
|
45
58
|
return;
|
|
46
59
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const providerKey = getProviderKey(repository.provider);
|
|
52
|
-
const currentHistoryItemGroupId = repository.provider.historyProvider.currentHistoryItemGroup.id;
|
|
53
|
-
const repositoryWorkingSets = this._workingSets.get(providerKey);
|
|
54
|
-
if (!repositoryWorkingSets) {
|
|
55
|
-
this._workingSets.set(providerKey, { currentHistoryItemGroupId, editorWorkingSets: ( new Map()) });
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (repositoryWorkingSets.currentHistoryItemGroupId === currentHistoryItemGroupId) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
this._saveWorkingSet(providerKey, currentHistoryItemGroupId, repositoryWorkingSets);
|
|
62
|
-
await this._restoreWorkingSet(providerKey, currentHistoryItemGroupId);
|
|
63
|
-
}));
|
|
60
|
+
this._saveWorkingSet(providerKey, currentHistoryItemGroupId, repositoryWorkingSets);
|
|
61
|
+
await this._restoreWorkingSet(providerKey, currentHistoryItemGroupId);
|
|
64
62
|
}));
|
|
65
63
|
this._repositoryDisposables.set(repository, disposables);
|
|
66
64
|
}
|
|
67
65
|
_onDidRemoveRepository(repository) {
|
|
68
|
-
this._workingSets.delete(getProviderKey(repository.provider));
|
|
69
66
|
this._repositoryDisposables.deleteAndDispose(repository);
|
|
70
67
|
}
|
|
71
68
|
_loadWorkingSets() {
|
|
@@ -109,8 +106,7 @@ let SCMWorkingSetController = class SCMWorkingSetController {
|
|
|
109
106
|
}
|
|
110
107
|
dispose() {
|
|
111
108
|
this._repositoryDisposables.dispose();
|
|
112
|
-
|
|
113
|
-
this._disposables.dispose();
|
|
109
|
+
super.dispose();
|
|
114
110
|
}
|
|
115
111
|
};
|
|
116
112
|
SCMWorkingSetController = ( __decorate([
|