@theia/outline-view 1.48.1 → 1.48.3

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 (29) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/index.d.ts +2 -2
  3. package/lib/browser/index.js +20 -20
  4. package/lib/browser/outline-breadcrumbs-contribution.d.ts +57 -57
  5. package/lib/browser/outline-breadcrumbs-contribution.js +214 -214
  6. package/lib/browser/outline-decorator-service.d.ts +13 -13
  7. package/lib/browser/outline-decorator-service.js +42 -42
  8. package/lib/browser/outline-view-contribution.d.ts +36 -36
  9. package/lib/browser/outline-view-contribution.js +125 -125
  10. package/lib/browser/outline-view-frontend-module.d.ts +4 -4
  11. package/lib/browser/outline-view-frontend-module.js +68 -68
  12. package/lib/browser/outline-view-service.d.ts +26 -26
  13. package/lib/browser/outline-view-service.js +78 -78
  14. package/lib/browser/outline-view-tree-model.d.ts +19 -19
  15. package/lib/browser/outline-view-tree-model.js +76 -76
  16. package/lib/browser/outline-view-widget.d.ts +76 -76
  17. package/lib/browser/outline-view-widget.js +184 -184
  18. package/lib/package.spec.js +25 -25
  19. package/package.json +4 -4
  20. package/src/browser/index.ts +18 -18
  21. package/src/browser/outline-breadcrumbs-contribution.tsx +229 -229
  22. package/src/browser/outline-decorator-service.ts +36 -36
  23. package/src/browser/outline-view-contribution.ts +132 -132
  24. package/src/browser/outline-view-frontend-module.ts +84 -84
  25. package/src/browser/outline-view-service.ts +82 -82
  26. package/src/browser/outline-view-tree-model.ts +77 -77
  27. package/src/browser/outline-view-widget.tsx +212 -212
  28. package/src/browser/styles/index.css +24 -24
  29. package/src/package.spec.ts +28 -28
