@theia/bulk-edit 1.45.1 → 1.46.0-next.72
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 +30 -30
- package/lib/browser/bulk-edit-commands.d.ts +6 -6
- package/lib/browser/bulk-edit-commands.js +33 -33
- package/lib/browser/bulk-edit-contribution.d.ts +19 -19
- package/lib/browser/bulk-edit-contribution.js +115 -115
- package/lib/browser/bulk-edit-frontend-module.d.ts +4 -4
- package/lib/browser/bulk-edit-frontend-module.js +37 -37
- package/lib/browser/bulk-edit-tree/bulk-edit-node-selection.d.ts +14 -14
- package/lib/browser/bulk-edit-tree/bulk-edit-node-selection.js +35 -35
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-container.d.ts +4 -4
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-container.js +35 -35
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-model.d.ts +10 -10
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-model.js +58 -58
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-widget.d.ts +33 -33
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-widget.js +231 -231
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.d.ts +24 -24
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.js +112 -112
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.spec.d.ts +1 -1
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.spec.js +62 -62
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.spec.js.map +1 -1
- package/lib/browser/bulk-edit-tree/index.d.ts +5 -5
- package/lib/browser/bulk-edit-tree/index.js +32 -32
- package/lib/browser/bulk-edit-tree-label-provider.d.ts +15 -15
- package/lib/browser/bulk-edit-tree-label-provider.js +80 -80
- package/package.json +9 -9
- package/src/browser/bulk-edit-commands.ts +34 -34
- package/src/browser/bulk-edit-contribution.ts +112 -112
- package/src/browser/bulk-edit-frontend-module.ts +39 -39
- package/src/browser/bulk-edit-tree/bulk-edit-node-selection.ts +44 -44
- package/src/browser/bulk-edit-tree/bulk-edit-tree-container.ts +35 -35
- package/src/browser/bulk-edit-tree/bulk-edit-tree-model.ts +42 -42
- package/src/browser/bulk-edit-tree/bulk-edit-tree-widget.tsx +231 -231
- package/src/browser/bulk-edit-tree/bulk-edit-tree.spec.ts +73 -73
- package/src/browser/bulk-edit-tree/bulk-edit-tree.ts +114 -114
- package/src/browser/bulk-edit-tree/index.ts +21 -21
- package/src/browser/bulk-edit-tree-label-provider.ts +71 -71
- package/src/browser/style/bulk-edit.css +66 -66
|
@@ -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
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
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 } from '@theia/core/shared/inversify';
|
|
18
|
-
import { BulkEditNode, BulkEditTree } from './bulk-edit-tree';
|
|
19
|
-
import { TreeModelImpl, OpenerService, open, TreeNode } from '@theia/core/lib/browser';
|
|
20
|
-
import { ResourceEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
|
|
21
|
-
|
|
22
|
-
@injectable()
|
|
23
|
-
export class BulkEditTreeModel extends TreeModelImpl {
|
|
24
|
-
@inject(BulkEditTree) protected override readonly tree: BulkEditTree;
|
|
25
|
-
@inject(OpenerService) protected readonly openerService: OpenerService;
|
|
26
|
-
|
|
27
|
-
protected override doOpenNode(node: TreeNode): void {
|
|
28
|
-
if (BulkEditNode.is(node)) {
|
|
29
|
-
open(this.openerService, node.uri, undefined);
|
|
30
|
-
} else {
|
|
31
|
-
super.doOpenNode(node);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
revealNode(node: TreeNode): void {
|
|
36
|
-
this.doOpenNode(node);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async initModel(edits: ResourceEdit[], fileContents: Map<string, string>): Promise<void> {
|
|
40
|
-
this.tree.initTree(edits, fileContents);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
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 } from '@theia/core/shared/inversify';
|
|
18
|
+
import { BulkEditNode, BulkEditTree } from './bulk-edit-tree';
|
|
19
|
+
import { TreeModelImpl, OpenerService, open, TreeNode } from '@theia/core/lib/browser';
|
|
20
|
+
import { ResourceEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export class BulkEditTreeModel extends TreeModelImpl {
|
|
24
|
+
@inject(BulkEditTree) protected override readonly tree: BulkEditTree;
|
|
25
|
+
@inject(OpenerService) protected readonly openerService: OpenerService;
|
|
26
|
+
|
|
27
|
+
protected override doOpenNode(node: TreeNode): void {
|
|
28
|
+
if (BulkEditNode.is(node)) {
|
|
29
|
+
open(this.openerService, node.uri, undefined);
|
|
30
|
+
} else {
|
|
31
|
+
super.doOpenNode(node);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
revealNode(node: TreeNode): void {
|
|
36
|
+
this.doOpenNode(node);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async initModel(edits: ResourceEdit[], fileContents: Map<string, string>): Promise<void> {
|
|
40
|
+
this.tree.initTree(edits, fileContents);
|
|
41
|
+
}
|
|
42
|
+
}
|