@theia/typehierarchy 1.53.0-next.5 → 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 +30 -30
- package/package.json +5 -5
- package/src/browser/index.ts +20 -20
- package/src/browser/style/index.css +28 -28
- package/src/browser/tree/typehierarchy-tree-container.ts +35 -35
- package/src/browser/tree/typehierarchy-tree-model.ts +83 -83
- package/src/browser/tree/typehierarchy-tree-widget.tsx +108 -108
- package/src/browser/tree/typehierarchy-tree.ts +190 -190
- package/src/browser/typehierarchy-contribution.ts +175 -175
- package/src/browser/typehierarchy-frontend-module.ts +38 -38
- package/src/browser/typehierarchy-provider.ts +163 -163
- package/src/browser/typehierarchy-service.ts +89 -89
- package/src/browser/typehierarchy.ts +31 -31
- package/src/package.spec.ts +29 -29
|
@@ -1,175 +1,175 @@
|
|
|
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, named, postConstruct } from '@theia/core/shared/inversify';
|
|
18
|
-
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
|
|
19
|
-
import { ApplicationShell } from '@theia/core/lib/browser/shell';
|
|
20
|
-
import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
|
|
21
|
-
import { Command, CommandRegistry } from '@theia/core/lib/common/command';
|
|
22
|
-
import { EDITOR_CONTEXT_MENU } from '@theia/editor/lib/browser/editor-menu';
|
|
23
|
-
import { EditorAccess, EditorManager } from '@theia/editor/lib/browser/editor-manager';
|
|
24
|
-
import { AbstractViewContribution, OpenViewArguments } from '@theia/core/lib/browser/shell/view-contribution';
|
|
25
|
-
import { TypeHierarchyTree } from './tree/typehierarchy-tree';
|
|
26
|
-
import { TypeHierarchyTreeWidget } from './tree/typehierarchy-tree-widget';
|
|
27
|
-
import { TypeHierarchyDirection } from './typehierarchy-provider';
|
|
28
|
-
import { TypeHierarchyServiceProvider } from './typehierarchy-service';
|
|
29
|
-
import URI from '@theia/core/lib/common/uri';
|
|
30
|
-
|
|
31
|
-
import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
32
|
-
|
|
33
|
-
@injectable()
|
|
34
|
-
export class TypeHierarchyContribution extends AbstractViewContribution<TypeHierarchyTreeWidget> {
|
|
35
|
-
|
|
36
|
-
@inject(ApplicationShell)
|
|
37
|
-
protected override readonly shell: ApplicationShell;
|
|
38
|
-
|
|
39
|
-
@inject(EditorAccess)
|
|
40
|
-
@named(EditorAccess.CURRENT)
|
|
41
|
-
protected readonly editorAccess: EditorAccess;
|
|
42
|
-
|
|
43
|
-
@inject(EditorManager)
|
|
44
|
-
protected readonly editorManager: EditorManager;
|
|
45
|
-
|
|
46
|
-
@inject(ContextKeyService) protected readonly contextKeyService: ContextKeyService;
|
|
47
|
-
protected editorHasTypeHierarchyProvider!: ContextKey<boolean>;
|
|
48
|
-
|
|
49
|
-
@inject(TypeHierarchyServiceProvider)
|
|
50
|
-
protected readonly typeHierarchyServiceProvider: TypeHierarchyServiceProvider;
|
|
51
|
-
|
|
52
|
-
constructor() {
|
|
53
|
-
super({
|
|
54
|
-
widgetId: TypeHierarchyTreeWidget.WIDGET_ID,
|
|
55
|
-
widgetName: TypeHierarchyTreeWidget.WIDGET_LABEL,
|
|
56
|
-
defaultWidgetOptions: {
|
|
57
|
-
area: 'bottom'
|
|
58
|
-
},
|
|
59
|
-
toggleCommandId: TypeHierarchyCommands.TOGGLE_VIEW.id,
|
|
60
|
-
toggleKeybinding: 'ctrlcmd+shift+h'
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@postConstruct()
|
|
65
|
-
protected init(): void {
|
|
66
|
-
this.editorHasTypeHierarchyProvider = this.contextKeyService.createKey('editorHasTypeHierarchyProvider', false);
|
|
67
|
-
this.editorManager.onCurrentEditorChanged(() => this.editorHasTypeHierarchyProvider.set(this.isTypeHierarchyAvailable()));
|
|
68
|
-
this.typeHierarchyServiceProvider.onDidChange(() => this.editorHasTypeHierarchyProvider.set(this.isTypeHierarchyAvailable()));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
protected isTypeHierarchyAvailable(): boolean {
|
|
72
|
-
const { selection, languageId } = this.editorAccess;
|
|
73
|
-
return !!selection && !!languageId && !!this.typeHierarchyServiceProvider.get(languageId, new URI(selection.uri));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
override async openView(args?: Partial<TypeHierarchyOpenViewArguments>): Promise<TypeHierarchyTreeWidget> {
|
|
77
|
-
const widget = await super.openView(args);
|
|
78
|
-
const { selection, languageId } = this.editorAccess;
|
|
79
|
-
const direction = this.getDirection(args);
|
|
80
|
-
await widget.initialize({ location: selection, languageId, direction });
|
|
81
|
-
return widget;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
override registerCommands(commands: CommandRegistry): void {
|
|
85
|
-
super.registerCommands(commands);
|
|
86
|
-
commands.registerCommand(TypeHierarchyCommands.OPEN_SUBTYPE, {
|
|
87
|
-
execute: () => this.openViewOrFlipHierarchyDirection(TypeHierarchyDirection.Children),
|
|
88
|
-
isEnabled: this.isEnabled.bind(this)
|
|
89
|
-
});
|
|
90
|
-
commands.registerCommand(TypeHierarchyCommands.OPEN_SUPERTYPE, {
|
|
91
|
-
execute: () => this.openViewOrFlipHierarchyDirection(TypeHierarchyDirection.Parents),
|
|
92
|
-
isEnabled: this.isEnabled.bind(this)
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
override registerMenus(menus: MenuModelRegistry): void {
|
|
97
|
-
super.registerMenus(menus);
|
|
98
|
-
const menuPath = [...EDITOR_CONTEXT_MENU, 'type-hierarchy'];
|
|
99
|
-
menus.registerMenuAction(menuPath, {
|
|
100
|
-
commandId: TypeHierarchyCommands.OPEN_SUBTYPE.id
|
|
101
|
-
});
|
|
102
|
-
menus.registerMenuAction(menuPath, {
|
|
103
|
-
commandId: TypeHierarchyCommands.OPEN_SUPERTYPE.id
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
override registerKeybindings(keybindings: KeybindingRegistry): void {
|
|
108
|
-
super.registerKeybindings(keybindings);
|
|
109
|
-
keybindings.registerKeybinding({
|
|
110
|
-
command: TypeHierarchyCommands.OPEN_SUBTYPE.id,
|
|
111
|
-
keybinding: 'ctrlcmd+alt+h'
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Flips the hierarchy direction in the `Type Hierarchy` view, if it is active and has a valid root.
|
|
117
|
-
* Otherwise, calculates the type hierarchy based on the selection of the current editor.
|
|
118
|
-
*/
|
|
119
|
-
protected async openViewOrFlipHierarchyDirection(direction: TypeHierarchyDirection): Promise<void> {
|
|
120
|
-
if (this.isEnabled()) {
|
|
121
|
-
const { activeWidget } = this.shell;
|
|
122
|
-
if (activeWidget instanceof TypeHierarchyTreeWidget && TypeHierarchyTree.RootNode.is(activeWidget.model.root)) {
|
|
123
|
-
await activeWidget.model.flipDirection();
|
|
124
|
-
} else {
|
|
125
|
-
await this.openView({
|
|
126
|
-
toggle: false,
|
|
127
|
-
activate: true,
|
|
128
|
-
direction
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Enabled if the `current` editor has the `languageId` or the `Type Hierarchy` widget is the active one.
|
|
136
|
-
*/
|
|
137
|
-
protected isEnabled(languageId: string | undefined = this.editorAccess.languageId): boolean {
|
|
138
|
-
return !!languageId || this.shell.activeWidget instanceof TypeHierarchyTreeWidget;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Extracts the type hierarchy direction from the argument. If the direction cannot be extracted, returns with the `Children` as the default type.
|
|
143
|
-
*/
|
|
144
|
-
protected getDirection(args?: Partial<TypeHierarchyOpenViewArguments>): TypeHierarchyDirection {
|
|
145
|
-
return !!args && !!args.direction ? args.direction : TypeHierarchyDirection.Children;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export interface TypeHierarchyOpenViewArguments extends OpenViewArguments {
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* The type hierarchy direction for the view argument.
|
|
154
|
-
*/
|
|
155
|
-
readonly direction: TypeHierarchyDirection;
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export namespace TypeHierarchyCommands {
|
|
160
|
-
|
|
161
|
-
export const TOGGLE_VIEW: Command = {
|
|
162
|
-
id: 'typehierarchy:toggle'
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
export const OPEN_SUBTYPE = Command.toLocalizedCommand({
|
|
166
|
-
id: 'typehierarchy:open-subtype',
|
|
167
|
-
label: 'Subtype Hierarchy'
|
|
168
|
-
}, 'theia/typehierarchy/subtypeHierarchy');
|
|
169
|
-
|
|
170
|
-
export const OPEN_SUPERTYPE = Command.toLocalizedCommand({
|
|
171
|
-
id: 'typehierarchy:open-supertype',
|
|
172
|
-
label: 'Supertype Hierarchy'
|
|
173
|
-
}, 'theia/typehierarchy/supertypeHierarchy');
|
|
174
|
-
|
|
175
|
-
}
|
|
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, named, postConstruct } from '@theia/core/shared/inversify';
|
|
18
|
+
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
|
|
19
|
+
import { ApplicationShell } from '@theia/core/lib/browser/shell';
|
|
20
|
+
import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
|
|
21
|
+
import { Command, CommandRegistry } from '@theia/core/lib/common/command';
|
|
22
|
+
import { EDITOR_CONTEXT_MENU } from '@theia/editor/lib/browser/editor-menu';
|
|
23
|
+
import { EditorAccess, EditorManager } from '@theia/editor/lib/browser/editor-manager';
|
|
24
|
+
import { AbstractViewContribution, OpenViewArguments } from '@theia/core/lib/browser/shell/view-contribution';
|
|
25
|
+
import { TypeHierarchyTree } from './tree/typehierarchy-tree';
|
|
26
|
+
import { TypeHierarchyTreeWidget } from './tree/typehierarchy-tree-widget';
|
|
27
|
+
import { TypeHierarchyDirection } from './typehierarchy-provider';
|
|
28
|
+
import { TypeHierarchyServiceProvider } from './typehierarchy-service';
|
|
29
|
+
import URI from '@theia/core/lib/common/uri';
|
|
30
|
+
|
|
31
|
+
import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
32
|
+
|
|
33
|
+
@injectable()
|
|
34
|
+
export class TypeHierarchyContribution extends AbstractViewContribution<TypeHierarchyTreeWidget> {
|
|
35
|
+
|
|
36
|
+
@inject(ApplicationShell)
|
|
37
|
+
protected override readonly shell: ApplicationShell;
|
|
38
|
+
|
|
39
|
+
@inject(EditorAccess)
|
|
40
|
+
@named(EditorAccess.CURRENT)
|
|
41
|
+
protected readonly editorAccess: EditorAccess;
|
|
42
|
+
|
|
43
|
+
@inject(EditorManager)
|
|
44
|
+
protected readonly editorManager: EditorManager;
|
|
45
|
+
|
|
46
|
+
@inject(ContextKeyService) protected readonly contextKeyService: ContextKeyService;
|
|
47
|
+
protected editorHasTypeHierarchyProvider!: ContextKey<boolean>;
|
|
48
|
+
|
|
49
|
+
@inject(TypeHierarchyServiceProvider)
|
|
50
|
+
protected readonly typeHierarchyServiceProvider: TypeHierarchyServiceProvider;
|
|
51
|
+
|
|
52
|
+
constructor() {
|
|
53
|
+
super({
|
|
54
|
+
widgetId: TypeHierarchyTreeWidget.WIDGET_ID,
|
|
55
|
+
widgetName: TypeHierarchyTreeWidget.WIDGET_LABEL,
|
|
56
|
+
defaultWidgetOptions: {
|
|
57
|
+
area: 'bottom'
|
|
58
|
+
},
|
|
59
|
+
toggleCommandId: TypeHierarchyCommands.TOGGLE_VIEW.id,
|
|
60
|
+
toggleKeybinding: 'ctrlcmd+shift+h'
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@postConstruct()
|
|
65
|
+
protected init(): void {
|
|
66
|
+
this.editorHasTypeHierarchyProvider = this.contextKeyService.createKey('editorHasTypeHierarchyProvider', false);
|
|
67
|
+
this.editorManager.onCurrentEditorChanged(() => this.editorHasTypeHierarchyProvider.set(this.isTypeHierarchyAvailable()));
|
|
68
|
+
this.typeHierarchyServiceProvider.onDidChange(() => this.editorHasTypeHierarchyProvider.set(this.isTypeHierarchyAvailable()));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
protected isTypeHierarchyAvailable(): boolean {
|
|
72
|
+
const { selection, languageId } = this.editorAccess;
|
|
73
|
+
return !!selection && !!languageId && !!this.typeHierarchyServiceProvider.get(languageId, new URI(selection.uri));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
override async openView(args?: Partial<TypeHierarchyOpenViewArguments>): Promise<TypeHierarchyTreeWidget> {
|
|
77
|
+
const widget = await super.openView(args);
|
|
78
|
+
const { selection, languageId } = this.editorAccess;
|
|
79
|
+
const direction = this.getDirection(args);
|
|
80
|
+
await widget.initialize({ location: selection, languageId, direction });
|
|
81
|
+
return widget;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
override registerCommands(commands: CommandRegistry): void {
|
|
85
|
+
super.registerCommands(commands);
|
|
86
|
+
commands.registerCommand(TypeHierarchyCommands.OPEN_SUBTYPE, {
|
|
87
|
+
execute: () => this.openViewOrFlipHierarchyDirection(TypeHierarchyDirection.Children),
|
|
88
|
+
isEnabled: this.isEnabled.bind(this)
|
|
89
|
+
});
|
|
90
|
+
commands.registerCommand(TypeHierarchyCommands.OPEN_SUPERTYPE, {
|
|
91
|
+
execute: () => this.openViewOrFlipHierarchyDirection(TypeHierarchyDirection.Parents),
|
|
92
|
+
isEnabled: this.isEnabled.bind(this)
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
override registerMenus(menus: MenuModelRegistry): void {
|
|
97
|
+
super.registerMenus(menus);
|
|
98
|
+
const menuPath = [...EDITOR_CONTEXT_MENU, 'type-hierarchy'];
|
|
99
|
+
menus.registerMenuAction(menuPath, {
|
|
100
|
+
commandId: TypeHierarchyCommands.OPEN_SUBTYPE.id
|
|
101
|
+
});
|
|
102
|
+
menus.registerMenuAction(menuPath, {
|
|
103
|
+
commandId: TypeHierarchyCommands.OPEN_SUPERTYPE.id
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
override registerKeybindings(keybindings: KeybindingRegistry): void {
|
|
108
|
+
super.registerKeybindings(keybindings);
|
|
109
|
+
keybindings.registerKeybinding({
|
|
110
|
+
command: TypeHierarchyCommands.OPEN_SUBTYPE.id,
|
|
111
|
+
keybinding: 'ctrlcmd+alt+h'
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Flips the hierarchy direction in the `Type Hierarchy` view, if it is active and has a valid root.
|
|
117
|
+
* Otherwise, calculates the type hierarchy based on the selection of the current editor.
|
|
118
|
+
*/
|
|
119
|
+
protected async openViewOrFlipHierarchyDirection(direction: TypeHierarchyDirection): Promise<void> {
|
|
120
|
+
if (this.isEnabled()) {
|
|
121
|
+
const { activeWidget } = this.shell;
|
|
122
|
+
if (activeWidget instanceof TypeHierarchyTreeWidget && TypeHierarchyTree.RootNode.is(activeWidget.model.root)) {
|
|
123
|
+
await activeWidget.model.flipDirection();
|
|
124
|
+
} else {
|
|
125
|
+
await this.openView({
|
|
126
|
+
toggle: false,
|
|
127
|
+
activate: true,
|
|
128
|
+
direction
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Enabled if the `current` editor has the `languageId` or the `Type Hierarchy` widget is the active one.
|
|
136
|
+
*/
|
|
137
|
+
protected isEnabled(languageId: string | undefined = this.editorAccess.languageId): boolean {
|
|
138
|
+
return !!languageId || this.shell.activeWidget instanceof TypeHierarchyTreeWidget;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Extracts the type hierarchy direction from the argument. If the direction cannot be extracted, returns with the `Children` as the default type.
|
|
143
|
+
*/
|
|
144
|
+
protected getDirection(args?: Partial<TypeHierarchyOpenViewArguments>): TypeHierarchyDirection {
|
|
145
|
+
return !!args && !!args.direction ? args.direction : TypeHierarchyDirection.Children;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface TypeHierarchyOpenViewArguments extends OpenViewArguments {
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The type hierarchy direction for the view argument.
|
|
154
|
+
*/
|
|
155
|
+
readonly direction: TypeHierarchyDirection;
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export namespace TypeHierarchyCommands {
|
|
160
|
+
|
|
161
|
+
export const TOGGLE_VIEW: Command = {
|
|
162
|
+
id: 'typehierarchy:toggle'
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const OPEN_SUBTYPE = Command.toLocalizedCommand({
|
|
166
|
+
id: 'typehierarchy:open-subtype',
|
|
167
|
+
label: 'Subtype Hierarchy'
|
|
168
|
+
}, 'theia/typehierarchy/subtypeHierarchy');
|
|
169
|
+
|
|
170
|
+
export const OPEN_SUPERTYPE = Command.toLocalizedCommand({
|
|
171
|
+
id: 'typehierarchy:open-supertype',
|
|
172
|
+
label: 'Supertype Hierarchy'
|
|
173
|
+
}, 'theia/typehierarchy/supertypeHierarchy');
|
|
174
|
+
|
|
175
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
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
|
-
import { bindContributionProvider } from '@theia/core/lib/common';
|
|
17
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
-
import { WidgetFactory } from '@theia/core/lib/browser/widget-manager';
|
|
19
|
-
import { bindViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
|
|
20
|
-
import { TypeHierarchyRegistry } from './typehierarchy-provider';
|
|
21
|
-
import { TypeHierarchyContribution } from './typehierarchy-contribution';
|
|
22
|
-
import { TypeHierarchyTreeWidget } from './tree/typehierarchy-tree-widget';
|
|
23
|
-
import { TypeHierarchyService, TypeHierarchyServiceProvider } from './typehierarchy-service';
|
|
24
|
-
import { createHierarchyTreeWidget } from './tree/typehierarchy-tree-container';
|
|
25
|
-
|
|
26
|
-
import '../../src/browser/style/index.css';
|
|
27
|
-
|
|
28
|
-
export default new ContainerModule(bind => {
|
|
29
|
-
bindContributionProvider(bind, TypeHierarchyService);
|
|
30
|
-
bind(TypeHierarchyServiceProvider).to(TypeHierarchyServiceProvider).inSingletonScope();
|
|
31
|
-
|
|
32
|
-
bind(TypeHierarchyRegistry).toSelf().inSingletonScope();
|
|
33
|
-
bindViewContribution(bind, TypeHierarchyContribution);
|
|
34
|
-
bind(WidgetFactory).toDynamicValue(context => ({
|
|
35
|
-
id: TypeHierarchyTreeWidget.WIDGET_ID,
|
|
36
|
-
createWidget: () => createHierarchyTreeWidget(context.container)
|
|
37
|
-
}));
|
|
38
|
-
});
|
|
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
|
+
import { bindContributionProvider } from '@theia/core/lib/common';
|
|
17
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
+
import { WidgetFactory } from '@theia/core/lib/browser/widget-manager';
|
|
19
|
+
import { bindViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
|
|
20
|
+
import { TypeHierarchyRegistry } from './typehierarchy-provider';
|
|
21
|
+
import { TypeHierarchyContribution } from './typehierarchy-contribution';
|
|
22
|
+
import { TypeHierarchyTreeWidget } from './tree/typehierarchy-tree-widget';
|
|
23
|
+
import { TypeHierarchyService, TypeHierarchyServiceProvider } from './typehierarchy-service';
|
|
24
|
+
import { createHierarchyTreeWidget } from './tree/typehierarchy-tree-container';
|
|
25
|
+
|
|
26
|
+
import '../../src/browser/style/index.css';
|
|
27
|
+
|
|
28
|
+
export default new ContainerModule(bind => {
|
|
29
|
+
bindContributionProvider(bind, TypeHierarchyService);
|
|
30
|
+
bind(TypeHierarchyServiceProvider).to(TypeHierarchyServiceProvider).inSingletonScope();
|
|
31
|
+
|
|
32
|
+
bind(TypeHierarchyRegistry).toSelf().inSingletonScope();
|
|
33
|
+
bindViewContribution(bind, TypeHierarchyContribution);
|
|
34
|
+
bind(WidgetFactory).toDynamicValue(context => ({
|
|
35
|
+
id: TypeHierarchyTreeWidget.WIDGET_ID,
|
|
36
|
+
createWidget: () => createHierarchyTreeWidget(context.container)
|
|
37
|
+
}));
|
|
38
|
+
});
|