@codingame/monaco-vscode-bulk-edit-service-override 1.85.0 → 1.85.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/bulkEdit.js +1 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/conflicts.js +80 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js +364 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.js +337 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.js +363 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.js +654 -0
package/bulkEdit.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
2
2
|
import { IBulkEditService } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
|
|
3
3
|
import { BulkEditService } from './vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js';
|
|
4
|
+
import './vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js';
|
|
4
5
|
|
|
5
6
|
function getServiceOverride() {
|
|
6
7
|
return {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2
|
+
|
|
3
|
+
export { n as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-bulk-edit-service-override",
|
|
3
|
-
"version": "1.85.
|
|
3
|
+
"version": "1.85.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.85.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.1",
|
|
22
22
|
"monaco-editor": "0.45.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
3
|
+
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
4
|
+
import { ResourceMap } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
5
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
7
|
+
import { ResourceTextEdit, ResourceFileEdit } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
|
|
8
|
+
import { ResourceNotebookCellEdit } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
|
|
9
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
10
|
+
|
|
11
|
+
let ConflictDetector = class ConflictDetector {
|
|
12
|
+
constructor(edits, fileService, modelService, logService) {
|
|
13
|
+
this._conflicts = ( new ResourceMap());
|
|
14
|
+
this._disposables = ( new DisposableStore());
|
|
15
|
+
this._onDidConflict = ( new Emitter());
|
|
16
|
+
this.onDidConflict = this._onDidConflict.event;
|
|
17
|
+
const _workspaceEditResources = ( new ResourceMap());
|
|
18
|
+
for (const edit of edits) {
|
|
19
|
+
if (edit instanceof ResourceTextEdit) {
|
|
20
|
+
_workspaceEditResources.set(edit.resource, true);
|
|
21
|
+
if (typeof edit.versionId === 'number') {
|
|
22
|
+
const model = modelService.getModel(edit.resource);
|
|
23
|
+
if (model && model.getVersionId() !== edit.versionId) {
|
|
24
|
+
this._conflicts.set(edit.resource, true);
|
|
25
|
+
this._onDidConflict.fire(this);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else if (edit instanceof ResourceFileEdit) {
|
|
30
|
+
if (edit.newResource) {
|
|
31
|
+
_workspaceEditResources.set(edit.newResource, true);
|
|
32
|
+
}
|
|
33
|
+
else if (edit.oldResource) {
|
|
34
|
+
_workspaceEditResources.set(edit.oldResource, true);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else if (edit instanceof ResourceNotebookCellEdit) {
|
|
38
|
+
_workspaceEditResources.set(edit.resource, true);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
logService.warn('UNKNOWN edit type', edit);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
this._disposables.add(fileService.onDidFilesChange(e => {
|
|
45
|
+
for (const uri of ( _workspaceEditResources.keys())) {
|
|
46
|
+
if (!modelService.getModel(uri) && e.contains(uri)) {
|
|
47
|
+
this._conflicts.set(uri, true);
|
|
48
|
+
this._onDidConflict.fire(this);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
const onDidChangeModel = (model) => {
|
|
54
|
+
if (( _workspaceEditResources.has(model.uri))) {
|
|
55
|
+
this._conflicts.set(model.uri, true);
|
|
56
|
+
this._onDidConflict.fire(this);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
for (const model of modelService.getModels()) {
|
|
60
|
+
this._disposables.add(model.onDidChangeContent(() => onDidChangeModel(model)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
dispose() {
|
|
64
|
+
this._disposables.dispose();
|
|
65
|
+
this._onDidConflict.dispose();
|
|
66
|
+
}
|
|
67
|
+
list() {
|
|
68
|
+
return [...( this._conflicts.keys())];
|
|
69
|
+
}
|
|
70
|
+
hasConflicts() {
|
|
71
|
+
return this._conflicts.size > 0;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
ConflictDetector = ( __decorate([
|
|
75
|
+
( __param(1, IFileService)),
|
|
76
|
+
( __param(2, IModelService)),
|
|
77
|
+
( __param(3, ILogService))
|
|
78
|
+
], ConflictDetector));
|
|
79
|
+
|
|
80
|
+
export { ConflictDetector };
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
3
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
|
+
import { IBulkEditService } from 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js';
|
|
5
|
+
import { BulkEditPane } from './bulkEditPane.js';
|
|
6
|
+
import { IViewsService, Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/views';
|
|
7
|
+
import { FocusedViewContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
8
|
+
import { localizeWithPath, localize2WithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
9
|
+
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
10
|
+
import { RawContextKey, ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
11
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
12
|
+
import { BulkEditPreviewProvider } from './bulkEditPreview.js';
|
|
13
|
+
import { WorkbenchListFocusContextKey } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
14
|
+
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
15
|
+
import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
16
|
+
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
17
|
+
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
18
|
+
import '../../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
19
|
+
import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
|
|
20
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
21
|
+
import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
22
|
+
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite';
|
|
23
|
+
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
24
|
+
|
|
25
|
+
var BulkEditPreviewContribution_1;
|
|
26
|
+
async function getBulkEditPane(viewsService) {
|
|
27
|
+
const view = await viewsService.openView(BulkEditPane.ID, true);
|
|
28
|
+
if (view instanceof BulkEditPane) {
|
|
29
|
+
return view;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
let UXState = class UXState {
|
|
34
|
+
constructor(_paneCompositeService, _editorGroupsService) {
|
|
35
|
+
this._paneCompositeService = _paneCompositeService;
|
|
36
|
+
this._editorGroupsService = _editorGroupsService;
|
|
37
|
+
this._activePanel = _paneCompositeService.getActivePaneComposite(1 )?.getId();
|
|
38
|
+
}
|
|
39
|
+
async restore(panels, editors) {
|
|
40
|
+
if (panels) {
|
|
41
|
+
if (typeof this._activePanel === 'string') {
|
|
42
|
+
await this._paneCompositeService.openPaneComposite(this._activePanel, 1 );
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this._paneCompositeService.hideActivePaneComposite(1 );
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (editors) {
|
|
49
|
+
for (const group of this._editorGroupsService.groups) {
|
|
50
|
+
const previewEditors = [];
|
|
51
|
+
for (const input of group.editors) {
|
|
52
|
+
const resource = EditorResourceAccessor.getCanonicalUri(input, { supportSideBySide: SideBySideEditor.PRIMARY });
|
|
53
|
+
if (resource?.scheme === BulkEditPreviewProvider.Schema) {
|
|
54
|
+
previewEditors.push(input);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (previewEditors.length) {
|
|
58
|
+
group.closeEditors(previewEditors, { preserveFocus: true });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
UXState = ( __decorate([
|
|
65
|
+
( __param(0, IPaneCompositePartService)),
|
|
66
|
+
( __param(1, IEditorGroupsService))
|
|
67
|
+
], UXState));
|
|
68
|
+
class PreviewSession {
|
|
69
|
+
constructor(uxState, cts = ( new CancellationTokenSource())) {
|
|
70
|
+
this.uxState = uxState;
|
|
71
|
+
this.cts = cts;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
let BulkEditPreviewContribution = class BulkEditPreviewContribution {
|
|
75
|
+
static { BulkEditPreviewContribution_1 = this; }
|
|
76
|
+
static { this.ctxEnabled = ( new RawContextKey('refactorPreview.enabled', false)); }
|
|
77
|
+
constructor(_paneCompositeService, _viewsService, _editorGroupsService, _dialogService, bulkEditService, contextKeyService) {
|
|
78
|
+
this._paneCompositeService = _paneCompositeService;
|
|
79
|
+
this._viewsService = _viewsService;
|
|
80
|
+
this._editorGroupsService = _editorGroupsService;
|
|
81
|
+
this._dialogService = _dialogService;
|
|
82
|
+
bulkEditService.setPreviewHandler(edits => this._previewEdit(edits));
|
|
83
|
+
this._ctxEnabled = BulkEditPreviewContribution_1.ctxEnabled.bindTo(contextKeyService);
|
|
84
|
+
}
|
|
85
|
+
async _previewEdit(edits) {
|
|
86
|
+
this._ctxEnabled.set(true);
|
|
87
|
+
const uxState = this._activeSession?.uxState ?? ( new UXState(this._paneCompositeService, this._editorGroupsService));
|
|
88
|
+
const view = await getBulkEditPane(this._viewsService);
|
|
89
|
+
if (!view) {
|
|
90
|
+
this._ctxEnabled.set(false);
|
|
91
|
+
return edits;
|
|
92
|
+
}
|
|
93
|
+
if (view.hasInput()) {
|
|
94
|
+
const { confirmed } = await this._dialogService.confirm({
|
|
95
|
+
type: Severity.Info,
|
|
96
|
+
message: ( localizeWithPath(
|
|
97
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
98
|
+
'overlap',
|
|
99
|
+
"Another refactoring is being previewed."
|
|
100
|
+
)),
|
|
101
|
+
detail: ( localizeWithPath(
|
|
102
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
103
|
+
'detail',
|
|
104
|
+
"Press 'Continue' to discard the previous refactoring and continue with the current refactoring."
|
|
105
|
+
)),
|
|
106
|
+
primaryButton: ( localizeWithPath(
|
|
107
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
108
|
+
{ key: 'continue', comment: ['&& denotes a mnemonic'] },
|
|
109
|
+
"&&Continue"
|
|
110
|
+
))
|
|
111
|
+
});
|
|
112
|
+
if (!confirmed) {
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
let session;
|
|
117
|
+
if (this._activeSession) {
|
|
118
|
+
await this._activeSession.uxState.restore(false, true);
|
|
119
|
+
this._activeSession.cts.dispose(true);
|
|
120
|
+
session = ( new PreviewSession(uxState));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
session = ( new PreviewSession(uxState));
|
|
124
|
+
}
|
|
125
|
+
this._activeSession = session;
|
|
126
|
+
try {
|
|
127
|
+
return (await view.setInput(edits, session.cts.token)) ?? [];
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
if (this._activeSession === session) {
|
|
131
|
+
await this._activeSession.uxState.restore(true, true);
|
|
132
|
+
this._activeSession.cts.dispose();
|
|
133
|
+
this._ctxEnabled.set(false);
|
|
134
|
+
this._activeSession = undefined;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
BulkEditPreviewContribution = BulkEditPreviewContribution_1 = ( __decorate([
|
|
140
|
+
( __param(0, IPaneCompositePartService)),
|
|
141
|
+
( __param(1, IViewsService)),
|
|
142
|
+
( __param(2, IEditorGroupsService)),
|
|
143
|
+
( __param(3, IDialogService)),
|
|
144
|
+
( __param(4, IBulkEditService)),
|
|
145
|
+
( __param(5, IContextKeyService))
|
|
146
|
+
], BulkEditPreviewContribution));
|
|
147
|
+
registerAction2(class ApplyAction extends Action2 {
|
|
148
|
+
constructor() {
|
|
149
|
+
super({
|
|
150
|
+
id: 'refactorPreview.apply',
|
|
151
|
+
title: ( localize2WithPath(
|
|
152
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
153
|
+
'apply',
|
|
154
|
+
"Apply Refactoring"
|
|
155
|
+
)),
|
|
156
|
+
category: ( localize2WithPath(
|
|
157
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
158
|
+
'cat',
|
|
159
|
+
"Refactor Preview"
|
|
160
|
+
)),
|
|
161
|
+
icon: Codicon.check,
|
|
162
|
+
precondition: ( ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, BulkEditPane.ctxHasCheckedChanges)),
|
|
163
|
+
menu: [{
|
|
164
|
+
id: MenuId.BulkEditContext,
|
|
165
|
+
order: 1
|
|
166
|
+
}],
|
|
167
|
+
keybinding: {
|
|
168
|
+
weight: 100 - 10,
|
|
169
|
+
when: ( ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, ( FocusedViewContext.isEqualTo(BulkEditPane.ID)))),
|
|
170
|
+
primary: 1024 + 3 ,
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async run(accessor) {
|
|
175
|
+
const viewsService = accessor.get(IViewsService);
|
|
176
|
+
const view = await getBulkEditPane(viewsService);
|
|
177
|
+
view?.accept();
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
registerAction2(class DiscardAction extends Action2 {
|
|
181
|
+
constructor() {
|
|
182
|
+
super({
|
|
183
|
+
id: 'refactorPreview.discard',
|
|
184
|
+
title: ( localize2WithPath(
|
|
185
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
186
|
+
'Discard',
|
|
187
|
+
"Discard Refactoring"
|
|
188
|
+
)),
|
|
189
|
+
category: ( localize2WithPath(
|
|
190
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
191
|
+
'cat',
|
|
192
|
+
"Refactor Preview"
|
|
193
|
+
)),
|
|
194
|
+
icon: Codicon.clearAll,
|
|
195
|
+
precondition: BulkEditPreviewContribution.ctxEnabled,
|
|
196
|
+
menu: [{
|
|
197
|
+
id: MenuId.BulkEditContext,
|
|
198
|
+
order: 2
|
|
199
|
+
}]
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
async run(accessor) {
|
|
203
|
+
const viewsService = accessor.get(IViewsService);
|
|
204
|
+
const view = await getBulkEditPane(viewsService);
|
|
205
|
+
view?.discard();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
registerAction2(class ToggleAction extends Action2 {
|
|
209
|
+
constructor() {
|
|
210
|
+
super({
|
|
211
|
+
id: 'refactorPreview.toggleCheckedState',
|
|
212
|
+
title: ( localize2WithPath(
|
|
213
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
214
|
+
'toogleSelection',
|
|
215
|
+
"Toggle Change"
|
|
216
|
+
)),
|
|
217
|
+
category: ( localize2WithPath(
|
|
218
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
219
|
+
'cat',
|
|
220
|
+
"Refactor Preview"
|
|
221
|
+
)),
|
|
222
|
+
precondition: BulkEditPreviewContribution.ctxEnabled,
|
|
223
|
+
keybinding: {
|
|
224
|
+
weight: 200 ,
|
|
225
|
+
when: WorkbenchListFocusContextKey,
|
|
226
|
+
primary: 10 ,
|
|
227
|
+
},
|
|
228
|
+
menu: {
|
|
229
|
+
id: MenuId.BulkEditContext,
|
|
230
|
+
group: 'navigation'
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
async run(accessor) {
|
|
235
|
+
const viewsService = accessor.get(IViewsService);
|
|
236
|
+
const view = await getBulkEditPane(viewsService);
|
|
237
|
+
view?.toggleChecked();
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
registerAction2(class GroupByFile extends Action2 {
|
|
241
|
+
constructor() {
|
|
242
|
+
super({
|
|
243
|
+
id: 'refactorPreview.groupByFile',
|
|
244
|
+
title: ( localize2WithPath(
|
|
245
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
246
|
+
'groupByFile',
|
|
247
|
+
"Group Changes By File"
|
|
248
|
+
)),
|
|
249
|
+
category: ( localize2WithPath(
|
|
250
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
251
|
+
'cat',
|
|
252
|
+
"Refactor Preview"
|
|
253
|
+
)),
|
|
254
|
+
icon: Codicon.ungroupByRefType,
|
|
255
|
+
precondition: ( ContextKeyExpr.and(BulkEditPane.ctxHasCategories, ( BulkEditPane.ctxGroupByFile.negate()), BulkEditPreviewContribution.ctxEnabled)),
|
|
256
|
+
menu: [{
|
|
257
|
+
id: MenuId.BulkEditTitle,
|
|
258
|
+
when: ( ContextKeyExpr.and(BulkEditPane.ctxHasCategories, ( BulkEditPane.ctxGroupByFile.negate()))),
|
|
259
|
+
group: 'navigation',
|
|
260
|
+
order: 3,
|
|
261
|
+
}]
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
async run(accessor) {
|
|
265
|
+
const viewsService = accessor.get(IViewsService);
|
|
266
|
+
const view = await getBulkEditPane(viewsService);
|
|
267
|
+
view?.groupByFile();
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
registerAction2(class GroupByType extends Action2 {
|
|
271
|
+
constructor() {
|
|
272
|
+
super({
|
|
273
|
+
id: 'refactorPreview.groupByType',
|
|
274
|
+
title: ( localize2WithPath(
|
|
275
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
276
|
+
'groupByType',
|
|
277
|
+
"Group Changes By Type"
|
|
278
|
+
)),
|
|
279
|
+
category: ( localize2WithPath(
|
|
280
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
281
|
+
'cat',
|
|
282
|
+
"Refactor Preview"
|
|
283
|
+
)),
|
|
284
|
+
icon: Codicon.groupByRefType,
|
|
285
|
+
precondition: ( ContextKeyExpr.and(
|
|
286
|
+
BulkEditPane.ctxHasCategories,
|
|
287
|
+
BulkEditPane.ctxGroupByFile,
|
|
288
|
+
BulkEditPreviewContribution.ctxEnabled
|
|
289
|
+
)),
|
|
290
|
+
menu: [{
|
|
291
|
+
id: MenuId.BulkEditTitle,
|
|
292
|
+
when: ( ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPane.ctxGroupByFile)),
|
|
293
|
+
group: 'navigation',
|
|
294
|
+
order: 3
|
|
295
|
+
}]
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
async run(accessor) {
|
|
299
|
+
const viewsService = accessor.get(IViewsService);
|
|
300
|
+
const view = await getBulkEditPane(viewsService);
|
|
301
|
+
view?.groupByType();
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
registerAction2(class ToggleGrouping extends Action2 {
|
|
305
|
+
constructor() {
|
|
306
|
+
super({
|
|
307
|
+
id: 'refactorPreview.toggleGrouping',
|
|
308
|
+
title: ( localize2WithPath(
|
|
309
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
310
|
+
'groupByType',
|
|
311
|
+
"Group Changes By Type"
|
|
312
|
+
)),
|
|
313
|
+
category: ( localize2WithPath(
|
|
314
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
315
|
+
'cat',
|
|
316
|
+
"Refactor Preview"
|
|
317
|
+
)),
|
|
318
|
+
icon: Codicon.listTree,
|
|
319
|
+
toggled: ( BulkEditPane.ctxGroupByFile.negate()),
|
|
320
|
+
precondition: ( ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPreviewContribution.ctxEnabled)),
|
|
321
|
+
menu: [{
|
|
322
|
+
id: MenuId.BulkEditContext,
|
|
323
|
+
order: 3
|
|
324
|
+
}]
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
async run(accessor) {
|
|
328
|
+
const viewsService = accessor.get(IViewsService);
|
|
329
|
+
const view = await getBulkEditPane(viewsService);
|
|
330
|
+
view?.toggleGrouping();
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BulkEditPreviewContribution, 2 );
|
|
334
|
+
const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localizeWithPath(
|
|
335
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
336
|
+
'refactorPreviewViewIcon',
|
|
337
|
+
'View icon of the refactor preview view.'
|
|
338
|
+
)));
|
|
339
|
+
const container = ( Registry.as(Extensions$1.ViewContainersRegistry)).registerViewContainer({
|
|
340
|
+
id: BulkEditPane.ID,
|
|
341
|
+
title: ( localize2WithPath(
|
|
342
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
343
|
+
'panel',
|
|
344
|
+
"Refactor Preview"
|
|
345
|
+
)),
|
|
346
|
+
hideIfEmpty: true,
|
|
347
|
+
ctorDescriptor: ( new SyncDescriptor(
|
|
348
|
+
ViewPaneContainer,
|
|
349
|
+
[BulkEditPane.ID, { mergeViewWithContainerWhenSingleView: true }]
|
|
350
|
+
)),
|
|
351
|
+
icon: refactorPreviewViewIcon,
|
|
352
|
+
storageId: BulkEditPane.ID
|
|
353
|
+
}, 1 );
|
|
354
|
+
( Registry.as(Extensions$1.ViewsRegistry)).registerViews([{
|
|
355
|
+
id: BulkEditPane.ID,
|
|
356
|
+
name: ( localize2WithPath(
|
|
357
|
+
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution',
|
|
358
|
+
'panel',
|
|
359
|
+
"Refactor Preview"
|
|
360
|
+
)),
|
|
361
|
+
when: BulkEditPreviewContribution.ctxEnabled,
|
|
362
|
+
ctorDescriptor: ( new SyncDescriptor(BulkEditPane)),
|
|
363
|
+
containerIcon: refactorPreviewViewIcon,
|
|
364
|
+
}], container);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
|
|
3
|
+
var css = ".monaco-workbench .bulk-edit-panel .highlight.insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-workbench .bulk-edit-panel .highlight.remove{background-color:var(--vscode-diffEditor-removedTextBackground);text-decoration:line-through}.monaco-workbench .bulk-edit-panel .message{padding:10px 20px}.monaco-workbench .bulk-edit-panel[data-state=data] .content,.monaco-workbench .bulk-edit-panel[data-state=message] .message{display:flex}.monaco-workbench .bulk-edit-panel[data-state=data] .message,.monaco-workbench .bulk-edit-panel[data-state=message] .content{display:none}.monaco-workbench .bulk-edit-panel .content{display:flex;flex-direction:column;justify-content:space-between}.monaco-workbench .bulk-edit-panel .content .buttons{padding-left:20px;padding-top:10px}.monaco-workbench .bulk-edit-panel .content .buttons .monaco-button{display:inline-flex;margin:0 4px;padding:4px 8px;width:inherit}.monaco-workbench .bulk-edit-panel .monaco-tl-contents{display:flex}.monaco-workbench .bulk-edit-panel .monaco-tl-contents .edit-checkbox{align-self:center}.monaco-workbench .bulk-edit-panel .monaco-tl-contents .edit-checkbox.disabled{opacity:.5}.monaco-workbench .bulk-edit-panel .monaco-tl-contents .monaco-icon-label.delete .monaco-icon-label-container{text-decoration:line-through}.monaco-workbench .bulk-edit-panel .monaco-tl-contents .details{font-size:.9em;margin-left:.5em;opacity:.7;white-space:pre}.monaco-workbench .bulk-edit-panel .monaco-tl-contents.category{align-items:center;display:flex;flex:1;flex-flow:row nowrap}.monaco-workbench .bulk-edit-panel .monaco-tl-contents.category .theme-icon,.monaco-workbench .bulk-edit-panel .monaco-tl-contents.textedit .theme-icon{margin-right:4px}.monaco-workbench .bulk-edit-panel .monaco-tl-contents.category .uri-icon,.monaco-workbench .bulk-edit-panel .monaco-tl-contents.textedit .uri-icon,.monaco-workbench.hc-light .bulk-edit-panel .monaco-tl-contents.category .uri-icon,.monaco-workbench.hc-light .bulk-edit-panel .monaco-tl-contents.textedit .uri-icon{background-image:var(--background-light);background-position:0;background-repeat:no-repeat;background-size:contain;height:100%;margin-right:4px;min-width:16px;width:16px}.monaco-workbench.hc-black .bulk-edit-panel .monaco-tl-contents.category .uri-icon,.monaco-workbench.hc-black .bulk-edit-panel .monaco-tl-contents.textedit .uri-icon,.monaco-workbench.vs-dark .bulk-edit-panel .monaco-tl-contents.category .uri-icon,.monaco-workbench.vs-dark .bulk-edit-panel .monaco-tl-contents.textedit .uri-icon{background-image:var(--background-dark)}.monaco-workbench .bulk-edit-panel .monaco-tl-contents.textedit .monaco-highlighted-label{overflow:hidden;text-overflow:ellipsis}";
|
|
4
|
+
n(css,{});
|
|
5
|
+
|
|
6
|
+
export { css, css as default };
|