@codingame/monaco-vscode-bulk-edit-service-override 11.1.2 → 12.0.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.
Files changed (23) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +14 -1
  3. package/package.json +23 -7
  4. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.d.ts +28 -0
  5. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +82 -64
  6. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.d.ts +21 -0
  7. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +7 -5
  8. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.d.ts +29 -0
  9. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +2 -1
  10. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/conflicts.d.ts +16 -0
  11. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/conflicts.js +3 -2
  12. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/opaqueEdits.d.ts +25 -0
  13. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/opaqueEdits.js +67 -0
  14. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.d.ts +1 -0
  15. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js +67 -74
  16. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.css.js +1 -1
  17. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.d.ts +65 -0
  18. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.js +65 -60
  19. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.d.ts +87 -0
  20. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.js +56 -54
  21. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.d.ts +132 -0
  22. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.js +112 -119
  23. package/bulkEdit.js +0 -12
@@ -1,23 +1,26 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
3
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
4
+ import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
4
5
  import { IBulkEditService } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
5
6
  import { BulkEditPane } from './bulkEditPane.js';
6
- import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
7
+ import { ViewContainerLocation, Extensions } from 'vscode/vscode/vs/workbench/common/views';
7
8
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
8
9
  import { FocusedViewContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
9
10
  import { localize, localize2 } from 'vscode/vscode/vs/nls';
10
- import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
11
+ import { ViewPaneContainer } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
11
12
  import { RawContextKey, ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
12
13
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
13
14
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
15
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
16
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
14
17
  import { WorkbenchListFocusContextKey } from 'vscode/vscode/vs/platform/list/browser/listService';
15
18
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
16
19
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
17
20
  import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
18
21
  import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
19
22
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
20
- import Severity$1 from 'vscode/vscode/vs/base/common/severity';
23
+ import Severity from 'vscode/vscode/vs/base/common/severity';
21
24
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
22
25
  import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
23
26
  import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
@@ -34,15 +37,15 @@ let UXState = class UXState {
34
37
  constructor(_paneCompositeService, _editorGroupsService) {
35
38
  this._paneCompositeService = _paneCompositeService;
36
39
  this._editorGroupsService = _editorGroupsService;
37
- this._activePanel = _paneCompositeService.getActivePaneComposite(1 )?.getId();
40
+ this._activePanel = _paneCompositeService.getActivePaneComposite(ViewContainerLocation.Panel)?.getId();
38
41
  }
39
42
  async restore(panels, editors) {
40
43
  if (panels) {
41
44
  if (typeof this._activePanel === 'string') {
42
- await this._paneCompositeService.openPaneComposite(this._activePanel, 1 );
45
+ await this._paneCompositeService.openPaneComposite(this._activePanel, ViewContainerLocation.Panel);
43
46
  }
44
47
  else {
45
- this._paneCompositeService.hideActivePaneComposite(1 );
48
+ this._paneCompositeService.hideActivePaneComposite(ViewContainerLocation.Panel);
46
49
  }
47
50
  }
48
51
  if (editors) {
@@ -61,12 +64,12 @@ let UXState = class UXState {
61
64
  }
62
65
  }
63
66
  };
64
- UXState = ( (__decorate([
65
- ( (__param(0, IPaneCompositePartService))),
66
- ( (__param(1, IEditorGroupsService)))
67
- ], UXState)));
67
+ UXState = ( __decorate([
68
+ ( __param(0, IPaneCompositePartService)),
69
+ ( __param(1, IEditorGroupsService))
70
+ ], UXState));
68
71
  class PreviewSession {
69
- constructor(uxState, cts = ( (new CancellationTokenSource()))) {
72
+ constructor(uxState, cts = ( new CancellationTokenSource())) {
70
73
  this.uxState = uxState;
71
74
  this.cts = cts;
72
75
  }
@@ -74,7 +77,7 @@ class PreviewSession {
74
77
  let BulkEditPreviewContribution = class BulkEditPreviewContribution {
75
78
  static { BulkEditPreviewContribution_1 = this; }
76
79
  static { this.ID = 'workbench.contrib.bulkEditPreview'; }
77
- static { this.ctxEnabled = ( (new RawContextKey('refactorPreview.enabled', false))); }
80
+ static { this.ctxEnabled = ( new RawContextKey('refactorPreview.enabled', false)); }
78
81
  constructor(_paneCompositeService, _viewsService, _editorGroupsService, _dialogService, bulkEditService, contextKeyService) {
79
82
  this._paneCompositeService = _paneCompositeService;
80
83
  this._viewsService = _viewsService;
@@ -85,7 +88,7 @@ let BulkEditPreviewContribution = class BulkEditPreviewContribution {
85
88
  }
86
89
  async _previewEdit(edits) {
87
90
  this._ctxEnabled.set(true);
88
- const uxState = this._activeSession?.uxState ?? ( (new UXState(this._paneCompositeService, this._editorGroupsService)));
91
+ const uxState = this._activeSession?.uxState ?? ( new UXState(this._paneCompositeService, this._editorGroupsService));
89
92
  const view = await getBulkEditPane(this._viewsService);
90
93
  if (!view) {
91
94
  this._ctxEnabled.set(false);
@@ -93,13 +96,13 @@ let BulkEditPreviewContribution = class BulkEditPreviewContribution {
93
96
  }
94
97
  if (view.hasInput()) {
95
98
  const { confirmed } = await this._dialogService.confirm({
96
- type: Severity$1.Info,
97
- message: ( localize(2127, "Another refactoring is being previewed.")),
99
+ type: Severity.Info,
100
+ message: ( localize(4078, "Another refactoring is being previewed.")),
98
101
  detail: ( localize(
99
- 2128,
102
+ 4079,
100
103
  "Press 'Continue' to discard the previous refactoring and continue with the current refactoring."
101
104
  )),
102
- primaryButton: ( localize(2129, "&&Continue"))
105
+ primaryButton: ( localize(4080, "&&Continue"))
103
106
  });
104
107
  if (!confirmed) {
105
108
  return [];
@@ -109,10 +112,10 @@ let BulkEditPreviewContribution = class BulkEditPreviewContribution {
109
112
  if (this._activeSession) {
110
113
  await this._activeSession.uxState.restore(false, true);
111
114
  this._activeSession.cts.dispose(true);
112
- session = ( (new PreviewSession(uxState)));
115
+ session = ( new PreviewSession(uxState));
113
116
  }
114
117
  else {
115
- session = ( (new PreviewSession(uxState)));
118
+ session = ( new PreviewSession(uxState));
116
119
  }
117
120
  this._activeSession = session;
118
121
  try {
@@ -128,33 +131,30 @@ let BulkEditPreviewContribution = class BulkEditPreviewContribution {
128
131
  }
129
132
  }
130
133
  };
131
- BulkEditPreviewContribution = BulkEditPreviewContribution_1 = ( (__decorate([
132
- ( (__param(0, IPaneCompositePartService))),
133
- ( (__param(1, IViewsService))),
134
- ( (__param(2, IEditorGroupsService))),
135
- ( (__param(3, IDialogService))),
136
- ( (__param(4, IBulkEditService))),
137
- ( (__param(5, IContextKeyService)))
138
- ], BulkEditPreviewContribution)));
134
+ BulkEditPreviewContribution = BulkEditPreviewContribution_1 = ( __decorate([
135
+ ( __param(0, IPaneCompositePartService)),
136
+ ( __param(1, IViewsService)),
137
+ ( __param(2, IEditorGroupsService)),
138
+ ( __param(3, IDialogService)),
139
+ ( __param(4, IBulkEditService)),
140
+ ( __param(5, IContextKeyService))
141
+ ], BulkEditPreviewContribution));
139
142
  registerAction2(class ApplyAction extends Action2 {
140
143
  constructor() {
141
144
  super({
142
145
  id: 'refactorPreview.apply',
143
- title: ( localize2(2130, "Apply Refactoring")),
144
- category: ( localize2(2131, "Refactor Preview")),
146
+ title: ( localize2(4081, "Apply Refactoring")),
147
+ category: ( localize2(4082, "Refactor Preview")),
145
148
  icon: Codicon.check,
146
- precondition: ( (ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, BulkEditPane.ctxHasCheckedChanges))),
149
+ precondition: ( ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, BulkEditPane.ctxHasCheckedChanges)),
147
150
  menu: [{
148
151
  id: MenuId.BulkEditContext,
149
152
  order: 1
150
153
  }],
151
154
  keybinding: {
152
- weight: 100 - 10,
153
- when: ( (ContextKeyExpr.and(
154
- BulkEditPreviewContribution.ctxEnabled,
155
- (FocusedViewContext.isEqualTo(BulkEditPane.ID))
156
- ))),
157
- primary: 2048 + 3 ,
155
+ weight: KeybindingWeight.EditorContrib - 10,
156
+ when: ( ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, ( FocusedViewContext.isEqualTo(BulkEditPane.ID)))),
157
+ primary: KeyMod.CtrlCmd + KeyCode.Enter,
158
158
  }
159
159
  });
160
160
  }
@@ -168,8 +168,8 @@ registerAction2(class DiscardAction extends Action2 {
168
168
  constructor() {
169
169
  super({
170
170
  id: 'refactorPreview.discard',
171
- title: ( localize2(2132, "Discard Refactoring")),
172
- category: ( localize2(2131, "Refactor Preview")),
171
+ title: ( localize2(4083, "Discard Refactoring")),
172
+ category: ( localize2(4082, "Refactor Preview")),
173
173
  icon: Codicon.clearAll,
174
174
  precondition: BulkEditPreviewContribution.ctxEnabled,
175
175
  menu: [{
@@ -188,13 +188,13 @@ registerAction2(class ToggleAction extends Action2 {
188
188
  constructor() {
189
189
  super({
190
190
  id: 'refactorPreview.toggleCheckedState',
191
- title: ( localize2(2133, "Toggle Change")),
192
- category: ( localize2(2131, "Refactor Preview")),
191
+ title: ( localize2(4084, "Toggle Change")),
192
+ category: ( localize2(4082, "Refactor Preview")),
193
193
  precondition: BulkEditPreviewContribution.ctxEnabled,
194
194
  keybinding: {
195
- weight: 200 ,
195
+ weight: KeybindingWeight.WorkbenchContrib,
196
196
  when: WorkbenchListFocusContextKey,
197
- primary: 10 ,
197
+ primary: KeyCode.Space,
198
198
  },
199
199
  menu: {
200
200
  id: MenuId.BulkEditContext,
@@ -212,20 +212,13 @@ registerAction2(class GroupByFile extends Action2 {
212
212
  constructor() {
213
213
  super({
214
214
  id: 'refactorPreview.groupByFile',
215
- title: ( localize2(2134, "Group Changes By File")),
216
- category: ( localize2(2131, "Refactor Preview")),
215
+ title: ( localize2(4085, "Group Changes By File")),
216
+ category: ( localize2(4082, "Refactor Preview")),
217
217
  icon: Codicon.ungroupByRefType,
218
- precondition: ( (ContextKeyExpr.and(
219
- BulkEditPane.ctxHasCategories,
220
- (BulkEditPane.ctxGroupByFile.negate()),
221
- BulkEditPreviewContribution.ctxEnabled
222
- ))),
218
+ precondition: ( ContextKeyExpr.and(BulkEditPane.ctxHasCategories, ( BulkEditPane.ctxGroupByFile.negate()), BulkEditPreviewContribution.ctxEnabled)),
223
219
  menu: [{
224
220
  id: MenuId.BulkEditTitle,
225
- when: ( (ContextKeyExpr.and(
226
- BulkEditPane.ctxHasCategories,
227
- (BulkEditPane.ctxGroupByFile.negate())
228
- ))),
221
+ when: ( ContextKeyExpr.and(BulkEditPane.ctxHasCategories, ( BulkEditPane.ctxGroupByFile.negate()))),
229
222
  group: 'navigation',
230
223
  order: 3,
231
224
  }]
@@ -241,17 +234,17 @@ registerAction2(class GroupByType extends Action2 {
241
234
  constructor() {
242
235
  super({
243
236
  id: 'refactorPreview.groupByType',
244
- title: ( localize2(2135, "Group Changes By Type")),
245
- category: ( localize2(2131, "Refactor Preview")),
237
+ title: ( localize2(4086, "Group Changes By Type")),
238
+ category: ( localize2(4082, "Refactor Preview")),
246
239
  icon: Codicon.groupByRefType,
247
- precondition: ( (ContextKeyExpr.and(
240
+ precondition: ( ContextKeyExpr.and(
248
241
  BulkEditPane.ctxHasCategories,
249
242
  BulkEditPane.ctxGroupByFile,
250
243
  BulkEditPreviewContribution.ctxEnabled
251
- ))),
244
+ )),
252
245
  menu: [{
253
246
  id: MenuId.BulkEditTitle,
254
- when: ( (ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPane.ctxGroupByFile))),
247
+ when: ( ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPane.ctxGroupByFile)),
255
248
  group: 'navigation',
256
249
  order: 3
257
250
  }]
@@ -267,11 +260,11 @@ registerAction2(class ToggleGrouping extends Action2 {
267
260
  constructor() {
268
261
  super({
269
262
  id: 'refactorPreview.toggleGrouping',
270
- title: ( localize2(2135, "Group Changes By Type")),
271
- category: ( localize2(2131, "Refactor Preview")),
263
+ title: ( localize2(4086, "Group Changes By Type")),
264
+ category: ( localize2(4082, "Refactor Preview")),
272
265
  icon: Codicon.listTree,
273
- toggled: ( (BulkEditPane.ctxGroupByFile.negate())),
274
- precondition: ( (ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPreviewContribution.ctxEnabled))),
266
+ toggled: ( BulkEditPane.ctxGroupByFile.negate()),
267
+ precondition: ( ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPreviewContribution.ctxEnabled)),
275
268
  menu: [{
276
269
  id: MenuId.BulkEditContext,
277
270
  order: 3
@@ -284,23 +277,23 @@ registerAction2(class ToggleGrouping extends Action2 {
284
277
  view?.toggleGrouping();
285
278
  }
286
279
  });
287
- registerWorkbenchContribution2(BulkEditPreviewContribution.ID, BulkEditPreviewContribution, 2 );
288
- const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localize(2136, 'View icon of the refactor preview view.')));
289
- const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerViewContainer({
280
+ registerWorkbenchContribution2(BulkEditPreviewContribution.ID, BulkEditPreviewContribution, WorkbenchPhase.BlockRestore);
281
+ const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localize(4087, 'View icon of the refactor preview view.')));
282
+ const container = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
290
283
  id: BulkEditPane.ID,
291
- title: ( localize2(2137, "Refactor Preview")),
284
+ title: ( localize2(4088, "Refactor Preview")),
292
285
  hideIfEmpty: true,
293
- ctorDescriptor: ( (new SyncDescriptor(
286
+ ctorDescriptor: ( new SyncDescriptor(
294
287
  ViewPaneContainer,
295
288
  [BulkEditPane.ID, { mergeViewWithContainerWhenSingleView: true }]
296
- ))),
289
+ )),
297
290
  icon: refactorPreviewViewIcon,
298
291
  storageId: BulkEditPane.ID
299
- }, 1 );
300
- ( (Registry.as(Extensions.ViewsRegistry))).registerViews([{
292
+ }, ViewContainerLocation.Panel);
293
+ ( Registry.as(Extensions.ViewsRegistry)).registerViews([{
301
294
  id: BulkEditPane.ID,
302
- name: ( localize2(2137, "Refactor Preview")),
295
+ name: ( localize2(4088, "Refactor Preview")),
303
296
  when: BulkEditPreviewContribution.ctxEnabled,
304
- ctorDescriptor: ( (new SyncDescriptor(BulkEditPane))),
297
+ ctorDescriptor: ( new SyncDescriptor(BulkEditPane)),
305
298
  containerIcon: refactorPreviewViewIcon,
306
299
  }], container);
@@ -1,4 +1,4 @@
1
- import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css.js';
1
+ import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css';
2
2
 
3
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
4
  n(css,{});
@@ -0,0 +1,65 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { ResourceEdit } from "vscode/vscode/vs/editor/browser/services/bulkEditService";
3
+ import { ITextModelService } from "vscode/vscode/vs/editor/common/services/resolverService";
4
+ import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
5
+ import { RawContextKey } from "vscode/vscode/vs/platform/contextkey/common/contextkey";
6
+ import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
7
+ import { IContextMenuService } from "vscode/vscode/vs/platform/contextview/browser/contextView.service";
8
+ import { IDialogService } from "vscode/vscode/vs/platform/dialogs/common/dialogs.service";
9
+ import { IHoverService } from "vscode/vscode/vs/platform/hover/browser/hover.service";
10
+ import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
11
+ import { IKeybindingService } from "vscode/vscode/vs/platform/keybinding/common/keybinding.service";
12
+ import { ILabelService } from "vscode/vscode/vs/platform/label/common/label.service";
13
+ import { IOpenerService } from "vscode/vscode/vs/platform/opener/common/opener.service";
14
+ import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
15
+ import { ITelemetryService } from "vscode/vscode/vs/platform/telemetry/common/telemetry.service";
16
+ import { IThemeService } from "vscode/vscode/vs/platform/theme/common/themeService.service";
17
+ import { ViewPane } from "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane";
18
+ import { IViewletViewOptions } from "@codingame/monaco-vscode-2a94c04a-b85b-5669-b06b-89c1bfa11cb9-common/vscode/vs/workbench/browser/parts/views/viewsViewlet";
19
+ import { IViewDescriptorService } from "vscode/vscode/vs/workbench/common/views.service";
20
+ import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
21
+ export declare class BulkEditPane extends ViewPane {
22
+ private readonly _instaService;
23
+ private readonly _editorService;
24
+ private readonly _labelService;
25
+ private readonly _textModelService;
26
+ private readonly _dialogService;
27
+ private readonly _contextMenuService;
28
+ private readonly _storageService;
29
+ static readonly ID = "refactorPreview";
30
+ static readonly Schema = "vscode-bulkeditpreview-multieditor";
31
+ static readonly ctxHasCategories: RawContextKey<false>;
32
+ static readonly ctxGroupByFile: RawContextKey<true>;
33
+ static readonly ctxHasCheckedChanges: RawContextKey<true>;
34
+ private static readonly _memGroupByFile;
35
+ private _tree;
36
+ private _treeDataSource;
37
+ private _treeViewStates;
38
+ private _message;
39
+ private readonly _ctxHasCategories;
40
+ private readonly _ctxGroupByFile;
41
+ private readonly _ctxHasCheckedChanges;
42
+ private readonly _disposables;
43
+ private readonly _sessionDisposables;
44
+ private _currentResolve?;
45
+ private _currentInput?;
46
+ private _currentProvider?;
47
+ constructor(options: IViewletViewOptions, _instaService: IInstantiationService, _editorService: IEditorService, _labelService: ILabelService, _textModelService: ITextModelService, _dialogService: IDialogService, _contextMenuService: IContextMenuService, _storageService: IStorageService, contextKeyService: IContextKeyService, viewDescriptorService: IViewDescriptorService, keybindingService: IKeybindingService, contextMenuService: IContextMenuService, configurationService: IConfigurationService, openerService: IOpenerService, themeService: IThemeService, telemetryService: ITelemetryService, hoverService: IHoverService);
48
+ dispose(): void;
49
+ protected renderBody(parent: HTMLElement): void;
50
+ protected layoutBody(height: number, width: number): void;
51
+ private _setState;
52
+ setInput(edit: ResourceEdit[], token: CancellationToken): Promise<ResourceEdit[] | undefined>;
53
+ hasInput(): boolean;
54
+ private _setTreeInput;
55
+ accept(): void;
56
+ discard(): void;
57
+ private _done;
58
+ toggleChecked(): void;
59
+ groupByFile(): void;
60
+ groupByType(): void;
61
+ toggleGrouping(): void;
62
+ private _openElementInMultiDiffEditor;
63
+ private readonly _computeResourceDiffEditorInputs;
64
+ private _onContextMenu;
65
+ }
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { ButtonBar } from 'vscode/vscode/vs/base/browser/ui/button/button';
3
4
  import { LRUCachedFunction, CachedFunction } from 'vscode/vscode/vs/base/common/cache';
4
5
  import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
@@ -18,26 +19,32 @@ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/
18
19
  import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
19
20
  import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
20
21
  import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
22
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
21
23
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
22
24
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
23
25
  import { defaultButtonStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
24
26
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
25
- import { ResourceLabels } from 'vscode/vscode/vs/workbench/browser/labels';
26
- import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
27
+ import { ResourceLabels } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/labels';
28
+ import { ViewPane } from '@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane';
27
29
  import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
28
- import { BulkEditPreviewProvider, BulkFileOperations } from './bulkEditPreview.js';
30
+ import { BulkFileOperationType, BulkEditPreviewProvider, BulkFileOperations } from './bulkEditPreview.js';
29
31
  import { compareBulkFileOperations, BulkEditDataSource, BulkEditDelegate, TextEditElementRenderer, FileElementRenderer, CategoryElementRenderer, BulkEditAccessibilityProvider, BulkEditIdentityProvider, BulkEditNaviLabelProvider, BulkEditSorter, FileElement, CategoryElement, TextEditElement } from './bulkEditTree.js';
30
32
  import { SIDE_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
31
33
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
32
34
 
33
35
  var BulkEditPane_1;
36
+ var State;
37
+ (function (State) {
38
+ State["Data"] = "data";
39
+ State["Message"] = "message";
40
+ })(State || (State = {}));
34
41
  let BulkEditPane = class BulkEditPane extends ViewPane {
35
42
  static { BulkEditPane_1 = this; }
36
43
  static { this.ID = 'refactorPreview'; }
37
44
  static { this.Schema = 'vscode-bulkeditpreview-multieditor'; }
38
- static { this.ctxHasCategories = ( (new RawContextKey('refactorPreview.hasCategories', false))); }
39
- static { this.ctxGroupByFile = ( (new RawContextKey('refactorPreview.groupByFile', true))); }
40
- static { this.ctxHasCheckedChanges = ( (new RawContextKey('refactorPreview.hasCheckedChanges', true))); }
45
+ static { this.ctxHasCategories = ( new RawContextKey('refactorPreview.hasCategories', false)); }
46
+ static { this.ctxGroupByFile = ( new RawContextKey('refactorPreview.groupByFile', true)); }
47
+ static { this.ctxHasCheckedChanges = ( new RawContextKey('refactorPreview.hasCheckedChanges', true)); }
41
48
  static { this._memGroupByFile = `${this.ID}.groupByFile`; }
42
49
  constructor(options, _instaService, _editorService, _labelService, _textModelService, _dialogService, _contextMenuService, _storageService, contextKeyService, viewDescriptorService, keybindingService, contextMenuService, configurationService, openerService, themeService, telemetryService, hoverService) {
43
50
  super({ ...options, titleMenuId: MenuId.BulkEditTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, _instaService, openerService, themeService, telemetryService, hoverService);
@@ -48,14 +55,14 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
48
55
  this._dialogService = _dialogService;
49
56
  this._contextMenuService = _contextMenuService;
50
57
  this._storageService = _storageService;
51
- this._treeViewStates = ( (new Map()));
52
- this._disposables = ( (new DisposableStore()));
53
- this._sessionDisposables = ( (new DisposableStore()));
54
- this._computeResourceDiffEditorInputs = ( (new LRUCachedFunction(async (fileOperations) => {
55
- const computeDiffEditorInput = ( (new CachedFunction(async (fileOperation) => {
58
+ this._treeViewStates = ( new Map());
59
+ this._disposables = ( new DisposableStore());
60
+ this._sessionDisposables = ( new DisposableStore());
61
+ this._computeResourceDiffEditorInputs = ( new LRUCachedFunction(async (fileOperations) => {
62
+ const computeDiffEditorInput = ( new CachedFunction(async (fileOperation) => {
56
63
  const fileOperationUri = fileOperation.uri;
57
64
  const previewUri = this._currentProvider.asPreviewUri(fileOperationUri);
58
- if (fileOperation.type & 4 ) {
65
+ if (fileOperation.type & BulkFileOperationType.Delete) {
59
66
  return {
60
67
  original: { resource: URI.revive(previewUri) },
61
68
  modified: { resource: undefined },
@@ -77,7 +84,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
77
84
  goToFileResource: leftResource,
78
85
  };
79
86
  }
80
- })));
87
+ }));
81
88
  const sortedFileOperations = fileOperations.slice().sort(compareBulkFileOperations);
82
89
  const resources = [];
83
90
  for (const operation of sortedFileOperations) {
@@ -91,7 +98,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
91
98
  resources,
92
99
  getResourceDiffEditorInputIdOfOperation
93
100
  };
94
- })));
101
+ }));
95
102
  this.element.classList.add('bulk-edit-panel', 'show-file-icons');
96
103
  this._ctxHasCategories = BulkEditPane_1.ctxHasCategories.bindTo(contextKeyService);
97
104
  this._ctxGroupByFile = BulkEditPane_1.ctxGroupByFile.bindTo(contextKeyService);
@@ -113,15 +120,15 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
113
120
  const treeContainer = document.createElement('div');
114
121
  contentContainer.appendChild(treeContainer);
115
122
  this._treeDataSource = this._instaService.createInstance(BulkEditDataSource);
116
- this._treeDataSource.groupByFile = this._storageService.getBoolean(BulkEditPane_1._memGroupByFile, 0 , true);
123
+ this._treeDataSource.groupByFile = this._storageService.getBoolean(BulkEditPane_1._memGroupByFile, StorageScope.PROFILE, true);
117
124
  this._ctxGroupByFile.set(this._treeDataSource.groupByFile);
118
- this._tree = this._instaService.createInstance(WorkbenchAsyncDataTree, this.id, treeContainer, ( (new BulkEditDelegate())), [this._instaService.createInstance(TextEditElementRenderer), this._instaService.createInstance(FileElementRenderer, resourceLabels), this._instaService.createInstance(CategoryElementRenderer)], this._treeDataSource, {
125
+ this._tree = this._instaService.createInstance((WorkbenchAsyncDataTree), this.id, treeContainer, ( new BulkEditDelegate()), [this._instaService.createInstance(TextEditElementRenderer), this._instaService.createInstance(FileElementRenderer, resourceLabels), this._instaService.createInstance(CategoryElementRenderer)], this._treeDataSource, {
119
126
  accessibilityProvider: this._instaService.createInstance(BulkEditAccessibilityProvider),
120
- identityProvider: ( (new BulkEditIdentityProvider())),
127
+ identityProvider: ( new BulkEditIdentityProvider()),
121
128
  expandOnlyOnTwistieClick: true,
122
129
  multipleSelectionSupport: false,
123
- keyboardNavigationLabelProvider: ( (new BulkEditNaviLabelProvider())),
124
- sorter: ( (new BulkEditSorter())),
130
+ keyboardNavigationLabelProvider: ( new BulkEditNaviLabelProvider()),
131
+ sorter: ( new BulkEditSorter()),
125
132
  selectionNavigation: true
126
133
  });
127
134
  this._disposables.add(this._tree.onContextMenu(this._onContextMenu, this));
@@ -129,22 +136,22 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
129
136
  const buttonsContainer = document.createElement('div');
130
137
  buttonsContainer.className = 'buttons';
131
138
  contentContainer.appendChild(buttonsContainer);
132
- const buttonBar = ( (new ButtonBar(buttonsContainer)));
139
+ const buttonBar = ( new ButtonBar(buttonsContainer));
133
140
  this._disposables.add(buttonBar);
134
141
  const btnConfirm = buttonBar.addButton({ supportIcons: true, ...defaultButtonStyles });
135
- btnConfirm.label = ( localize(5280, 'Apply'));
142
+ btnConfirm.label = ( localize(4089, 'Apply'));
136
143
  btnConfirm.onDidClick(() => this.accept(), this, this._disposables);
137
144
  const btnCancel = buttonBar.addButton({ ...defaultButtonStyles, secondary: true });
138
- btnCancel.label = ( localize(5281, 'Discard'));
145
+ btnCancel.label = ( localize(4090, 'Discard'));
139
146
  btnCancel.onDidClick(() => this.discard(), this, this._disposables);
140
147
  this._message = document.createElement('span');
141
148
  this._message.className = 'message';
142
149
  this._message.innerText = ( localize(
143
- 5282,
150
+ 4091,
144
151
  "Invoke a code action, like rename, to see a preview of its changes here."
145
152
  ));
146
153
  parent.appendChild(this._message);
147
- this._setState("message" );
154
+ this._setState(State.Message);
148
155
  }
149
156
  layoutBody(height, width) {
150
157
  super.layoutBody(height, width);
@@ -156,7 +163,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
156
163
  this.element.dataset['state'] = state;
157
164
  }
158
165
  async setInput(edit, token) {
159
- this._setState("data" );
166
+ this._setState(State.Data);
160
167
  this._sessionDisposables.clear();
161
168
  this._treeViewStates.clear();
162
169
  if (this._currentResolve) {
@@ -172,17 +179,15 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
172
179
  this._treeDataSource.groupByFile = !hasCategories || this._treeDataSource.groupByFile;
173
180
  this._ctxHasCheckedChanges.set(input.checked.checkedCount > 0);
174
181
  this._currentInput = input;
175
- return (
176
- (new Promise(resolve => {
177
- token.onCancellationRequested(() => resolve(undefined));
178
- this._currentResolve = resolve;
179
- this._setTreeInput(input);
180
- this._sessionDisposables.add(input.checked.onDidChange(() => {
181
- this._tree.updateChildren();
182
- this._ctxHasCheckedChanges.set(input.checked.checkedCount > 0);
183
- }));
184
- }))
185
- );
182
+ return ( new Promise(resolve => {
183
+ token.onCancellationRequested(() => resolve(undefined));
184
+ this._currentResolve = resolve;
185
+ this._setTreeInput(input);
186
+ this._sessionDisposables.add(input.checked.onDidChange(() => {
187
+ this._tree.updateChildren();
188
+ this._ctxHasCheckedChanges.set(input.checked.checkedCount > 0);
189
+ }));
190
+ }));
186
191
  }
187
192
  hasInput() {
188
193
  return Boolean(this._currentInput);
@@ -215,14 +220,14 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
215
220
  let message;
216
221
  if (conflicts.length === 1) {
217
222
  message = ( localize(
218
- 5283,
223
+ 4092,
219
224
  "Cannot apply refactoring because '{0}' has changed in the meantime.",
220
225
  this._labelService.getUriLabel(conflicts[0], { relative: true })
221
226
  ));
222
227
  }
223
228
  else {
224
229
  message = ( localize(
225
- 5284,
230
+ 4093,
226
231
  "Cannot apply refactoring because {0} other files have changed in the meantime.",
227
232
  conflicts.length
228
233
  ));
@@ -235,7 +240,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
235
240
  _done(accept) {
236
241
  this._currentResolve?.(accept ? this._currentInput?.getWorkspaceEdit() : undefined);
237
242
  this._currentInput = undefined;
238
- this._setState("message" );
243
+ this._setState(State.Message);
239
244
  this._sessionDisposables.clear();
240
245
  }
241
246
  toggleChecked() {
@@ -264,7 +269,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
264
269
  this._treeViewStates.set(this._treeDataSource.groupByFile, oldViewState);
265
270
  this._treeDataSource.groupByFile = !this._treeDataSource.groupByFile;
266
271
  this._setTreeInput(input);
267
- this._storageService.store(BulkEditPane_1._memGroupByFile, this._treeDataSource.groupByFile, 0 , 0 );
272
+ this._storageService.store(BulkEditPane_1._memGroupByFile, this._treeDataSource.groupByFile, StorageScope.PROFILE, StorageTarget.USER);
268
273
  this._ctxGroupByFile.set(this._treeDataSource.groupByFile);
269
274
  }
270
275
  }
@@ -297,7 +302,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
297
302
  }
298
303
  }
299
304
  };
300
- const multiDiffSource = ( (URI.from({ scheme: BulkEditPane_1.Schema })));
305
+ const multiDiffSource = ( URI.from({ scheme: BulkEditPane_1.Schema }));
301
306
  const label = 'Refactor Preview';
302
307
  this._editorService.openEditor({
303
308
  multiDiffSource,
@@ -316,23 +321,23 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
316
321
  });
317
322
  }
318
323
  };
319
- BulkEditPane = BulkEditPane_1 = ( (__decorate([
320
- ( (__param(1, IInstantiationService))),
321
- ( (__param(2, IEditorService))),
322
- ( (__param(3, ILabelService))),
323
- ( (__param(4, ITextModelService))),
324
- ( (__param(5, IDialogService))),
325
- ( (__param(6, IContextMenuService))),
326
- ( (__param(7, IStorageService))),
327
- ( (__param(8, IContextKeyService))),
328
- ( (__param(9, IViewDescriptorService))),
329
- ( (__param(10, IKeybindingService))),
330
- ( (__param(11, IContextMenuService))),
331
- ( (__param(12, IConfigurationService))),
332
- ( (__param(13, IOpenerService))),
333
- ( (__param(14, IThemeService))),
334
- ( (__param(15, ITelemetryService))),
335
- ( (__param(16, IHoverService)))
336
- ], BulkEditPane)));
324
+ BulkEditPane = BulkEditPane_1 = ( __decorate([
325
+ ( __param(1, IInstantiationService)),
326
+ ( __param(2, IEditorService)),
327
+ ( __param(3, ILabelService)),
328
+ ( __param(4, ITextModelService)),
329
+ ( __param(5, IDialogService)),
330
+ ( __param(6, IContextMenuService)),
331
+ ( __param(7, IStorageService)),
332
+ ( __param(8, IContextKeyService)),
333
+ ( __param(9, IViewDescriptorService)),
334
+ ( __param(10, IKeybindingService)),
335
+ ( __param(11, IContextMenuService)),
336
+ ( __param(12, IConfigurationService)),
337
+ ( __param(13, IOpenerService)),
338
+ ( __param(14, IThemeService)),
339
+ ( __param(15, ITelemetryService)),
340
+ ( __param(16, IHoverService))
341
+ ], BulkEditPane));
337
342
 
338
343
  export { BulkEditPane };