@theia/markers 1.45.0 → 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 +33 -33
- package/lib/browser/index.d.ts +2 -2
- package/lib/browser/index.js +29 -29
- package/lib/browser/marker-manager.d.ts +47 -47
- package/lib/browser/marker-manager.js +187 -187
- package/lib/browser/marker-tree-label-provider.d.ts +15 -15
- package/lib/browser/marker-tree-label-provider.js +84 -84
- package/lib/browser/marker-tree-label-provider.spec.d.ts +1 -1
- package/lib/browser/marker-tree-label-provider.spec.js +201 -201
- package/lib/browser/marker-tree-model.d.ts +12 -12
- package/lib/browser/marker-tree-model.js +60 -60
- package/lib/browser/marker-tree.d.ts +42 -42
- package/lib/browser/marker-tree.js +143 -143
- package/lib/browser/problem/problem-composite-tree-node.d.ts +11 -11
- package/lib/browser/problem/problem-composite-tree-node.js +76 -76
- package/lib/browser/problem/problem-composite-tree-node.spec.d.ts +1 -1
- package/lib/browser/problem/problem-composite-tree-node.spec.js +238 -238
- package/lib/browser/problem/problem-container.d.ts +8 -8
- package/lib/browser/problem/problem-container.js +46 -46
- package/lib/browser/problem/problem-contribution.d.ts +51 -51
- package/lib/browser/problem/problem-contribution.js +247 -247
- package/lib/browser/problem/problem-decorations-provider.d.ts +21 -21
- package/lib/browser/problem/problem-decorations-provider.js +95 -95
- package/lib/browser/problem/problem-decorator.d.ts +57 -57
- package/lib/browser/problem/problem-decorator.js +233 -233
- package/lib/browser/problem/problem-frontend-module.d.ts +4 -4
- package/lib/browser/problem/problem-frontend-module.js +55 -55
- package/lib/browser/problem/problem-layout-migrations.d.ts +5 -5
- package/lib/browser/problem/problem-layout-migrations.js +43 -43
- package/lib/browser/problem/problem-manager.d.ts +11 -11
- package/lib/browser/problem/problem-manager.js +53 -53
- package/lib/browser/problem/problem-manager.spec.d.ts +1 -1
- package/lib/browser/problem/problem-manager.spec.js +167 -167
- package/lib/browser/problem/problem-preferences.d.ts +13 -13
- package/lib/browser/problem/problem-preferences.js +56 -56
- package/lib/browser/problem/problem-selection.d.ts +12 -12
- package/lib/browser/problem/problem-selection.js +34 -34
- package/lib/browser/problem/problem-tabbar-decorator.d.ts +42 -42
- package/lib/browser/problem/problem-tabbar-decorator.js +160 -160
- package/lib/browser/problem/problem-tree-model.d.ts +32 -32
- package/lib/browser/problem/problem-tree-model.js +131 -131
- package/lib/browser/problem/problem-tree-model.spec.d.ts +1 -1
- package/lib/browser/problem/problem-tree-model.spec.js +172 -172
- package/lib/browser/problem/problem-utils.d.ts +44 -44
- package/lib/browser/problem/problem-utils.js +84 -84
- package/lib/browser/problem/problem-widget-tab-bar-decorator.d.ts +14 -14
- package/lib/browser/problem/problem-widget-tab-bar-decorator.js +69 -69
- package/lib/browser/problem/problem-widget.d.ts +46 -46
- package/lib/browser/problem/problem-widget.js +235 -235
- package/lib/common/marker.d.ts +16 -16
- package/lib/common/marker.js +31 -31
- package/lib/common/problem-marker.d.ts +9 -9
- package/lib/common/problem-marker.js +27 -27
- package/package.json +6 -6
- package/src/browser/index.ts +18 -18
- package/src/browser/marker-manager.ts +205 -205
- package/src/browser/marker-tree-label-provider.spec.ts +245 -245
- package/src/browser/marker-tree-label-provider.ts +75 -75
- package/src/browser/marker-tree-model.ts +47 -47
- package/src/browser/marker-tree.ts +154 -154
- package/src/browser/problem/problem-composite-tree-node.spec.ts +277 -277
- package/src/browser/problem/problem-composite-tree-node.ts +81 -81
- package/src/browser/problem/problem-container.ts +47 -47
- package/src/browser/problem/problem-contribution.ts +247 -247
- package/src/browser/problem/problem-decorations-provider.ts +72 -72
- package/src/browser/problem/problem-decorator.ts +222 -222
- package/src/browser/problem/problem-frontend-module.ts +64 -64
- package/src/browser/problem/problem-layout-migrations.ts +32 -32
- package/src/browser/problem/problem-manager.spec.ts +216 -216
- package/src/browser/problem/problem-manager.ts +51 -51
- package/src/browser/problem/problem-preferences.ts +64 -64
- package/src/browser/problem/problem-selection.ts +45 -45
- package/src/browser/problem/problem-tabbar-decorator.ts +151 -151
- package/src/browser/problem/problem-tree-model.spec.ts +189 -189
- package/src/browser/problem/problem-tree-model.ts +124 -124
- package/src/browser/problem/problem-utils.ts +90 -90
- package/src/browser/problem/problem-widget-tab-bar-decorator.ts +55 -55
- package/src/browser/problem/problem-widget.tsx +246 -246
- package/src/browser/style/index.css +92 -92
- package/src/common/marker.ts +53 -53
- package/src/common/problem-marker.ts +30 -30
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2021 EclipseSource 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 { CompositeTreeNode } from '@theia/core/lib/browser/tree/tree';
|
|
18
|
-
import { MarkerInfoNode } from '../marker-tree';
|
|
19
|
-
import URI from '@theia/core/lib/common/uri';
|
|
20
|
-
import { Marker } from '../../common/marker';
|
|
21
|
-
import { Diagnostic, DiagnosticSeverity } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
22
|
-
import { ProblemUtils } from './problem-utils';
|
|
23
|
-
|
|
24
|
-
export namespace ProblemCompositeTreeNode {
|
|
25
|
-
|
|
26
|
-
export function setSeverity(parent: MarkerInfoNode, markers: Marker<Diagnostic>[]): void {
|
|
27
|
-
let maxSeverity: DiagnosticSeverity | undefined;
|
|
28
|
-
markers.forEach(marker => {
|
|
29
|
-
if (ProblemUtils.severityCompare(marker.data.severity, maxSeverity) < 0) {
|
|
30
|
-
maxSeverity = marker.data.severity;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
parent.severity = maxSeverity;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export function addChildren(parent: CompositeTreeNode, insertChildren: { node: MarkerInfoNode, markers: Marker<Diagnostic>[] }[]): void {
|
|
37
|
-
for (const { node, markers } of insertChildren) {
|
|
38
|
-
ProblemCompositeTreeNode.setSeverity(node, markers);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const sortedInsertChildren = insertChildren.sort(
|
|
42
|
-
(a, b) => (ProblemUtils.severityCompare(a.node.severity, b.node.severity) || compareURI(a.node.uri, b.node.uri))
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
let startIndex = 0;
|
|
46
|
-
const children = parent.children as MarkerInfoNode[];
|
|
47
|
-
for (const { node } of sortedInsertChildren) {
|
|
48
|
-
const index = children.findIndex(value => value.id === node.id);
|
|
49
|
-
if (index !== -1) {
|
|
50
|
-
CompositeTreeNode.removeChild(parent, node);
|
|
51
|
-
}
|
|
52
|
-
if (children.length === 0) {
|
|
53
|
-
children.push(node);
|
|
54
|
-
startIndex = 1;
|
|
55
|
-
CompositeTreeNode.setParent(node, 0, parent);
|
|
56
|
-
} else {
|
|
57
|
-
let inserted = false;
|
|
58
|
-
for (let i = startIndex; i < children.length; i++) {
|
|
59
|
-
// sort by severity, equal severity => sort by URI
|
|
60
|
-
if (ProblemUtils.severityCompare(node.severity, children[i].severity) < 0
|
|
61
|
-
|| (ProblemUtils.severityCompare(node.severity, children[i].severity) === 0 && compareURI(node.uri, children[i].uri) < 0)) {
|
|
62
|
-
children.splice(i, 0, node);
|
|
63
|
-
inserted = true;
|
|
64
|
-
startIndex = i + 1;
|
|
65
|
-
CompositeTreeNode.setParent(node, i, parent);
|
|
66
|
-
break;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
if (inserted === false) {
|
|
70
|
-
children.push(node);
|
|
71
|
-
startIndex = children.length;
|
|
72
|
-
CompositeTreeNode.setParent(node, children.length - 1, parent);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const compareURI = (uri1: URI, uri2: URI): number =>
|
|
79
|
-
uri1.toString().localeCompare(uri2.toString(), undefined, { sensitivity: 'base' });
|
|
80
|
-
;
|
|
81
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2021 EclipseSource 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 { CompositeTreeNode } from '@theia/core/lib/browser/tree/tree';
|
|
18
|
+
import { MarkerInfoNode } from '../marker-tree';
|
|
19
|
+
import URI from '@theia/core/lib/common/uri';
|
|
20
|
+
import { Marker } from '../../common/marker';
|
|
21
|
+
import { Diagnostic, DiagnosticSeverity } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
22
|
+
import { ProblemUtils } from './problem-utils';
|
|
23
|
+
|
|
24
|
+
export namespace ProblemCompositeTreeNode {
|
|
25
|
+
|
|
26
|
+
export function setSeverity(parent: MarkerInfoNode, markers: Marker<Diagnostic>[]): void {
|
|
27
|
+
let maxSeverity: DiagnosticSeverity | undefined;
|
|
28
|
+
markers.forEach(marker => {
|
|
29
|
+
if (ProblemUtils.severityCompare(marker.data.severity, maxSeverity) < 0) {
|
|
30
|
+
maxSeverity = marker.data.severity;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
parent.severity = maxSeverity;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export function addChildren(parent: CompositeTreeNode, insertChildren: { node: MarkerInfoNode, markers: Marker<Diagnostic>[] }[]): void {
|
|
37
|
+
for (const { node, markers } of insertChildren) {
|
|
38
|
+
ProblemCompositeTreeNode.setSeverity(node, markers);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const sortedInsertChildren = insertChildren.sort(
|
|
42
|
+
(a, b) => (ProblemUtils.severityCompare(a.node.severity, b.node.severity) || compareURI(a.node.uri, b.node.uri))
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
let startIndex = 0;
|
|
46
|
+
const children = parent.children as MarkerInfoNode[];
|
|
47
|
+
for (const { node } of sortedInsertChildren) {
|
|
48
|
+
const index = children.findIndex(value => value.id === node.id);
|
|
49
|
+
if (index !== -1) {
|
|
50
|
+
CompositeTreeNode.removeChild(parent, node);
|
|
51
|
+
}
|
|
52
|
+
if (children.length === 0) {
|
|
53
|
+
children.push(node);
|
|
54
|
+
startIndex = 1;
|
|
55
|
+
CompositeTreeNode.setParent(node, 0, parent);
|
|
56
|
+
} else {
|
|
57
|
+
let inserted = false;
|
|
58
|
+
for (let i = startIndex; i < children.length; i++) {
|
|
59
|
+
// sort by severity, equal severity => sort by URI
|
|
60
|
+
if (ProblemUtils.severityCompare(node.severity, children[i].severity) < 0
|
|
61
|
+
|| (ProblemUtils.severityCompare(node.severity, children[i].severity) === 0 && compareURI(node.uri, children[i].uri) < 0)) {
|
|
62
|
+
children.splice(i, 0, node);
|
|
63
|
+
inserted = true;
|
|
64
|
+
startIndex = i + 1;
|
|
65
|
+
CompositeTreeNode.setParent(node, i, parent);
|
|
66
|
+
break;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (inserted === false) {
|
|
70
|
+
children.push(node);
|
|
71
|
+
startIndex = children.length;
|
|
72
|
+
CompositeTreeNode.setParent(node, children.length - 1, parent);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const compareURI = (uri1: URI, uri2: URI): number =>
|
|
79
|
+
uri1.toString().localeCompare(uri2.toString(), undefined, { sensitivity: 'base' });
|
|
80
|
+
;
|
|
81
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 TypeFox 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 { MarkerOptions } from '../marker-tree';
|
|
19
|
-
import { ProblemWidget } from './problem-widget';
|
|
20
|
-
import { ProblemTreeModel, ProblemTree } from './problem-tree-model';
|
|
21
|
-
import { TreeProps, defaultTreeProps, createTreeContainer } from '@theia/core/lib/browser';
|
|
22
|
-
import { PROBLEM_KIND } from '../../common/problem-marker';
|
|
23
|
-
|
|
24
|
-
export const PROBLEM_TREE_PROPS = <TreeProps>{
|
|
25
|
-
...defaultTreeProps,
|
|
26
|
-
contextMenuPath: [PROBLEM_KIND],
|
|
27
|
-
globalSelection: true
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const PROBLEM_OPTIONS = <MarkerOptions>{
|
|
31
|
-
kind: 'problem'
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export function createProblemTreeContainer(parent: interfaces.Container): Container {
|
|
35
|
-
const child = createTreeContainer(parent, {
|
|
36
|
-
tree: ProblemTree,
|
|
37
|
-
widget: ProblemWidget,
|
|
38
|
-
model: ProblemTreeModel,
|
|
39
|
-
props: PROBLEM_TREE_PROPS,
|
|
40
|
-
});
|
|
41
|
-
child.bind(MarkerOptions).toConstantValue(PROBLEM_OPTIONS);
|
|
42
|
-
return child;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function createProblemWidget(parent: interfaces.Container): ProblemWidget {
|
|
46
|
-
return createProblemTreeContainer(parent).get(ProblemWidget);
|
|
47
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 TypeFox 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 { MarkerOptions } from '../marker-tree';
|
|
19
|
+
import { ProblemWidget } from './problem-widget';
|
|
20
|
+
import { ProblemTreeModel, ProblemTree } from './problem-tree-model';
|
|
21
|
+
import { TreeProps, defaultTreeProps, createTreeContainer } from '@theia/core/lib/browser';
|
|
22
|
+
import { PROBLEM_KIND } from '../../common/problem-marker';
|
|
23
|
+
|
|
24
|
+
export const PROBLEM_TREE_PROPS = <TreeProps>{
|
|
25
|
+
...defaultTreeProps,
|
|
26
|
+
contextMenuPath: [PROBLEM_KIND],
|
|
27
|
+
globalSelection: true
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const PROBLEM_OPTIONS = <MarkerOptions>{
|
|
31
|
+
kind: 'problem'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function createProblemTreeContainer(parent: interfaces.Container): Container {
|
|
35
|
+
const child = createTreeContainer(parent, {
|
|
36
|
+
tree: ProblemTree,
|
|
37
|
+
widget: ProblemWidget,
|
|
38
|
+
model: ProblemTreeModel,
|
|
39
|
+
props: PROBLEM_TREE_PROPS,
|
|
40
|
+
});
|
|
41
|
+
child.bind(MarkerOptions).toConstantValue(PROBLEM_OPTIONS);
|
|
42
|
+
return child;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function createProblemWidget(parent: interfaces.Container): ProblemWidget {
|
|
46
|
+
return createProblemTreeContainer(parent).get(ProblemWidget);
|
|
47
|
+
}
|