@@ -1,229 +1,229 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 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 { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
18
- import { LabelProvider, BreadcrumbsService, Widget, TreeNode, OpenerService, open, SelectableTreeNode, BreadcrumbsContribution, Breadcrumb } from '@theia/core/lib/browser';
19
- import URI from '@theia/core/lib/common/uri';
20
- import { OutlineViewService } from './outline-view-service';
21
- import { OutlineSymbolInformationNode, OutlineViewWidget } from './outline-view-widget';
22
- import { Disposable, DisposableCollection, Emitter, Event, UriSelection } from '@theia/core/lib/common';
23
-
24
- export const OutlineBreadcrumbType = Symbol('OutlineBreadcrumb');
25
- export const BreadcrumbPopupOutlineViewFactory = Symbol('BreadcrumbPopupOutlineViewFactory');
26
- export const OUTLINE_BREADCRUMB_CONTAINER_CLASS = 'outline-element';
27
- export interface BreadcrumbPopupOutlineViewFactory {
28
- (): BreadcrumbPopupOutlineView;
29
- }
30
- export class BreadcrumbPopupOutlineView extends OutlineViewWidget {
31
- @inject(OpenerService) protected readonly openerService: OpenerService;
32
-
33
- protected override tapNode(node?: TreeNode): void {
34
- if (UriSelection.is(node) && OutlineSymbolInformationNode.hasRange(node)) {
35
- open(this.openerService, node.uri, { selection: node.range });
36
- } else {
37
- super.tapNode(node);
38
- }
39
- }
40
-
41
- cloneState(roots: OutlineSymbolInformationNode[]): void {
42
- const nodes = this.reconcileTreeState(roots);
43
- const root = this.getRoot(nodes);
44
- this.model.root = this.inflateFromStorage(this.deflateForStorage(root));
45
- }
46
- }
47
-
48
- @injectable()
49
- export class OutlineBreadcrumbsContribution implements BreadcrumbsContribution {
50
- @inject(LabelProvider)
51
- protected readonly labelProvider: LabelProvider;
52
-
53
- @inject(OutlineViewService)
54
- protected readonly outlineViewService: OutlineViewService;
55
-
56
- @inject(BreadcrumbsService)
57
- protected readonly breadcrumbsService: BreadcrumbsService;
58
-
59
- @inject(BreadcrumbPopupOutlineViewFactory)
60
- protected readonly outlineFactory: BreadcrumbPopupOutlineViewFactory;
61
-
62
- protected outlineView: BreadcrumbPopupOutlineView;
63
-
64
- readonly type = OutlineBreadcrumbType;
65
- readonly priority: number = 200;
66
-
67
- protected currentUri: URI | undefined = undefined;
68
- protected currentBreadcrumbs: OutlineBreadcrumb[] = [];
69
- protected roots: OutlineSymbolInformationNode[] = [];
70
-
71
- protected readonly onDidChangeBreadcrumbsEmitter = new Emitter<URI>();
72
- get onDidChangeBreadcrumbs(): Event<URI> {
73
- return this.onDidChangeBreadcrumbsEmitter.event;
74
- }
75
-
76
- @postConstruct()
77
- init(): void {
78
- this.outlineView = this.outlineFactory();
79
- this.outlineView.node.style.height = 'auto';
80
- this.outlineView.node.style.maxHeight = '200px';
81
- this.outlineViewService.onDidChangeOutline(roots => {
82
- if (roots.length > 0) {
83
- this.roots = roots;
84
- const first = roots[0];
85
- if (UriSelection.is(first)) {
86
- this.updateOutlineItems(first.uri, this.findSelectedNode(roots));
87
- }
88
- } else {
89
- this.currentBreadcrumbs = [];
90
- this.roots = [];
91
- }
92
- });
93
- this.outlineViewService.onDidSelect(node => {
94
- if (UriSelection.is(node)) {
95
- this.updateOutlineItems(node.uri, node);
96
- }
97
- });
98
- }
99
-
100
- protected async updateOutlineItems(uri: URI, selectedNode: OutlineSymbolInformationNode | undefined): Promise<void> {
101
- this.currentUri = uri;
102
- const outlinePath = this.toOutlinePath(selectedNode);
103
- if (outlinePath && selectedNode) {
104
- this.currentBreadcrumbs = outlinePath.map((node, index) =>
105
- new OutlineBreadcrumb(
106
- node,
107
- uri,
108
- index.toString(),
109
- this.labelProvider.getName(node),
110
- 'symbol-icon-center codicon codicon-symbol-' + node.iconClass,
111
- OUTLINE_BREADCRUMB_CONTAINER_CLASS,
112
- )
113
- );
114
- if (selectedNode.children && selectedNode.children.length > 0) {
115
- this.currentBreadcrumbs.push(new OutlineBreadcrumb(
116
- selectedNode.children as OutlineSymbolInformationNode[],
117
- uri,
118
- this.currentBreadcrumbs.length.toString(),
119
- '…',
120
- '',
121
- OUTLINE_BREADCRUMB_CONTAINER_CLASS,
122
- ));
123
- }
124
- } else {
125
- this.currentBreadcrumbs = [];
126
- if (this.roots) {
127
- this.currentBreadcrumbs.push(new OutlineBreadcrumb(
128
- this.roots,
129
- uri,
130
- this.currentBreadcrumbs.length.toString(),
131
- '…',
132
- '',
133
- OUTLINE_BREADCRUMB_CONTAINER_CLASS
134
- ));
135
- }
136
- }
137
- this.onDidChangeBreadcrumbsEmitter.fire(uri);
138
- }
139
-
140
- async computeBreadcrumbs(uri: URI): Promise<Breadcrumb[]> {
141
- if (this.currentUri && uri.toString() === this.currentUri.toString()) {
142
- return this.currentBreadcrumbs;
143
- }
144
- return [];
145
- }
146
-
147
- async attachPopupContent(breadcrumb: Breadcrumb, parent: HTMLElement): Promise<Disposable | undefined> {
148
- if (!OutlineBreadcrumb.is(breadcrumb)) {
149
- return undefined;
150
- }
151
- const node = Array.isArray(breadcrumb.node) ? breadcrumb.node[0] : breadcrumb.node;
152
- if (!node.parent) {
153
- return undefined;
154
- }
155
- const siblings = node.parent.children.filter((child): child is OutlineSymbolInformationNode => OutlineSymbolInformationNode.is(child));
156
-
157
- const toDisposeOnHide = new DisposableCollection();
158
- this.outlineView.cloneState(siblings);
159
- this.outlineView.model.selectNode(node);
160
- this.outlineView.model.collapseAll();
161
- Widget.attach(this.outlineView, parent);
162
- this.outlineView.activate();
163
- toDisposeOnHide.pushAll([
164
- this.outlineView.model.onExpansionChanged(expandedNode => SelectableTreeNode.is(expandedNode) && this.outlineView.model.selectNode(expandedNode)),
165
- Disposable.create(() => {
166
- this.outlineView.model.root = undefined;
167
- Widget.detach(this.outlineView);
168
- }),
169
- ]);
170
- return toDisposeOnHide;
171
- }
172
-
173
- /**
174
- * Returns the path of the given outline node.
175
- */
176
- protected toOutlinePath(node: OutlineSymbolInformationNode | undefined, path: OutlineSymbolInformationNode[] = []): OutlineSymbolInformationNode[] | undefined {
177
- if (!node) { return undefined; }
178
- if (node.id === 'outline-view-root') { return path; }
179
- if (node.parent) {
180
- return this.toOutlinePath(node.parent as OutlineSymbolInformationNode, [node, ...path]);
181
- } else {
182
- return [node, ...path];
183
- }
184
- }
185
-
186
- /**
187
- * Find the node that is selected. Returns after the first match.
188
- */
189
- protected findSelectedNode(roots: OutlineSymbolInformationNode[]): OutlineSymbolInformationNode | undefined {
190
- const result = roots.find(node => node.selected);
191
- if (result) {
192
- return result;
193
- }
194
- for (const node of roots) {
195
- const result2 = this.findSelectedNode(node.children.map(child => child as OutlineSymbolInformationNode));
196
- if (result2) {
197
- return result2;
198
- }
199
- }
200
- }
201
- }
202
-
203
- export class OutlineBreadcrumb implements Breadcrumb {
204
- constructor(
205
- readonly node: OutlineSymbolInformationNode | OutlineSymbolInformationNode[],
206
- readonly uri: URI,
207
- readonly index: string,
208
- readonly label: string,
209
- readonly iconClass: string,
210
- readonly containerClass: string,
211
- ) { }
212
-
213
- get id(): string {
214
- return this.type.toString() + '_' + this.uri.toString() + '_' + this.index;
215
- }
216
-
217
- get type(): symbol {
218
- return OutlineBreadcrumbType;
219
- }
220
-
221
- get longLabel(): string {
222
- return this.label;
223
- }
224
- }
225
- export namespace OutlineBreadcrumb {
226
- export function is(breadcrumb: Breadcrumb): breadcrumb is OutlineBreadcrumb {
227
- return 'node' in breadcrumb && 'uri' in breadcrumb;
228
- }
229
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 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 { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
18
+ import { LabelProvider, BreadcrumbsService, Widget, TreeNode, OpenerService, open, SelectableTreeNode, BreadcrumbsContribution, Breadcrumb } from '@theia/core/lib/browser';
19
+ import URI from '@theia/core/lib/common/uri';
20
+ import { OutlineViewService } from './outline-view-service';
21
+ import { OutlineSymbolInformationNode, OutlineViewWidget } from './outline-view-widget';
22
+ import { Disposable, DisposableCollection, Emitter, Event, UriSelection } from '@theia/core/lib/common';
23
+
24
+ export const OutlineBreadcrumbType = Symbol('OutlineBreadcrumb');
25
+ export const BreadcrumbPopupOutlineViewFactory = Symbol('BreadcrumbPopupOutlineViewFactory');
26
+ export const OUTLINE_BREADCRUMB_CONTAINER_CLASS = 'outline-element';
27
+ export interface BreadcrumbPopupOutlineViewFactory {
28
+ (): BreadcrumbPopupOutlineView;
29
+ }
30
+ export class BreadcrumbPopupOutlineView extends OutlineViewWidget {
31
+ @inject(OpenerService) protected readonly openerService: OpenerService;
32
+
33
+ protected override tapNode(node?: TreeNode): void {
34
+ if (UriSelection.is(node) && OutlineSymbolInformationNode.hasRange(node)) {
35
+ open(this.openerService, node.uri, { selection: node.range });
36
+ } else {
37
+ super.tapNode(node);
38
+ }
39
+ }
40
+
41
+ cloneState(roots: OutlineSymbolInformationNode[]): void {
42
+ const nodes = this.reconcileTreeState(roots);
43
+ const root = this.getRoot(nodes);
44
+ this.model.root = this.inflateFromStorage(this.deflateForStorage(root));
45
+ }
46
+ }
47
+
48
+ @injectable()
49
+ export class OutlineBreadcrumbsContribution implements BreadcrumbsContribution {
50
+ @inject(LabelProvider)
51
+ protected readonly labelProvider: LabelProvider;
52
+
53
+ @inject(OutlineViewService)
54
+ protected readonly outlineViewService: OutlineViewService;
55
+
56
+ @inject(BreadcrumbsService)
57
+ protected readonly breadcrumbsService: BreadcrumbsService;
58
+
59
+ @inject(BreadcrumbPopupOutlineViewFactory)
60
+ protected readonly outlineFactory: BreadcrumbPopupOutlineViewFactory;
61
+
62
+ protected outlineView: BreadcrumbPopupOutlineView;
63
+
64
+ readonly type = OutlineBreadcrumbType;
65
+ readonly priority: number = 200;
66
+
67
+ protected currentUri: URI | undefined = undefined;
68
+ protected currentBreadcrumbs: OutlineBreadcrumb[] = [];
69
+ protected roots: OutlineSymbolInformationNode[] = [];
70
+
71
+ protected readonly onDidChangeBreadcrumbsEmitter = new Emitter<URI>();
72
+ get onDidChangeBreadcrumbs(): Event<URI> {
73
+ return this.onDidChangeBreadcrumbsEmitter.event;
74
+ }
75
+
76
+ @postConstruct()
77
+ init(): void {
78
+ this.outlineView = this.outlineFactory();
79
+ this.outlineView.node.style.height = 'auto';
80
+ this.outlineView.node.style.maxHeight = '200px';
81
+ this.outlineViewService.onDidChangeOutline(roots => {
82
+ if (roots.length > 0) {
83
+ this.roots = roots;
84
+ const first = roots[0];
85
+ if (UriSelection.is(first)) {
86
+ this.updateOutlineItems(first.uri, this.findSelectedNode(roots));
87
+ }
88
+ } else {
89
+ this.currentBreadcrumbs = [];
90
+ this.roots = [];
91
+ }
92
+ });
93
+ this.outlineViewService.onDidSelect(node => {
94
+ if (UriSelection.is(node)) {
95
+ this.updateOutlineItems(node.uri, node);
96
+ }
97
+ });
98
+ }
99
+
100
+ protected async updateOutlineItems(uri: URI, selectedNode: OutlineSymbolInformationNode | undefined): Promise<void> {
101
+ this.currentUri = uri;
102
+ const outlinePath = this.toOutlinePath(selectedNode);
103
+ if (outlinePath && selectedNode) {
104
+ this.currentBreadcrumbs = outlinePath.map((node, index) =>
105
+ new OutlineBreadcrumb(
106
+ node,
107
+ uri,
108
+ index.toString(),
109
+ this.labelProvider.getName(node),
110
+ 'symbol-icon-center codicon codicon-symbol-' + node.iconClass,
111
+ OUTLINE_BREADCRUMB_CONTAINER_CLASS,
112
+ )
113
+ );
114
+ if (selectedNode.children && selectedNode.children.length > 0) {
115
+ this.currentBreadcrumbs.push(new OutlineBreadcrumb(
116
+ selectedNode.children as OutlineSymbolInformationNode[],
117
+ uri,
118
+ this.currentBreadcrumbs.length.toString(),
119
+ '…',
120
+ '',
121
+ OUTLINE_BREADCRUMB_CONTAINER_CLASS,
122
+ ));
123
+ }
124
+ } else {
125
+ this.currentBreadcrumbs = [];
126
+ if (this.roots) {
127
+ this.currentBreadcrumbs.push(new OutlineBreadcrumb(
128
+ this.roots,
129
+ uri,
130
+ this.currentBreadcrumbs.length.toString(),
131
+ '…',
132
+ '',
133
+ OUTLINE_BREADCRUMB_CONTAINER_CLASS
134
+ ));
135
+ }
136
+ }
137
+ this.onDidChangeBreadcrumbsEmitter.fire(uri);
138
+ }
139
+
140
+ async computeBreadcrumbs(uri: URI): Promise<Breadcrumb[]> {
141
+ if (this.currentUri && uri.toString() === this.currentUri.toString()) {
142
+ return this.currentBreadcrumbs;
143
+ }
144
+ return [];
145
+ }
146
+
147
+ async attachPopupContent(breadcrumb: Breadcrumb, parent: HTMLElement): Promise<Disposable | undefined> {
148
+ if (!OutlineBreadcrumb.is(breadcrumb)) {
149
+ return undefined;
150
+ }
151
+ const node = Array.isArray(breadcrumb.node) ? breadcrumb.node[0] : breadcrumb.node;
152
+ if (!node.parent) {
153
+ return undefined;
154
+ }
155
+ const siblings = node.parent.children.filter((child): child is OutlineSymbolInformationNode => OutlineSymbolInformationNode.is(child));
156
+
157
+ const toDisposeOnHide = new DisposableCollection();
158
+ this.outlineView.cloneState(siblings);
159
+ this.outlineView.model.selectNode(node);
160
+ this.outlineView.model.collapseAll();
161
+ Widget.attach(this.outlineView, parent);
162
+ this.outlineView.activate();
163
+ toDisposeOnHide.pushAll([
164
+ this.outlineView.model.onExpansionChanged(expandedNode => SelectableTreeNode.is(expandedNode) && this.outlineView.model.selectNode(expandedNode)),
165
+ Disposable.create(() => {
166
+ this.outlineView.model.root = undefined;
167
+ Widget.detach(this.outlineView);
168
+ }),
169
+ ]);
170
+ return toDisposeOnHide;
171
+ }
172
+
173
+ /**
174
+ * Returns the path of the given outline node.
175
+ */
176
+ protected toOutlinePath(node: OutlineSymbolInformationNode | undefined, path: OutlineSymbolInformationNode[] = []): OutlineSymbolInformationNode[] | undefined {
177
+ if (!node) { return undefined; }
178
+ if (node.id === 'outline-view-root') { return path; }
179
+ if (node.parent) {
180
+ return this.toOutlinePath(node.parent as OutlineSymbolInformationNode, [node, ...path]);
181
+ } else {
182
+ return [node, ...path];
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Find the node that is selected. Returns after the first match.
188
+ */
189
+ protected findSelectedNode(roots: OutlineSymbolInformationNode[]): OutlineSymbolInformationNode | undefined {
190
+ const result = roots.find(node => node.selected);
191
+ if (result) {
192
+ return result;
193
+ }
194
+ for (const node of roots) {
195
+ const result2 = this.findSelectedNode(node.children.map(child => child as OutlineSymbolInformationNode));
196
+ if (result2) {
197
+ return result2;
198
+ }
199
+ }
200
+ }
201
+ }
202
+
203
+ export class OutlineBreadcrumb implements Breadcrumb {
204
+ constructor(
205
+ readonly node: OutlineSymbolInformationNode | OutlineSymbolInformationNode[],
206
+ readonly uri: URI,
207
+ readonly index: string,
208
+ readonly label: string,
209
+ readonly iconClass: string,
210
+ readonly containerClass: string,
211
+ ) { }
212
+
213
+ get id(): string {
214
+ return this.type.toString() + '_' + this.uri.toString() + '_' + this.index;
215
+ }
216
+
217
+ get type(): symbol {
218
+ return OutlineBreadcrumbType;
219
+ }
220
+
221
+ get longLabel(): string {
222
+ return this.label;
223
+ }
224
+ }
225
+ export namespace OutlineBreadcrumb {
226
+ export function is(breadcrumb: Breadcrumb): breadcrumb is OutlineBreadcrumb {
227
+ return 'node' in breadcrumb && 'uri' in breadcrumb;
228
+ }
229
+ }
@@ -1,36 +1,36 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 Redhat, Ericsson 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 { inject, injectable, named } from '@theia/core/shared/inversify';
18
- import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
19
- import { TreeDecorator, AbstractTreeDecoratorService } from '@theia/core/lib/browser/tree/tree-decorator';
20
-
21
- /**
22
- * Symbol for all decorators that would like to contribute into the outline.
23
- */
24
- export const OutlineTreeDecorator = Symbol('OutlineTreeDecorator');
25
-
26
- /**
27
- * Decorator service for the outline.
28
- */
29
- @injectable()
30
- export class OutlineDecoratorService extends AbstractTreeDecoratorService {
31
-
32
- constructor(@inject(ContributionProvider) @named(OutlineTreeDecorator) protected readonly contributions: ContributionProvider<TreeDecorator>) {
33
- super(contributions.getContributions());
34
- }
35
-
36
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 Redhat, Ericsson 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 { inject, injectable, named } from '@theia/core/shared/inversify';
18
+ import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
19
+ import { TreeDecorator, AbstractTreeDecoratorService } from '@theia/core/lib/browser/tree/tree-decorator';
20
+
21
+ /**
22
+ * Symbol for all decorators that would like to contribute into the outline.
23
+ */
24
+ export const OutlineTreeDecorator = Symbol('OutlineTreeDecorator');
25
+
26
+ /**
27
+ * Decorator service for the outline.
28
+ */
29
+ @injectable()
30
+ export class OutlineDecoratorService extends AbstractTreeDecoratorService {
31
+
32
+ constructor(@inject(ContributionProvider) @named(OutlineTreeDecorator) protected readonly contributions: ContributionProvider<TreeDecorator>) {
33
+ super(contributions.getContributions());
34
+ }
35
+
36
+ }