@codingame/monaco-vscode-scm-service-override 11.1.2 → 12.0.0
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/index.d.ts +2 -1
- package/index.js +22 -1
- package/package.json +24 -7
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +34 -32
- package/vscode/src/vs/workbench/contrib/scm/browser/diff.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/diff.js +93 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/media/scm.css.js +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +31 -32
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +153 -187
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.d.ts +59 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.js +245 -217
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +31 -29
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.js +4 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.d.ts +185 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +365 -336
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.js +17 -16
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js +13 -13
- package/vscode/src/vs/workbench/contrib/scm/browser/workingSet.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/workingSet.js +9 -6
- package/vscode/src/vs/workbench/contrib/scm/common/quickDiffService.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/scm/common/quickDiffService.js +4 -2
- package/vscode/src/vs/workbench/contrib/scm/common/scmService.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/scm/common/scmService.js +13 -11
- package/scm.js +0 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ITelemetryService } from "vscode/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
2
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
3
|
+
import { IContextMenuService } from "vscode/vscode/vs/platform/contextview/browser/contextView.service";
|
|
4
|
+
import { IThemeService } from "vscode/vscode/vs/platform/theme/common/themeService.service";
|
|
5
|
+
import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
|
|
6
|
+
import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
|
|
7
|
+
import { IWorkbenchLayoutService } from "vscode/vscode/vs/workbench/services/layout/browser/layoutService.service";
|
|
8
|
+
import { IExtensionService } from "vscode/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
9
|
+
import { IWorkspaceContextService } from "vscode/vscode/vs/platform/workspace/common/workspace.service";
|
|
10
|
+
import { IViewDescriptorService } from "vscode/vscode/vs/workbench/common/views.service";
|
|
11
|
+
import { ViewPaneContainer } from "@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer";
|
|
12
|
+
export declare class SCMViewPaneContainer extends ViewPaneContainer {
|
|
13
|
+
constructor(layoutService: IWorkbenchLayoutService, telemetryService: ITelemetryService, instantiationService: IInstantiationService, contextMenuService: IContextMenuService, themeService: IThemeService, storageService: IStorageService, configurationService: IConfigurationService, extensionService: IExtensionService, contextService: IWorkspaceContextService, viewDescriptorService: IViewDescriptorService);
|
|
14
|
+
create(parent: HTMLElement): void;
|
|
15
|
+
getOptimalWidth(): number;
|
|
16
|
+
getTitle(): string;
|
|
17
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import './media/scm.css.js';
|
|
3
4
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
4
5
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
5
|
-
import { VIEWLET_ID, VIEW_PANE_ID, REPOSITORIES_VIEW_PANE_ID, HISTORY_VIEW_PANE_ID } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm';
|
|
6
|
+
import { VIEWLET_ID, VIEW_PANE_ID, REPOSITORIES_VIEW_PANE_ID, HISTORY_VIEW_PANE_ID } from '@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common/vscode/vs/workbench/contrib/scm/common/scm';
|
|
6
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
8
|
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
|
|
8
9
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
@@ -12,7 +13,7 @@ import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/lay
|
|
|
12
13
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
13
14
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
14
15
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
15
|
-
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
16
|
+
import { ViewPaneContainer } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
16
17
|
|
|
17
18
|
let SCMViewPaneContainer = class SCMViewPaneContainer extends ViewPaneContainer {
|
|
18
19
|
constructor(layoutService, telemetryService, instantiationService, contextMenuService, themeService, storageService, configurationService, extensionService, contextService, viewDescriptorService) {
|
|
@@ -36,20 +37,20 @@ let SCMViewPaneContainer = class SCMViewPaneContainer extends ViewPaneContainer
|
|
|
36
37
|
return super.getTitle();
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
|
-
return
|
|
40
|
+
return localize(8564, "Source Control");
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
SCMViewPaneContainer = (
|
|
43
|
-
(
|
|
44
|
-
(
|
|
45
|
-
(
|
|
46
|
-
(
|
|
47
|
-
(
|
|
48
|
-
(
|
|
49
|
-
(
|
|
50
|
-
(
|
|
51
|
-
(
|
|
52
|
-
(
|
|
53
|
-
], SCMViewPaneContainer))
|
|
43
|
+
SCMViewPaneContainer = ( __decorate([
|
|
44
|
+
( __param(0, IWorkbenchLayoutService)),
|
|
45
|
+
( __param(1, ITelemetryService)),
|
|
46
|
+
( __param(2, IInstantiationService)),
|
|
47
|
+
( __param(3, IContextMenuService)),
|
|
48
|
+
( __param(4, IThemeService)),
|
|
49
|
+
( __param(5, IStorageService)),
|
|
50
|
+
( __param(6, IConfigurationService)),
|
|
51
|
+
( __param(7, IExtensionService)),
|
|
52
|
+
( __param(8, IWorkspaceContextService)),
|
|
53
|
+
( __param(9, IViewDescriptorService))
|
|
54
|
+
], SCMViewPaneContainer));
|
|
54
55
|
|
|
55
56
|
export { SCMViewPaneContainer };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
2
|
+
import { ISCMRepository, ISCMViewVisibleRepositoryChangeEvent, ISCMMenus, ISCMRepositorySortKey } from "@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common/vscode/vs/workbench/contrib/scm/common/scm";
|
|
3
|
+
import { ISCMViewService } from "vscode/vscode/vs/workbench/contrib/scm/common/scm.service";
|
|
4
|
+
import { ISCMService } from "vscode/vscode/vs/workbench/contrib/scm/common/scm.service";
|
|
5
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
|
|
7
|
+
import { IWorkspaceContextService } from "vscode/vscode/vs/platform/workspace/common/workspace.service";
|
|
8
|
+
import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
|
|
9
|
+
import { RawContextKey } from "vscode/vscode/vs/platform/contextkey/common/contextkey";
|
|
10
|
+
import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
11
|
+
import { IExtensionService } from "vscode/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
12
|
+
import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
13
|
+
export declare const RepositoryContextKeys: {
|
|
14
|
+
RepositorySortKey: RawContextKey<ISCMRepositorySortKey>;
|
|
15
|
+
};
|
|
16
|
+
export interface ISCMViewServiceState {
|
|
17
|
+
readonly all: string[];
|
|
18
|
+
readonly sortKey: ISCMRepositorySortKey;
|
|
19
|
+
readonly visible: number[];
|
|
20
|
+
}
|
|
21
|
+
export declare class SCMViewService implements ISCMViewService {
|
|
22
|
+
private readonly scmService;
|
|
23
|
+
private readonly editorService;
|
|
24
|
+
private readonly configurationService;
|
|
25
|
+
private readonly storageService;
|
|
26
|
+
private readonly workspaceContextService;
|
|
27
|
+
readonly _serviceBrand: undefined;
|
|
28
|
+
readonly menus: ISCMMenus;
|
|
29
|
+
private didFinishLoading;
|
|
30
|
+
private didSelectRepository;
|
|
31
|
+
private previousState;
|
|
32
|
+
private readonly disposables;
|
|
33
|
+
private _repositories;
|
|
34
|
+
get repositories(): ISCMRepository[];
|
|
35
|
+
get visibleRepositories(): ISCMRepository[];
|
|
36
|
+
set visibleRepositories(visibleRepositories: ISCMRepository[]);
|
|
37
|
+
private _onDidChangeRepositories;
|
|
38
|
+
readonly onDidChangeRepositories: Event<ISCMViewVisibleRepositoryChangeEvent>;
|
|
39
|
+
private _onDidSetVisibleRepositories;
|
|
40
|
+
readonly onDidChangeVisibleRepositories: Event<ISCMViewVisibleRepositoryChangeEvent>;
|
|
41
|
+
get focusedRepository(): ISCMRepository | undefined;
|
|
42
|
+
private _onDidFocusRepository;
|
|
43
|
+
readonly onDidFocusRepository: Event<ISCMRepository | undefined>;
|
|
44
|
+
private readonly _focusedRepository;
|
|
45
|
+
private readonly _activeEditor;
|
|
46
|
+
private readonly _activeEditorRepository;
|
|
47
|
+
private readonly _activeRepository;
|
|
48
|
+
readonly activeRepository: import("vscode/vscode/vs/base/common/observable").IObservable<ISCMRepository | undefined, unknown>;
|
|
49
|
+
private _repositoriesSortKey;
|
|
50
|
+
private _sortKeyContextKey;
|
|
51
|
+
constructor(scmService: ISCMService, contextKeyService: IContextKeyService, editorService: IEditorService, extensionService: IExtensionService, instantiationService: IInstantiationService, configurationService: IConfigurationService, storageService: IStorageService, workspaceContextService: IWorkspaceContextService);
|
|
52
|
+
private onDidAddRepository;
|
|
53
|
+
private onDidRemoveRepository;
|
|
54
|
+
isVisible(repository: ISCMRepository): boolean;
|
|
55
|
+
toggleVisibility(repository: ISCMRepository, visible?: boolean): void;
|
|
56
|
+
toggleSortKey(sortKey: ISCMRepositorySortKey): void;
|
|
57
|
+
focus(repository: ISCMRepository | undefined): void;
|
|
58
|
+
private compareRepositories;
|
|
59
|
+
private getMaxSelectionIndex;
|
|
60
|
+
private getViewSortOrder;
|
|
61
|
+
private insertRepositoryView;
|
|
62
|
+
private onWillSaveState;
|
|
63
|
+
private eventuallyFinishLoading;
|
|
64
|
+
private finishLoading;
|
|
65
|
+
dispose(): void;
|
|
66
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
+
import { ISCMRepositorySortKey } from '@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common/vscode/vs/workbench/contrib/scm/common/scm';
|
|
4
6
|
import { ISCMService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
5
7
|
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
6
8
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
9
|
import { SCMMenus } from './menus.js';
|
|
10
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
8
11
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
9
12
|
import { debounce } from 'vscode/vscode/vs/base/common/decorators';
|
|
10
13
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
@@ -33,17 +36,14 @@ function getRepositoryName(workspaceContextService, repository) {
|
|
|
33
36
|
return folder?.uri.toString() === ( repository.provider.rootUri.toString()) ? folder.name : basename(repository.provider.rootUri);
|
|
34
37
|
}
|
|
35
38
|
const RepositoryContextKeys = {
|
|
36
|
-
RepositorySortKey: ( new RawContextKey(
|
|
37
|
-
'scmRepositorySortKey',
|
|
38
|
-
"discoveryTime"
|
|
39
|
-
)),
|
|
39
|
+
RepositorySortKey: ( new RawContextKey('scmRepositorySortKey', ISCMRepositorySortKey.DiscoveryTime)),
|
|
40
40
|
};
|
|
41
41
|
let SCMViewService = class SCMViewService {
|
|
42
42
|
get repositories() {
|
|
43
43
|
return ( this._repositories.map(r => r.repository));
|
|
44
44
|
}
|
|
45
45
|
get visibleRepositories() {
|
|
46
|
-
if (this._repositoriesSortKey ===
|
|
46
|
+
if (this._repositoriesSortKey === ISCMRepositorySortKey.DiscoveryTime) {
|
|
47
47
|
return ( this._repositories.filter(r => r.selectionIndex !== -1)
|
|
48
48
|
.sort((r1, r2) => r1.selectionIndex - r2.selectionIndex)
|
|
49
49
|
.map(r => r.repository));
|
|
@@ -145,7 +145,7 @@ let SCMViewService = class SCMViewService {
|
|
|
145
145
|
}, reader => this._activeRepository.read(reader));
|
|
146
146
|
this.menus = instantiationService.createInstance(SCMMenus);
|
|
147
147
|
try {
|
|
148
|
-
this.previousState = JSON.parse(storageService.get('scm:view:visibleRepositories',
|
|
148
|
+
this.previousState = JSON.parse(storageService.get('scm:view:visibleRepositories', StorageScope.WORKSPACE, ''));
|
|
149
149
|
}
|
|
150
150
|
catch {
|
|
151
151
|
}
|
|
@@ -269,7 +269,7 @@ let SCMViewService = class SCMViewService {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
compareRepositories(op1, op2) {
|
|
272
|
-
if (this._repositoriesSortKey ===
|
|
272
|
+
if (this._repositoriesSortKey === ISCMRepositorySortKey.DiscoveryTime) {
|
|
273
273
|
return op1.discoveryTime - op2.discoveryTime;
|
|
274
274
|
}
|
|
275
275
|
if (this._repositoriesSortKey === 'path' && op1.repository.provider.rootUri && op2.repository.provider.rootUri) {
|
|
@@ -291,13 +291,13 @@ let SCMViewService = class SCMViewService {
|
|
|
291
291
|
const sortOder = this.configurationService.getValue('scm.repositories.sortOrder');
|
|
292
292
|
switch (sortOder) {
|
|
293
293
|
case 'discovery time':
|
|
294
|
-
return
|
|
294
|
+
return ISCMRepositorySortKey.DiscoveryTime;
|
|
295
295
|
case 'name':
|
|
296
|
-
return
|
|
296
|
+
return ISCMRepositorySortKey.Name;
|
|
297
297
|
case 'path':
|
|
298
|
-
return
|
|
298
|
+
return ISCMRepositorySortKey.Path;
|
|
299
299
|
default:
|
|
300
|
-
return
|
|
300
|
+
return ISCMRepositorySortKey.DiscoveryTime;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
insertRepositoryView(repositories, repositoryView) {
|
|
@@ -311,7 +311,7 @@ let SCMViewService = class SCMViewService {
|
|
|
311
311
|
const all = ( this.repositories.map(r => getProviderStorageKey(r.provider)));
|
|
312
312
|
const visible = ( this.visibleRepositories.map(r => all.indexOf(getProviderStorageKey(r.provider))));
|
|
313
313
|
this.previousState = { all, sortKey: this._repositoriesSortKey, visible };
|
|
314
|
-
this.storageService.store('scm:view:visibleRepositories', JSON.stringify(this.previousState),
|
|
314
|
+
this.storageService.store('scm:view:visibleRepositories', JSON.stringify(this.previousState), StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
315
315
|
}
|
|
316
316
|
eventuallyFinishLoading() {
|
|
317
317
|
this.finishLoading();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
+
import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
|
|
4
|
+
import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
|
|
5
|
+
import { ISCMService } from "vscode/vscode/vs/workbench/contrib/scm/common/scm.service";
|
|
6
|
+
import { IEditorGroupsService } from "vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
7
|
+
import { IWorkbenchLayoutService } from "vscode/vscode/vs/workbench/services/layout/browser/layoutService.service";
|
|
8
|
+
export declare class SCMWorkingSetController extends Disposable implements IWorkbenchContribution {
|
|
9
|
+
private readonly configurationService;
|
|
10
|
+
private readonly editorGroupsService;
|
|
11
|
+
private readonly scmService;
|
|
12
|
+
private readonly storageService;
|
|
13
|
+
private readonly layoutService;
|
|
14
|
+
static readonly ID = "workbench.contrib.scmWorkingSets";
|
|
15
|
+
private _workingSets;
|
|
16
|
+
private _enabledConfig;
|
|
17
|
+
private readonly _repositoryDisposables;
|
|
18
|
+
constructor(configurationService: IConfigurationService, editorGroupsService: IEditorGroupsService, scmService: ISCMService, storageService: IStorageService, layoutService: IWorkbenchLayoutService);
|
|
19
|
+
private _onDidAddRepository;
|
|
20
|
+
private _onDidRemoveRepository;
|
|
21
|
+
private _loadWorkingSets;
|
|
22
|
+
private _saveWorkingSet;
|
|
23
|
+
private _restoreWorkingSet;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { Disposable, DisposableMap, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import 'vscode/vscode/vs/base/common/arrays';
|
|
4
5
|
import 'vscode/vscode/vs/base/common/event';
|
|
@@ -8,10 +9,12 @@ import 'vscode/vscode/vs/base/common/cancellation';
|
|
|
8
9
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
9
10
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
11
|
import { observableConfigValue } from 'vscode/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
12
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
11
13
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
12
|
-
import { getProviderKey } from 'vscode/vscode/vs/workbench/contrib/scm/browser/util';
|
|
14
|
+
import { getProviderKey } from '@codingame/monaco-vscode-be8ddbb5-094a-5657-b1cc-fe106c94c632-common/vscode/vs/workbench/contrib/scm/browser/util';
|
|
13
15
|
import { ISCMService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
14
16
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
17
|
+
import { Parts } from '@codingame/monaco-vscode-e571cbbb-526b-5d8b-92c5-a0437d2dabb3-common/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
15
18
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
16
19
|
|
|
17
20
|
let SCMWorkingSetController = class SCMWorkingSetController extends Disposable {
|
|
@@ -27,7 +30,7 @@ let SCMWorkingSetController = class SCMWorkingSetController extends Disposable {
|
|
|
27
30
|
this._repositoryDisposables = ( new DisposableMap());
|
|
28
31
|
this._store.add(autorunWithStore((reader, store) => {
|
|
29
32
|
if (!this._enabledConfig.read(reader)) {
|
|
30
|
-
this.storageService.remove('scm.workingSets',
|
|
33
|
+
this.storageService.remove('scm.workingSets', StorageScope.WORKSPACE);
|
|
31
34
|
this._repositoryDisposables.clearAndDisposeAll();
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
@@ -70,7 +73,7 @@ let SCMWorkingSetController = class SCMWorkingSetController extends Disposable {
|
|
|
70
73
|
}
|
|
71
74
|
_loadWorkingSets() {
|
|
72
75
|
const workingSets = ( new Map());
|
|
73
|
-
const workingSetsRaw = this.storageService.get('scm.workingSets',
|
|
76
|
+
const workingSetsRaw = this.storageService.get('scm.workingSets', StorageScope.WORKSPACE);
|
|
74
77
|
if (!workingSetsRaw) {
|
|
75
78
|
return workingSets;
|
|
76
79
|
}
|
|
@@ -91,7 +94,7 @@ let SCMWorkingSetController = class SCMWorkingSetController extends Disposable {
|
|
|
91
94
|
for (const [providerKey, { currentHistoryItemGroupId, editorWorkingSets }] of this._workingSets) {
|
|
92
95
|
workingSets.push({ providerKey, currentHistoryItemGroupId, editorWorkingSets: [...editorWorkingSets] });
|
|
93
96
|
}
|
|
94
|
-
this.storageService.store('scm.workingSets', JSON.stringify(workingSets),
|
|
97
|
+
this.storageService.store('scm.workingSets', JSON.stringify(workingSets), StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
95
98
|
}
|
|
96
99
|
async _restoreWorkingSet(providerKey, currentHistoryItemGroupId) {
|
|
97
100
|
const workingSets = this._workingSets.get(providerKey);
|
|
@@ -103,7 +106,7 @@ let SCMWorkingSetController = class SCMWorkingSetController extends Disposable {
|
|
|
103
106
|
editorWorkingSetId = 'empty';
|
|
104
107
|
}
|
|
105
108
|
if (editorWorkingSetId) {
|
|
106
|
-
const preserveFocus = this.layoutService.hasFocus(
|
|
109
|
+
const preserveFocus = this.layoutService.hasFocus(Parts.PANEL_PART);
|
|
107
110
|
await this.editorGroupsService.applyWorkingSet(editorWorkingSetId, { preserveFocus });
|
|
108
111
|
}
|
|
109
112
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
2
|
+
import { Disposable, IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { QuickDiff, QuickDiffProvider } from "vscode/vscode/vs/workbench/contrib/scm/common/quickDiff";
|
|
4
|
+
import { IQuickDiffService } from "vscode/vscode/vs/workbench/contrib/scm/common/quickDiff.service";
|
|
5
|
+
import { IUriIdentityService } from "vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
6
|
+
export declare class QuickDiffService extends Disposable implements IQuickDiffService {
|
|
7
|
+
private readonly uriIdentityService;
|
|
8
|
+
readonly _serviceBrand: undefined;
|
|
9
|
+
private quickDiffProviders;
|
|
10
|
+
private readonly _onDidChangeQuickDiffProviders;
|
|
11
|
+
readonly onDidChangeQuickDiffProviders: import("vscode/vscode/vs/base/common/event").Event<void>;
|
|
12
|
+
constructor(uriIdentityService: IUriIdentityService);
|
|
13
|
+
addQuickDiffProvider(quickDiff: QuickDiffProvider): IDisposable;
|
|
14
|
+
private isQuickDiff;
|
|
15
|
+
getQuickDiffs(uri: URI, language?: string, isSynchronized?: boolean): Promise<QuickDiff[]>;
|
|
16
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { isEqualOrParent } from 'vscode/vscode/vs/base/common/resources';
|
|
4
5
|
import { score } from 'vscode/vscode/vs/editor/common/languageSelector';
|
|
@@ -62,7 +63,8 @@ let QuickDiffService = class QuickDiffService extends Disposable {
|
|
|
62
63
|
const diff = {
|
|
63
64
|
originalResource: scoreValue > 0 ? (await provider.getOriginalResource(uri)) ?? undefined : undefined,
|
|
64
65
|
label: provider.label,
|
|
65
|
-
isSCM: provider.isSCM
|
|
66
|
+
isSCM: provider.isSCM,
|
|
67
|
+
visible: provider.visible
|
|
66
68
|
};
|
|
67
69
|
return diff;
|
|
68
70
|
})));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
2
|
+
import { ISCMProvider, ISCMRepository } from "@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common/vscode/vs/workbench/contrib/scm/common/scm";
|
|
3
|
+
import { ISCMService } from "vscode/vscode/vs/workbench/contrib/scm/common/scm.service";
|
|
4
|
+
import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
|
|
5
|
+
import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
6
|
+
import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
|
|
7
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
8
|
+
import { IWorkspaceContextService } from "vscode/vscode/vs/platform/workspace/common/workspace.service";
|
|
9
|
+
import { IUriIdentityService } from "vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
10
|
+
export declare class SCMService implements ISCMService {
|
|
11
|
+
private readonly logService;
|
|
12
|
+
private readonly uriIdentityService;
|
|
13
|
+
readonly _serviceBrand: undefined;
|
|
14
|
+
_repositories: Map<string, ISCMRepository>;
|
|
15
|
+
get repositories(): Iterable<ISCMRepository>;
|
|
16
|
+
get repositoryCount(): number;
|
|
17
|
+
private inputHistory;
|
|
18
|
+
private providerCount;
|
|
19
|
+
private readonly _onDidAddProvider;
|
|
20
|
+
readonly onDidAddRepository: Event<ISCMRepository>;
|
|
21
|
+
private readonly _onDidRemoveProvider;
|
|
22
|
+
readonly onDidRemoveRepository: Event<ISCMRepository>;
|
|
23
|
+
constructor(logService: ILogService, workspaceContextService: IWorkspaceContextService, contextKeyService: IContextKeyService, storageService: IStorageService, uriIdentityService: IUriIdentityService);
|
|
24
|
+
registerSCMProvider(provider: ISCMProvider): ISCMRepository;
|
|
25
|
+
getRepository(id: string): ISCMRepository | undefined;
|
|
26
|
+
getRepository(resource: URI): ISCMRepository | undefined;
|
|
27
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { Disposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
-
import { SCMInputChangeReason } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm';
|
|
5
|
+
import { SCMInputChangeReason } from '@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common/vscode/vs/workbench/contrib/scm/common/scm';
|
|
5
6
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
6
7
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
8
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
7
9
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
8
10
|
import { HistoryNavigator2 } from 'vscode/vscode/vs/base/common/history';
|
|
9
11
|
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
@@ -172,7 +174,7 @@ let SCMInputHistory = class SCMInputHistory {
|
|
|
172
174
|
this._onWillSaveHistory = this.disposables.add(( new Emitter()));
|
|
173
175
|
this.onWillSaveHistory = this._onWillSaveHistory.event;
|
|
174
176
|
this.histories = ( new Map());
|
|
175
|
-
const entries = this.storageService.getObject('scm.history',
|
|
177
|
+
const entries = this.storageService.getObject('scm.history', StorageScope.WORKSPACE, []);
|
|
176
178
|
for (const [providerLabel, rootUri, history] of entries) {
|
|
177
179
|
let providerHistories = this.histories.get(providerLabel);
|
|
178
180
|
if (!providerHistories) {
|
|
@@ -184,9 +186,9 @@ let SCMInputHistory = class SCMInputHistory {
|
|
|
184
186
|
if (this.migrateStorage()) {
|
|
185
187
|
this.saveToStorage();
|
|
186
188
|
}
|
|
187
|
-
this.disposables.add(this.storageService.onDidChangeValue(
|
|
189
|
+
this.disposables.add(this.storageService.onDidChangeValue(StorageScope.WORKSPACE, 'scm.history', this.disposables)(e => {
|
|
188
190
|
if (e.external && e.key === 'scm.history') {
|
|
189
|
-
const raw = this.storageService.getObject('scm.history',
|
|
191
|
+
const raw = this.storageService.getObject('scm.history', StorageScope.WORKSPACE, []);
|
|
190
192
|
for (const [providerLabel, uri, rawHistory] of raw) {
|
|
191
193
|
const history = this.getHistory(providerLabel, uri);
|
|
192
194
|
for (const value of Iterable.reverse(rawHistory)) {
|
|
@@ -212,7 +214,7 @@ let SCMInputHistory = class SCMInputHistory {
|
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
|
-
this.storageService.store('scm.history', raw,
|
|
217
|
+
this.storageService.store('scm.history', raw, StorageScope.WORKSPACE, StorageTarget.USER);
|
|
216
218
|
}
|
|
217
219
|
getHistory(providerLabel, rootUri) {
|
|
218
220
|
let providerHistories = this.histories.get(providerLabel);
|
|
@@ -229,13 +231,13 @@ let SCMInputHistory = class SCMInputHistory {
|
|
|
229
231
|
}
|
|
230
232
|
migrateStorage() {
|
|
231
233
|
let didSomethingChange = false;
|
|
232
|
-
const machineKeys = Iterable.filter(( this.storageService.keys(
|
|
234
|
+
const machineKeys = Iterable.filter(( this.storageService.keys(StorageScope.APPLICATION, StorageTarget.MACHINE)), key => key.startsWith('scm/input:'));
|
|
233
235
|
for (const key of machineKeys) {
|
|
234
236
|
try {
|
|
235
|
-
const legacyHistory = JSON.parse(this.storageService.get(key,
|
|
237
|
+
const legacyHistory = JSON.parse(this.storageService.get(key, StorageScope.APPLICATION, ''));
|
|
236
238
|
const match = /^scm\/input:([^:]+):(.+)$/.exec(key);
|
|
237
239
|
if (!match || !Array.isArray(legacyHistory?.history) || !Number.isInteger(legacyHistory?.timestamp)) {
|
|
238
|
-
this.storageService.remove(key,
|
|
240
|
+
this.storageService.remove(key, StorageScope.APPLICATION);
|
|
239
241
|
continue;
|
|
240
242
|
}
|
|
241
243
|
const [, providerLabel, rootPath] = match;
|
|
@@ -246,11 +248,11 @@ let SCMInputHistory = class SCMInputHistory {
|
|
|
246
248
|
history.prepend(entry);
|
|
247
249
|
}
|
|
248
250
|
didSomethingChange = true;
|
|
249
|
-
this.storageService.remove(key,
|
|
251
|
+
this.storageService.remove(key, StorageScope.APPLICATION);
|
|
250
252
|
}
|
|
251
253
|
}
|
|
252
254
|
catch {
|
|
253
|
-
this.storageService.remove(key,
|
|
255
|
+
this.storageService.remove(key, StorageScope.APPLICATION);
|
|
254
256
|
}
|
|
255
257
|
}
|
|
256
258
|
return didSomethingChange;
|
package/scm.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ISCMService, ISCMViewService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
2
|
-
import { SCMService } from './vscode/src/vs/workbench/contrib/scm/common/scmService.js';
|
|
3
|
-
import { SCMViewService } from './vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js';
|
|
4
|
-
import { IQuickDiffService } from 'vscode/vscode/vs/workbench/contrib/scm/common/quickDiff.service';
|
|
5
|
-
import { QuickDiffService } from './vscode/src/vs/workbench/contrib/scm/common/quickDiffService.js';
|
|
6
|
-
import './vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js';
|
|
7
|
-
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
8
|
-
|
|
9
|
-
function getServiceOverride() {
|
|
10
|
-
return {
|
|
11
|
-
[( ISCMService.toString())]: new SyncDescriptor(SCMService, [], true),
|
|
12
|
-
[( ISCMViewService.toString())]: new SyncDescriptor(SCMViewService, [], true),
|
|
13
|
-
[( IQuickDiffService.toString())]: new SyncDescriptor(QuickDiffService, [], true)
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { getServiceOverride as default };
|