@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,113 +1,113 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.BulkEditInfoNode = exports.BulkEditNode = exports.BulkEditTree = void 0;
|
|
25
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
26
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
27
|
-
const selection_1 = require("@theia/core/lib/common/selection");
|
|
28
|
-
const bulk_edit_node_selection_1 = require("./bulk-edit-node-selection");
|
|
29
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
30
|
-
const monaco_workspace_1 = require("@theia/monaco/lib/browser/monaco-workspace");
|
|
31
|
-
let BulkEditTree = class BulkEditTree extends browser_1.TreeImpl {
|
|
32
|
-
async initTree(edits, fileContents) {
|
|
33
|
-
this.root = {
|
|
34
|
-
visible: false,
|
|
35
|
-
id: 'theia-bulk-edit-tree-widget',
|
|
36
|
-
name: 'BulkEditTree',
|
|
37
|
-
children: this.getChildren(edits, fileContents),
|
|
38
|
-
parent: undefined
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
getChildren(edits, fileContentsMap) {
|
|
42
|
-
let bulkEditInfos = [];
|
|
43
|
-
if (edits) {
|
|
44
|
-
bulkEditInfos = edits
|
|
45
|
-
.map(edit => this.getResourcePath(edit))
|
|
46
|
-
.filter((path, index, arr) => path && arr.indexOf(path) === index)
|
|
47
|
-
.map((path) => this.createBulkEditInfo(path, new uri_1.default(path), fileContentsMap.get(path)))
|
|
48
|
-
.filter(Boolean);
|
|
49
|
-
if (bulkEditInfos.length > 0) {
|
|
50
|
-
bulkEditInfos.forEach(editInfo => {
|
|
51
|
-
editInfo.children = edits.filter(edit => {
|
|
52
|
-
var _a, _b, _c, _d;
|
|
53
|
-
return ((('resource' in edit) && ((_b = (_a = edit) === null || _a === void 0 ? void 0 : _a.resource) === null || _b === void 0 ? void 0 : _b.path) === editInfo.id)) ||
|
|
54
|
-
(('newResource' in edit) && ((_d = (_c = edit) === null || _c === void 0 ? void 0 : _c.newResource) === null || _d === void 0 ? void 0 : _d.path) === editInfo.id);
|
|
55
|
-
})
|
|
56
|
-
.map((edit, index) => this.createBulkEditNode(('resource' in edit ? edit :
|
|
57
|
-
edit), index, editInfo));
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return bulkEditInfos;
|
|
62
|
-
}
|
|
63
|
-
createBulkEditNode(bulkEdit, index, parent) {
|
|
64
|
-
const id = parent.id + '_' + index;
|
|
65
|
-
const existing = this.getNode(id);
|
|
66
|
-
if (BulkEditNode.is(existing)) {
|
|
67
|
-
existing.bulkEdit = bulkEdit;
|
|
68
|
-
return existing;
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
id,
|
|
72
|
-
name: 'bulkEdit',
|
|
73
|
-
parent,
|
|
74
|
-
selected: false,
|
|
75
|
-
uri: parent.uri,
|
|
76
|
-
bulkEdit
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
createBulkEditInfo(id, uri, fileContents) {
|
|
80
|
-
return {
|
|
81
|
-
id,
|
|
82
|
-
uri,
|
|
83
|
-
expanded: true,
|
|
84
|
-
selected: false,
|
|
85
|
-
parent: this.root,
|
|
86
|
-
fileContents,
|
|
87
|
-
children: []
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
getResourcePath(edit) {
|
|
91
|
-
return monaco_workspace_1.ResourceTextEdit.is(edit) ? edit.resource.path :
|
|
92
|
-
monaco_workspace_1.ResourceFileEdit.is(edit) && edit.newResource ? edit.newResource.path : undefined;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
BulkEditTree = __decorate([
|
|
96
|
-
(0, inversify_1.injectable)()
|
|
97
|
-
], BulkEditTree);
|
|
98
|
-
exports.BulkEditTree = BulkEditTree;
|
|
99
|
-
var BulkEditNode;
|
|
100
|
-
(function (BulkEditNode) {
|
|
101
|
-
function is(node) {
|
|
102
|
-
return selection_1.UriSelection.is(node) && browser_1.SelectableTreeNode.is(node) && bulk_edit_node_selection_1.BulkEditNodeSelection.is(node);
|
|
103
|
-
}
|
|
104
|
-
BulkEditNode.is = is;
|
|
105
|
-
})(BulkEditNode = exports.BulkEditNode || (exports.BulkEditNode = {}));
|
|
106
|
-
var BulkEditInfoNode;
|
|
107
|
-
(function (BulkEditInfoNode) {
|
|
108
|
-
function is(node) {
|
|
109
|
-
return browser_1.ExpandableTreeNode.is(node) && selection_1.UriSelection.is(node) && 'fileContents' in node;
|
|
110
|
-
}
|
|
111
|
-
BulkEditInfoNode.is = is;
|
|
112
|
-
})(BulkEditInfoNode = exports.BulkEditInfoNode || (exports.BulkEditInfoNode = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.BulkEditInfoNode = exports.BulkEditNode = exports.BulkEditTree = void 0;
|
|
25
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
26
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
27
|
+
const selection_1 = require("@theia/core/lib/common/selection");
|
|
28
|
+
const bulk_edit_node_selection_1 = require("./bulk-edit-node-selection");
|
|
29
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
30
|
+
const monaco_workspace_1 = require("@theia/monaco/lib/browser/monaco-workspace");
|
|
31
|
+
let BulkEditTree = class BulkEditTree extends browser_1.TreeImpl {
|
|
32
|
+
async initTree(edits, fileContents) {
|
|
33
|
+
this.root = {
|
|
34
|
+
visible: false,
|
|
35
|
+
id: 'theia-bulk-edit-tree-widget',
|
|
36
|
+
name: 'BulkEditTree',
|
|
37
|
+
children: this.getChildren(edits, fileContents),
|
|
38
|
+
parent: undefined
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
getChildren(edits, fileContentsMap) {
|
|
42
|
+
let bulkEditInfos = [];
|
|
43
|
+
if (edits) {
|
|
44
|
+
bulkEditInfos = edits
|
|
45
|
+
.map(edit => this.getResourcePath(edit))
|
|
46
|
+
.filter((path, index, arr) => path && arr.indexOf(path) === index)
|
|
47
|
+
.map((path) => this.createBulkEditInfo(path, new uri_1.default(path), fileContentsMap.get(path)))
|
|
48
|
+
.filter(Boolean);
|
|
49
|
+
if (bulkEditInfos.length > 0) {
|
|
50
|
+
bulkEditInfos.forEach(editInfo => {
|
|
51
|
+
editInfo.children = edits.filter(edit => {
|
|
52
|
+
var _a, _b, _c, _d;
|
|
53
|
+
return ((('resource' in edit) && ((_b = (_a = edit) === null || _a === void 0 ? void 0 : _a.resource) === null || _b === void 0 ? void 0 : _b.path) === editInfo.id)) ||
|
|
54
|
+
(('newResource' in edit) && ((_d = (_c = edit) === null || _c === void 0 ? void 0 : _c.newResource) === null || _d === void 0 ? void 0 : _d.path) === editInfo.id);
|
|
55
|
+
})
|
|
56
|
+
.map((edit, index) => this.createBulkEditNode(('resource' in edit ? edit :
|
|
57
|
+
edit), index, editInfo));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return bulkEditInfos;
|
|
62
|
+
}
|
|
63
|
+
createBulkEditNode(bulkEdit, index, parent) {
|
|
64
|
+
const id = parent.id + '_' + index;
|
|
65
|
+
const existing = this.getNode(id);
|
|
66
|
+
if (BulkEditNode.is(existing)) {
|
|
67
|
+
existing.bulkEdit = bulkEdit;
|
|
68
|
+
return existing;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
id,
|
|
72
|
+
name: 'bulkEdit',
|
|
73
|
+
parent,
|
|
74
|
+
selected: false,
|
|
75
|
+
uri: parent.uri,
|
|
76
|
+
bulkEdit
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
createBulkEditInfo(id, uri, fileContents) {
|
|
80
|
+
return {
|
|
81
|
+
id,
|
|
82
|
+
uri,
|
|
83
|
+
expanded: true,
|
|
84
|
+
selected: false,
|
|
85
|
+
parent: this.root,
|
|
86
|
+
fileContents,
|
|
87
|
+
children: []
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
getResourcePath(edit) {
|
|
91
|
+
return monaco_workspace_1.ResourceTextEdit.is(edit) ? edit.resource.path :
|
|
92
|
+
monaco_workspace_1.ResourceFileEdit.is(edit) && edit.newResource ? edit.newResource.path : undefined;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
BulkEditTree = __decorate([
|
|
96
|
+
(0, inversify_1.injectable)()
|
|
97
|
+
], BulkEditTree);
|
|
98
|
+
exports.BulkEditTree = BulkEditTree;
|
|
99
|
+
var BulkEditNode;
|
|
100
|
+
(function (BulkEditNode) {
|
|
101
|
+
function is(node) {
|
|
102
|
+
return selection_1.UriSelection.is(node) && browser_1.SelectableTreeNode.is(node) && bulk_edit_node_selection_1.BulkEditNodeSelection.is(node);
|
|
103
|
+
}
|
|
104
|
+
BulkEditNode.is = is;
|
|
105
|
+
})(BulkEditNode = exports.BulkEditNode || (exports.BulkEditNode = {}));
|
|
106
|
+
var BulkEditInfoNode;
|
|
107
|
+
(function (BulkEditInfoNode) {
|
|
108
|
+
function is(node) {
|
|
109
|
+
return browser_1.ExpandableTreeNode.is(node) && selection_1.UriSelection.is(node) && 'fileContents' in node;
|
|
110
|
+
}
|
|
111
|
+
BulkEditInfoNode.is = is;
|
|
112
|
+
})(BulkEditInfoNode = exports.BulkEditInfoNode || (exports.BulkEditInfoNode = {}));
|
|
113
113
|
//# sourceMappingURL=bulk-edit-tree.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=bulk-edit-tree.spec.d.ts.map
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
|
|
19
|
-
const chai = require("chai");
|
|
20
|
-
const vscode_uri_1 = require("vscode-uri");
|
|
21
|
-
let disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
22
|
-
const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
|
|
23
|
-
frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
|
|
24
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
-
const bulk_edit_tree_1 = require("./bulk-edit-tree");
|
|
26
|
-
const expect = chai.expect;
|
|
27
|
-
let bulkEditTree;
|
|
28
|
-
let testContainer;
|
|
29
|
-
const fileContextsMap = new Map();
|
|
30
|
-
let resourceTextEdits;
|
|
31
|
-
disableJSDOM();
|
|
32
|
-
before(() => {
|
|
33
|
-
disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
34
|
-
testContainer = new inversify_1.Container();
|
|
35
|
-
testContainer.bind(bulk_edit_tree_1.BulkEditTree).toSelf();
|
|
36
|
-
bulkEditTree = testContainer.get(bulk_edit_tree_1.BulkEditTree);
|
|
37
|
-
fileContextsMap.set('/c:/test1.ts', 'aaaaaaaaaaaaaaaaaaa');
|
|
38
|
-
fileContextsMap.set('/c:/test2.ts', 'bbbbbbbbbbbbbbbbbbb');
|
|
39
|
-
resourceTextEdits = [
|
|
40
|
-
{
|
|
41
|
-
'resource': vscode_uri_1.URI.file('c:/test1.ts'),
|
|
42
|
-
'textEdit': {
|
|
43
|
-
'text': 'AAAAA', 'range': { 'startLineNumber': 1, 'startColumn': 5, 'endLineNumber': 1, 'endColumn': 10 }
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
'resource': vscode_uri_1.URI.file('c:/test2.ts'),
|
|
48
|
-
'textEdit': {
|
|
49
|
-
'text': 'BBBBBB', 'range': { 'startLineNumber': 1, 'startColumn': 3, 'endLineNumber': 1, 'endColumn': 8 }
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
];
|
|
53
|
-
});
|
|
54
|
-
after(() => {
|
|
55
|
-
disableJSDOM();
|
|
56
|
-
});
|
|
57
|
-
describe('bulk-edit-tree', () => {
|
|
58
|
-
it('initialize tree', () => {
|
|
59
|
-
bulkEditTree.initTree(resourceTextEdits, fileContextsMap);
|
|
60
|
-
expect(bulkEditTree.root.children.length).is.equal(2);
|
|
61
|
-
});
|
|
62
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
|
|
19
|
+
const chai = require("chai");
|
|
20
|
+
const vscode_uri_1 = require("@theia/core/shared/vscode-uri");
|
|
21
|
+
let disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
22
|
+
const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
|
|
23
|
+
frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
|
|
24
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
+
const bulk_edit_tree_1 = require("./bulk-edit-tree");
|
|
26
|
+
const expect = chai.expect;
|
|
27
|
+
let bulkEditTree;
|
|
28
|
+
let testContainer;
|
|
29
|
+
const fileContextsMap = new Map();
|
|
30
|
+
let resourceTextEdits;
|
|
31
|
+
disableJSDOM();
|
|
32
|
+
before(() => {
|
|
33
|
+
disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
34
|
+
testContainer = new inversify_1.Container();
|
|
35
|
+
testContainer.bind(bulk_edit_tree_1.BulkEditTree).toSelf();
|
|
36
|
+
bulkEditTree = testContainer.get(bulk_edit_tree_1.BulkEditTree);
|
|
37
|
+
fileContextsMap.set('/c:/test1.ts', 'aaaaaaaaaaaaaaaaaaa');
|
|
38
|
+
fileContextsMap.set('/c:/test2.ts', 'bbbbbbbbbbbbbbbbbbb');
|
|
39
|
+
resourceTextEdits = [
|
|
40
|
+
{
|
|
41
|
+
'resource': vscode_uri_1.URI.file('c:/test1.ts'),
|
|
42
|
+
'textEdit': {
|
|
43
|
+
'text': 'AAAAA', 'range': { 'startLineNumber': 1, 'startColumn': 5, 'endLineNumber': 1, 'endColumn': 10 }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
'resource': vscode_uri_1.URI.file('c:/test2.ts'),
|
|
48
|
+
'textEdit': {
|
|
49
|
+
'text': 'BBBBBB', 'range': { 'startLineNumber': 1, 'startColumn': 3, 'endLineNumber': 1, 'endColumn': 8 }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
});
|
|
54
|
+
after(() => {
|
|
55
|
+
disableJSDOM();
|
|
56
|
+
});
|
|
57
|
+
describe('bulk-edit-tree', () => {
|
|
58
|
+
it('initialize tree', () => {
|
|
59
|
+
bulkEditTree.initTree(resourceTextEdits, fileContextsMap);
|
|
60
|
+
expect(bulkEditTree.root.children.length).is.equal(2);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
63
|
//# sourceMappingURL=bulk-edit-tree.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-edit-tree.spec.js","sourceRoot":"","sources":["../../../src/browser/bulk-edit-tree/bulk-edit-tree.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oEAAoE;AACpE,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,8DAAiE;AACjE,6BAA6B;AAE7B,
|
|
1
|
+
{"version":3,"file":"bulk-edit-tree.spec.js","sourceRoot":"","sources":["../../../src/browser/bulk-edit-tree/bulk-edit-tree.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oEAAoE;AACpE,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,8DAAiE;AACjE,6BAA6B;AAE7B,8DAA2D;AAE3D,IAAI,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;AAEjC,uHAAiH;AACjH,wEAAiC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAE1C,4DAAyD;AACzD,qDAAkE;AAElE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,IAAI,YAA0B,CAAC;AAC/B,IAAI,aAAwB,CAAC;AAC7B,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAClD,IAAI,iBAAqC,CAAC;AAE1C,YAAY,EAAE,CAAC;AAEf,MAAM,CAAC,GAAG,EAAE;IACR,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;IAE7B,aAAa,GAAG,IAAI,qBAAS,EAAE,CAAC;IAChC,aAAa,CAAC,IAAI,CAAC,6BAAY,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1C,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,6BAAY,CAAC,CAAC;IAE/C,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC;IAC3D,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC;IAE3D,iBAAiB,GAAgC;QAC7C;YACI,UAAU,EAAE,gBAAG,CAAC,IAAI,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE;gBACR,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,iBAAiB,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;aAC5G;SACJ;QACD;YACI,UAAU,EAAE,gBAAG,CAAC,IAAI,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE;gBACR,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,iBAAiB,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE;aAC5G;SACJ;KACJ,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,KAAK,CAAC,GAAG,EAAE;IACP,YAAY,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACvB,YAAY,CAAC,QAAQ,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;QAC1D,MAAM,CAAE,YAAY,CAAC,IAAyB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './bulk-edit-tree';
|
|
2
|
-
export * from './bulk-edit-tree-model';
|
|
3
|
-
export * from './bulk-edit-node-selection';
|
|
4
|
-
export * from './bulk-edit-tree-widget';
|
|
5
|
-
export * from './bulk-edit-tree-container';
|
|
1
|
+
export * from './bulk-edit-tree';
|
|
2
|
+
export * from './bulk-edit-tree-model';
|
|
3
|
+
export * from './bulk-edit-node-selection';
|
|
4
|
+
export * from './bulk-edit-tree-widget';
|
|
5
|
+
export * from './bulk-edit-tree-container';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
__exportStar(require("./bulk-edit-tree"), exports);
|
|
29
|
-
__exportStar(require("./bulk-edit-tree-model"), exports);
|
|
30
|
-
__exportStar(require("./bulk-edit-node-selection"), exports);
|
|
31
|
-
__exportStar(require("./bulk-edit-tree-widget"), exports);
|
|
32
|
-
__exportStar(require("./bulk-edit-tree-container"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
__exportStar(require("./bulk-edit-tree"), exports);
|
|
29
|
+
__exportStar(require("./bulk-edit-tree-model"), exports);
|
|
30
|
+
__exportStar(require("./bulk-edit-node-selection"), exports);
|
|
31
|
+
__exportStar(require("./bulk-edit-tree-widget"), exports);
|
|
32
|
+
__exportStar(require("./bulk-edit-tree-container"), exports);
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { LabelProvider, LabelProviderContribution, DidChangeLabelEvent } from '@theia/core/lib/browser/label-provider';
|
|
2
|
-
import { BulkEditInfoNode } from './bulk-edit-tree';
|
|
3
|
-
import { TreeLabelProvider } from '@theia/core/lib/browser/tree/tree-label-provider';
|
|
4
|
-
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
5
|
-
export declare class BulkEditTreeLabelProvider implements LabelProviderContribution {
|
|
6
|
-
protected readonly labelProvider: LabelProvider;
|
|
7
|
-
protected readonly treeLabelProvider: TreeLabelProvider;
|
|
8
|
-
protected readonly workspaceService: WorkspaceService;
|
|
9
|
-
canHandle(element: object): number;
|
|
10
|
-
getIcon(node: BulkEditInfoNode): string;
|
|
11
|
-
getName(node: BulkEditInfoNode): string;
|
|
12
|
-
getLongName(node: BulkEditInfoNode): string;
|
|
13
|
-
getDescription(node: BulkEditInfoNode): string;
|
|
14
|
-
affects(node: BulkEditInfoNode, event: DidChangeLabelEvent): boolean;
|
|
15
|
-
}
|
|
1
|
+
import { LabelProvider, LabelProviderContribution, DidChangeLabelEvent } from '@theia/core/lib/browser/label-provider';
|
|
2
|
+
import { BulkEditInfoNode } from './bulk-edit-tree';
|
|
3
|
+
import { TreeLabelProvider } from '@theia/core/lib/browser/tree/tree-label-provider';
|
|
4
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
5
|
+
export declare class BulkEditTreeLabelProvider implements LabelProviderContribution {
|
|
6
|
+
protected readonly labelProvider: LabelProvider;
|
|
7
|
+
protected readonly treeLabelProvider: TreeLabelProvider;
|
|
8
|
+
protected readonly workspaceService: WorkspaceService;
|
|
9
|
+
canHandle(element: object): number;
|
|
10
|
+
getIcon(node: BulkEditInfoNode): string;
|
|
11
|
+
getName(node: BulkEditInfoNode): string;
|
|
12
|
+
getLongName(node: BulkEditInfoNode): string;
|
|
13
|
+
getDescription(node: BulkEditInfoNode): string;
|
|
14
|
+
affects(node: BulkEditInfoNode, event: DidChangeLabelEvent): boolean;
|
|
15
|
+
}
|
|
16
16
|
//# sourceMappingURL=bulk-edit-tree-label-provider.d.ts.map
|