@theia/bulk-edit 1.53.0-next.4 → 1.53.0-next.55

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/README.md CHANGED
@@ -1,30 +1,30 @@
1
- <div align='center'>
2
-
3
- <br />
4
-
5
- <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
-
7
- <h2>ECLIPSE THEIA - BULK EDIT EXTENSION</h2>
8
-
9
- <hr />
10
-
11
- </div>
12
-
13
- ## Description
14
-
15
- The `@theia/bulk-edit` extension contributes a `Refactor Preview` widget to the application that displays WorkspaceEdits to end-users.
16
-
17
- ## Additional Information
18
-
19
- - [API documentation for `@theia/bulk-edit`](https://eclipse-theia.github.io/theia/docs/next/modules/bulk-edit.html)
20
- - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
- - [Theia - Website](https://theia-ide.org/)
22
-
23
- ## License
24
-
25
- - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
26
- - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
27
-
28
- ## Trademark
29
- "Theia" is a trademark of the Eclipse Foundation
30
- https://www.eclipse.org/theia
1
+ <div align='center'>
2
+
3
+ <br />
4
+
5
+ <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
+
7
+ <h2>ECLIPSE THEIA - BULK EDIT EXTENSION</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ The `@theia/bulk-edit` extension contributes a `Refactor Preview` widget to the application that displays WorkspaceEdits to end-users.
16
+
17
+ ## Additional Information
18
+
19
+ - [API documentation for `@theia/bulk-edit`](https://eclipse-theia.github.io/theia/docs/next/modules/bulk-edit.html)
20
+ - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
+ - [Theia - Website](https://theia-ide.org/)
22
+
23
+ ## License
24
+
25
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
26
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
27
+
28
+ ## Trademark
29
+ "Theia" is a trademark of the Eclipse Foundation
30
+ https://www.eclipse.org/theia
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@theia/bulk-edit",
3
- "version": "1.53.0-next.4+9e9124118",
3
+ "version": "1.53.0-next.55+d1a989a68c",
4
4
  "description": "Theia - Bulk Edit Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.53.0-next.4+9e9124118",
7
- "@theia/editor": "1.53.0-next.4+9e9124118",
8
- "@theia/filesystem": "1.53.0-next.4+9e9124118",
9
- "@theia/monaco": "1.53.0-next.4+9e9124118",
6
+ "@theia/core": "1.53.0-next.55+d1a989a68c",
7
+ "@theia/editor": "1.53.0-next.55+d1a989a68c",
8
+ "@theia/filesystem": "1.53.0-next.55+d1a989a68c",
9
+ "@theia/monaco": "1.53.0-next.55+d1a989a68c",
10
10
  "@theia/monaco-editor-core": "1.83.101",
11
- "@theia/workspace": "1.53.0-next.4+9e9124118",
11
+ "@theia/workspace": "1.53.0-next.55+d1a989a68c",
12
12
  "tslib": "^2.6.2"
13
13
  },
14
14
  "publishConfig": {
@@ -44,10 +44,10 @@
44
44
  "watch": "theiaext watch"
45
45
  },
46
46
  "devDependencies": {
47
- "@theia/ext-scripts": "1.52.0"
47
+ "@theia/ext-scripts": "1.53.0"
48
48
  },
49
49
  "nyc": {
50
50
  "extends": "../../configs/nyc.json"
51
51
  },
52
- "gitHead": "9e912411843f32b2a549ef6580b07872edd95e8b"
52
+ "gitHead": "d1a989a68c1b5ec1f9098e9126653c6346844769"
53
53
  }
@@ -1,34 +1,34 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { codicon } from '@theia/core/lib/browser';
18
- import { Command } from '@theia/core/lib/common';
19
-
20
- export namespace BulkEditCommands {
21
- export const TOGGLE_VIEW: Command = {
22
- id: 'bulk-edit:toggleView'
23
- };
24
-
25
- export const APPLY: Command = {
26
- id: 'bulk-edit:apply',
27
- iconClass: codicon('check')
28
- };
29
-
30
- export const DISCARD: Command = {
31
- id: 'bulk-edit:discard',
32
- iconClass: codicon('clear-all')
33
- };
34
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { codicon } from '@theia/core/lib/browser';
18
+ import { Command } from '@theia/core/lib/common';
19
+
20
+ export namespace BulkEditCommands {
21
+ export const TOGGLE_VIEW: Command = {
22
+ id: 'bulk-edit:toggleView'
23
+ };
24
+
25
+ export const APPLY: Command = {
26
+ id: 'bulk-edit:apply',
27
+ iconClass: codicon('check')
28
+ };
29
+
30
+ export const DISCARD: Command = {
31
+ id: 'bulk-edit:discard',
32
+ iconClass: codicon('clear-all')
33
+ };
34
+ }
@@ -1,112 +1,112 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { injectable, inject, optional } from '@theia/core/shared/inversify';
18
- import { Widget } from '@theia/core/lib/browser/widgets/widget';
19
- import { CommandRegistry } from '@theia/core/lib/common';
20
- import { AbstractViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
21
- import { BulkEditCommands } from './bulk-edit-commands';
22
- import { MonacoBulkEditService } from '@theia/monaco/lib/browser/monaco-bulk-edit-service';
23
- import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
24
- import { BulkEditTreeWidget, BULK_EDIT_TREE_WIDGET_ID, BULK_EDIT_WIDGET_NAME } from './bulk-edit-tree';
25
- import { QuickViewService } from '@theia/core/lib/browser';
26
- import { nls } from '@theia/core/lib/common/nls';
27
- import { ResourceEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
28
-
29
- @injectable()
30
- export class BulkEditContribution extends AbstractViewContribution<BulkEditTreeWidget> implements TabBarToolbarContribution {
31
- private edits: ResourceEdit[];
32
-
33
- @inject(QuickViewService) @optional()
34
- protected override readonly quickView: QuickViewService;
35
-
36
- constructor(private readonly bulkEditService: MonacoBulkEditService) {
37
- super({
38
- widgetId: BULK_EDIT_TREE_WIDGET_ID,
39
- widgetName: BULK_EDIT_WIDGET_NAME,
40
- defaultWidgetOptions: {
41
- area: 'bottom'
42
- }
43
- });
44
- this.bulkEditService.setPreviewHandler((edits: ResourceEdit[]) => this.previewEdit(edits));
45
- }
46
-
47
- override registerCommands(registry: CommandRegistry): void {
48
- super.registerCommands(registry);
49
- this.quickView?.hideItem(BULK_EDIT_WIDGET_NAME);
50
-
51
- registry.registerCommand(BulkEditCommands.APPLY, {
52
- isEnabled: widget => this.withWidget(widget, () => true),
53
- isVisible: widget => this.withWidget(widget, () => true),
54
- execute: widget => this.withWidget(widget, () => this.apply())
55
- });
56
- registry.registerCommand(BulkEditCommands.DISCARD, {
57
- isEnabled: widget => this.withWidget(widget, () => true),
58
- isVisible: widget => this.withWidget(widget, () => true),
59
- execute: widget => this.withWidget(widget, () => this.discard())
60
- });
61
- }
62
-
63
- async registerToolbarItems(toolbarRegistry: TabBarToolbarRegistry): Promise<void> {
64
- toolbarRegistry.registerItem({
65
- id: BulkEditCommands.APPLY.id,
66
- command: BulkEditCommands.APPLY.id,
67
- tooltip: nls.localizeByDefault('Apply Refactoring'),
68
- priority: 0,
69
- });
70
- toolbarRegistry.registerItem({
71
- id: BulkEditCommands.DISCARD.id,
72
- command: BulkEditCommands.DISCARD.id,
73
- tooltip: nls.localizeByDefault('Discard Refactoring'),
74
- priority: 1,
75
- });
76
- }
77
-
78
- protected withWidget<T>(widget: Widget | undefined = this.tryGetWidget(), cb: (bulkEdit: BulkEditTreeWidget) => T): T | false {
79
- if (widget instanceof BulkEditTreeWidget) {
80
- return cb(widget);
81
- }
82
- return false;
83
- }
84
-
85
- private async previewEdit(edits: ResourceEdit[]): Promise<ResourceEdit[]> {
86
- const widget = await this.openView({ activate: true });
87
-
88
- if (widget) {
89
- this.edits = edits;
90
- await widget.initModel(edits);
91
- }
92
-
93
- return edits;
94
- }
95
-
96
- private apply(): void {
97
- if (this.edits) {
98
- this.edits.forEach(edit => {
99
- if (edit.metadata) {
100
- edit.metadata.needsConfirmation = false;
101
- }
102
- });
103
- this.bulkEditService.apply(this.edits);
104
- }
105
- this.closeView();
106
- }
107
-
108
- private discard(): void {
109
- this.edits = [];
110
- this.closeView();
111
- }
112
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { injectable, inject, optional } from '@theia/core/shared/inversify';
18
+ import { Widget } from '@theia/core/lib/browser/widgets/widget';
19
+ import { CommandRegistry } from '@theia/core/lib/common';
20
+ import { AbstractViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
21
+ import { BulkEditCommands } from './bulk-edit-commands';
22
+ import { MonacoBulkEditService } from '@theia/monaco/lib/browser/monaco-bulk-edit-service';
23
+ import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
24
+ import { BulkEditTreeWidget, BULK_EDIT_TREE_WIDGET_ID, BULK_EDIT_WIDGET_NAME } from './bulk-edit-tree';
25
+ import { QuickViewService } from '@theia/core/lib/browser';
26
+ import { nls } from '@theia/core/lib/common/nls';
27
+ import { ResourceEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
28
+
29
+ @injectable()
30
+ export class BulkEditContribution extends AbstractViewContribution<BulkEditTreeWidget> implements TabBarToolbarContribution {
31
+ private edits: ResourceEdit[];
32
+
33
+ @inject(QuickViewService) @optional()
34
+ protected override readonly quickView: QuickViewService;
35
+
36
+ constructor(private readonly bulkEditService: MonacoBulkEditService) {
37
+ super({
38
+ widgetId: BULK_EDIT_TREE_WIDGET_ID,
39
+ widgetName: BULK_EDIT_WIDGET_NAME,
40
+ defaultWidgetOptions: {
41
+ area: 'bottom'
42
+ }
43
+ });
44
+ this.bulkEditService.setPreviewHandler((edits: ResourceEdit[]) => this.previewEdit(edits));
45
+ }
46
+
47
+ override registerCommands(registry: CommandRegistry): void {
48
+ super.registerCommands(registry);
49
+ this.quickView?.hideItem(BULK_EDIT_WIDGET_NAME);
50
+
51
+ registry.registerCommand(BulkEditCommands.APPLY, {
52
+ isEnabled: widget => this.withWidget(widget, () => true),
53
+ isVisible: widget => this.withWidget(widget, () => true),
54
+ execute: widget => this.withWidget(widget, () => this.apply())
55
+ });
56
+ registry.registerCommand(BulkEditCommands.DISCARD, {
57
+ isEnabled: widget => this.withWidget(widget, () => true),
58
+ isVisible: widget => this.withWidget(widget, () => true),
59
+ execute: widget => this.withWidget(widget, () => this.discard())
60
+ });
61
+ }
62
+
63
+ async registerToolbarItems(toolbarRegistry: TabBarToolbarRegistry): Promise<void> {
64
+ toolbarRegistry.registerItem({
65
+ id: BulkEditCommands.APPLY.id,
66
+ command: BulkEditCommands.APPLY.id,
67
+ tooltip: nls.localizeByDefault('Apply Refactoring'),
68
+ priority: 0,
69
+ });
70
+ toolbarRegistry.registerItem({
71
+ id: BulkEditCommands.DISCARD.id,
72
+ command: BulkEditCommands.DISCARD.id,
73
+ tooltip: nls.localizeByDefault('Discard Refactoring'),
74
+ priority: 1,
75
+ });
76
+ }
77
+
78
+ protected withWidget<T>(widget: Widget | undefined = this.tryGetWidget(), cb: (bulkEdit: BulkEditTreeWidget) => T): T | false {
79
+ if (widget instanceof BulkEditTreeWidget) {
80
+ return cb(widget);
81
+ }
82
+ return false;
83
+ }
84
+
85
+ private async previewEdit(edits: ResourceEdit[]): Promise<ResourceEdit[]> {
86
+ const widget = await this.openView({ activate: true });
87
+
88
+ if (widget) {
89
+ this.edits = edits;
90
+ await widget.initModel(edits);
91
+ }
92
+
93
+ return edits;
94
+ }
95
+
96
+ private apply(): void {
97
+ if (this.edits) {
98
+ this.edits.forEach(edit => {
99
+ if (edit.metadata) {
100
+ edit.metadata.needsConfirmation = false;
101
+ }
102
+ });
103
+ this.bulkEditService.apply(this.edits);
104
+ }
105
+ this.closeView();
106
+ }
107
+
108
+ private discard(): void {
109
+ this.edits = [];
110
+ this.closeView();
111
+ }
112
+ }
@@ -1,39 +1,39 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
- import { ContainerModule } from '@theia/core/shared/inversify';
17
- import { WidgetFactory } from '@theia/core/lib/browser/widget-manager';
18
- import { BulkEditTreeWidget, BULK_EDIT_TREE_WIDGET_ID, createBulkEditTreeWidget } from './bulk-edit-tree';
19
- import { FrontendApplicationContribution, LabelProviderContribution, bindViewContribution } from '@theia/core/lib/browser';
20
- import { BulkEditContribution } from './bulk-edit-contribution';
21
- import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
22
- import { BulkEditTreeLabelProvider } from './bulk-edit-tree-label-provider';
23
- import '../../src/browser/style/bulk-edit.css';
24
-
25
- export default new ContainerModule(bind => {
26
- bind(BulkEditTreeWidget).toDynamicValue(ctx =>
27
- createBulkEditTreeWidget(ctx.container)
28
- );
29
- bind(WidgetFactory).toDynamicValue(context => ({
30
- id: BULK_EDIT_TREE_WIDGET_ID,
31
- createWidget: () => context.container.get(BulkEditTreeWidget)
32
- }));
33
- bindViewContribution(bind, BulkEditContribution);
34
- bind(FrontendApplicationContribution).toService(BulkEditContribution);
35
- bind(TabBarToolbarContribution).toService(BulkEditContribution);
36
-
37
- bind(BulkEditTreeLabelProvider).toSelf().inSingletonScope();
38
- bind(LabelProviderContribution).toService(BulkEditTreeLabelProvider);
39
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+ import { ContainerModule } from '@theia/core/shared/inversify';
17
+ import { WidgetFactory } from '@theia/core/lib/browser/widget-manager';
18
+ import { BulkEditTreeWidget, BULK_EDIT_TREE_WIDGET_ID, createBulkEditTreeWidget } from './bulk-edit-tree';
19
+ import { FrontendApplicationContribution, LabelProviderContribution, bindViewContribution } from '@theia/core/lib/browser';
20
+ import { BulkEditContribution } from './bulk-edit-contribution';
21
+ import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
22
+ import { BulkEditTreeLabelProvider } from './bulk-edit-tree-label-provider';
23
+ import '../../src/browser/style/bulk-edit.css';
24
+
25
+ export default new ContainerModule(bind => {
26
+ bind(BulkEditTreeWidget).toDynamicValue(ctx =>
27
+ createBulkEditTreeWidget(ctx.container)
28
+ );
29
+ bind(WidgetFactory).toDynamicValue(context => ({
30
+ id: BULK_EDIT_TREE_WIDGET_ID,
31
+ createWidget: () => context.container.get(BulkEditTreeWidget)
32
+ }));
33
+ bindViewContribution(bind, BulkEditContribution);
34
+ bind(FrontendApplicationContribution).toService(BulkEditContribution);
35
+ bind(TabBarToolbarContribution).toService(BulkEditContribution);
36
+
37
+ bind(BulkEditTreeLabelProvider).toSelf().inSingletonScope();
38
+ bind(LabelProviderContribution).toService(BulkEditTreeLabelProvider);
39
+ });
@@ -1,44 +1,44 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { SelectionService } from '@theia/core/lib/common/selection-service';
18
- import { SelectionCommandHandler } from '@theia/core/lib/common/selection-command-handler';
19
- import { ResourceFileEdit, ResourceTextEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
20
- import { isObject } from '@theia/core/lib/common';
21
-
22
- export interface BulkEditNodeSelection {
23
- bulkEdit: ResourceFileEdit | ResourceTextEdit;
24
- }
25
- export namespace BulkEditNodeSelection {
26
- export function is(arg: unknown): arg is BulkEditNodeSelection {
27
- return isObject(arg) && 'bulkEdit' in arg;
28
- }
29
-
30
- export class CommandHandler extends SelectionCommandHandler<BulkEditNodeSelection> {
31
-
32
- constructor(
33
- protected override readonly selectionService: SelectionService,
34
- protected override readonly options: SelectionCommandHandler.Options<BulkEditNodeSelection>
35
- ) {
36
- super(
37
- selectionService,
38
- arg => BulkEditNodeSelection.is(arg) ? arg : undefined,
39
- options
40
- );
41
- }
42
- }
43
-
44
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { SelectionService } from '@theia/core/lib/common/selection-service';
18
+ import { SelectionCommandHandler } from '@theia/core/lib/common/selection-command-handler';
19
+ import { ResourceFileEdit, ResourceTextEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
20
+ import { isObject } from '@theia/core/lib/common';
21
+
22
+ export interface BulkEditNodeSelection {
23
+ bulkEdit: ResourceFileEdit | ResourceTextEdit;
24
+ }
25
+ export namespace BulkEditNodeSelection {
26
+ export function is(arg: unknown): arg is BulkEditNodeSelection {
27
+ return isObject(arg) && 'bulkEdit' in arg;
28
+ }
29
+
30
+ export class CommandHandler extends SelectionCommandHandler<BulkEditNodeSelection> {
31
+
32
+ constructor(
33
+ protected override readonly selectionService: SelectionService,
34
+ protected override readonly options: SelectionCommandHandler.Options<BulkEditNodeSelection>
35
+ ) {
36
+ super(
37
+ selectionService,
38
+ arg => BulkEditNodeSelection.is(arg) ? arg : undefined,
39
+ options
40
+ );
41
+ }
42
+ }
43
+
44
+ }
@@ -1,35 +1,35 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { interfaces, Container } from '@theia/core/shared/inversify';
18
- import { BulkEditTreeWidget } from './bulk-edit-tree-widget';
19
- import { BulkEditTree } from './bulk-edit-tree';
20
- import { BulkEditTreeModel } from './bulk-edit-tree-model';
21
- import { createTreeContainer } from '@theia/core/lib/browser';
22
-
23
- export function createBulkEditContainer(parent: interfaces.Container): Container {
24
- const child = createTreeContainer(parent, {
25
- tree: BulkEditTree,
26
- widget: BulkEditTreeWidget,
27
- model: BulkEditTreeModel,
28
- });
29
-
30
- return child;
31
- }
32
-
33
- export function createBulkEditTreeWidget(parent: interfaces.Container): BulkEditTreeWidget {
34
- return createBulkEditContainer(parent).get(BulkEditTreeWidget);
35
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { interfaces, Container } from '@theia/core/shared/inversify';
18
+ import { BulkEditTreeWidget } from './bulk-edit-tree-widget';
19
+ import { BulkEditTree } from './bulk-edit-tree';
20
+ import { BulkEditTreeModel } from './bulk-edit-tree-model';
21
+ import { createTreeContainer } from '@theia/core/lib/browser';
22
+
23
+ export function createBulkEditContainer(parent: interfaces.Container): Container {
24
+ const child = createTreeContainer(parent, {
25
+ tree: BulkEditTree,
26
+ widget: BulkEditTreeWidget,
27
+ model: BulkEditTreeModel,
28
+ });
29
+
30
+ return child;
31
+ }
32
+
33
+ export function createBulkEditTreeWidget(parent: interfaces.Container): BulkEditTreeWidget {
34
+ return createBulkEditContainer(parent).get(BulkEditTreeWidget);
35
+ }