@theia/callhierarchy 1.34.2 → 1.34.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.
- package/LICENSE +641 -641
- package/README.md +30 -30
- package/lib/browser/callhierarchy-contribution.d.ts +25 -25
- package/lib/browser/callhierarchy-contribution.js +124 -124
- package/lib/browser/callhierarchy-frontend-module.d.ts +4 -4
- package/lib/browser/callhierarchy-frontend-module.js +34 -34
- package/lib/browser/callhierarchy-service.d.ts +28 -28
- package/lib/browser/callhierarchy-service.js +85 -85
- package/lib/browser/callhierarchy-tree/callhierarchy-tree-container.d.ts +3 -3
- package/lib/browser/callhierarchy-tree/callhierarchy-tree-container.js +34 -34
- package/lib/browser/callhierarchy-tree/callhierarchy-tree-model.d.ts +14 -14
- package/lib/browser/callhierarchy-tree/callhierarchy-tree-model.js +82 -82
- package/lib/browser/callhierarchy-tree/callhierarchy-tree-widget.d.ts +30 -30
- package/lib/browser/callhierarchy-tree/callhierarchy-tree-widget.js +208 -208
- package/lib/browser/callhierarchy-tree/callhierarchy-tree.d.ts +25 -25
- package/lib/browser/callhierarchy-tree/callhierarchy-tree.js +114 -114
- package/lib/browser/callhierarchy-tree/index.d.ts +4 -4
- package/lib/browser/callhierarchy-tree/index.js +31 -31
- package/lib/browser/callhierarchy.d.ts +25 -25
- package/lib/browser/callhierarchy.js +22 -22
- package/lib/browser/index.d.ts +4 -4
- package/lib/browser/index.js +31 -31
- package/lib/browser/utils.d.ts +11 -11
- package/lib/browser/utils.js +101 -101
- package/lib/package.spec.js +25 -25
- package/package.json +5 -5
- package/src/browser/callhierarchy-contribution.ts +103 -103
- package/src/browser/callhierarchy-frontend-module.ts +37 -37
- package/src/browser/callhierarchy-service.ts +89 -89
- package/src/browser/callhierarchy-tree/callhierarchy-tree-container.ts +35 -35
- package/src/browser/callhierarchy-tree/callhierarchy-tree-model.ts +71 -71
- package/src/browser/callhierarchy-tree/callhierarchy-tree-widget.tsx +223 -223
- package/src/browser/callhierarchy-tree/callhierarchy-tree.ts +119 -119
- package/src/browser/callhierarchy-tree/index.ts +20 -20
- package/src/browser/callhierarchy.ts +47 -47
- package/src/browser/index.ts +20 -20
- package/src/browser/style/index.css +63 -63
- package/src/browser/utils.ts +102 -102
- package/src/package.spec.ts +28 -28
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
<div align='center'>
|
|
2
|
-
|
|
3
|
-
<br />
|
|
4
|
-
|
|
5
|
-
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
-
|
|
7
|
-
<h2>ECLIPSE THEIA - CALL HIERARCHY EXTENSION</h2>
|
|
8
|
-
|
|
9
|
-
<hr />
|
|
10
|
-
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
## Description
|
|
14
|
-
|
|
15
|
-
The `@theia/callhierarchy` extension contributes a `call hierarchy` view which displays the caller hierarchy for a selected callable.
|
|
16
|
-
|
|
17
|
-
## Additional Information
|
|
18
|
-
|
|
19
|
-
- [API documentation for `@theia/callhierarchy`](https://eclipse-theia.github.io/theia/docs/next/modules/callhierarchy.html)
|
|
20
|
-
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
-
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
-
|
|
23
|
-
## License
|
|
24
|
-
|
|
25
|
-
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
-
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
-
|
|
28
|
-
## Trademark
|
|
29
|
-
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
-
https://www.eclipse.org/theia
|
|
1
|
+
<div align='center'>
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
+
|
|
7
|
+
<h2>ECLIPSE THEIA - CALL HIERARCHY EXTENSION</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/callhierarchy` extension contributes a `call hierarchy` view which displays the caller hierarchy for a selected callable.
|
|
16
|
+
|
|
17
|
+
## Additional Information
|
|
18
|
+
|
|
19
|
+
- [API documentation for `@theia/callhierarchy`](https://eclipse-theia.github.io/theia/docs/next/modules/callhierarchy.html)
|
|
20
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
+
|
|
28
|
+
## Trademark
|
|
29
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
+
https://www.eclipse.org/theia
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { MenuModelRegistry, Command, CommandRegistry } from '@theia/core/lib/common';
|
|
2
|
-
import { AbstractViewContribution, OpenViewArguments, KeybindingRegistry } from '@theia/core/lib/browser';
|
|
3
|
-
import { CurrentEditorAccess, EditorManager } from '@theia/editor/lib/browser';
|
|
4
|
-
import { CallHierarchyTreeWidget } from './callhierarchy-tree/callhierarchy-tree-widget';
|
|
5
|
-
import { CALL_HIERARCHY_LABEL, CALL_HIERARCHY_TOGGLE_COMMAND_ID } from './callhierarchy';
|
|
6
|
-
import { CallHierarchyServiceProvider } from './callhierarchy-service';
|
|
7
|
-
import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
8
|
-
export { CALL_HIERARCHY_LABEL, CALL_HIERARCHY_TOGGLE_COMMAND_ID };
|
|
9
|
-
export declare namespace CallHierarchyCommands {
|
|
10
|
-
const OPEN: Command;
|
|
11
|
-
}
|
|
12
|
-
export declare class CallHierarchyContribution extends AbstractViewContribution<CallHierarchyTreeWidget> {
|
|
13
|
-
protected readonly editorAccess: CurrentEditorAccess;
|
|
14
|
-
protected readonly editorManager: EditorManager;
|
|
15
|
-
protected readonly callHierarchyServiceProvider: CallHierarchyServiceProvider;
|
|
16
|
-
protected readonly contextKeyService: ContextKeyService;
|
|
17
|
-
protected editorHasCallHierarchyProvider: ContextKey<boolean>;
|
|
18
|
-
constructor();
|
|
19
|
-
protected init(): void;
|
|
20
|
-
protected isCallHierarchyAvailable(): boolean;
|
|
21
|
-
openView(args?: Partial<OpenViewArguments>): Promise<CallHierarchyTreeWidget>;
|
|
22
|
-
registerCommands(commands: CommandRegistry): void;
|
|
23
|
-
registerMenus(menus: MenuModelRegistry): void;
|
|
24
|
-
registerKeybindings(keybindings: KeybindingRegistry): void;
|
|
25
|
-
}
|
|
1
|
+
import { MenuModelRegistry, Command, CommandRegistry } from '@theia/core/lib/common';
|
|
2
|
+
import { AbstractViewContribution, OpenViewArguments, KeybindingRegistry } from '@theia/core/lib/browser';
|
|
3
|
+
import { CurrentEditorAccess, EditorManager } from '@theia/editor/lib/browser';
|
|
4
|
+
import { CallHierarchyTreeWidget } from './callhierarchy-tree/callhierarchy-tree-widget';
|
|
5
|
+
import { CALL_HIERARCHY_LABEL, CALL_HIERARCHY_TOGGLE_COMMAND_ID } from './callhierarchy';
|
|
6
|
+
import { CallHierarchyServiceProvider } from './callhierarchy-service';
|
|
7
|
+
import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
8
|
+
export { CALL_HIERARCHY_LABEL, CALL_HIERARCHY_TOGGLE_COMMAND_ID };
|
|
9
|
+
export declare namespace CallHierarchyCommands {
|
|
10
|
+
const OPEN: Command;
|
|
11
|
+
}
|
|
12
|
+
export declare class CallHierarchyContribution extends AbstractViewContribution<CallHierarchyTreeWidget> {
|
|
13
|
+
protected readonly editorAccess: CurrentEditorAccess;
|
|
14
|
+
protected readonly editorManager: EditorManager;
|
|
15
|
+
protected readonly callHierarchyServiceProvider: CallHierarchyServiceProvider;
|
|
16
|
+
protected readonly contextKeyService: ContextKeyService;
|
|
17
|
+
protected editorHasCallHierarchyProvider: ContextKey<boolean>;
|
|
18
|
+
constructor();
|
|
19
|
+
protected init(): void;
|
|
20
|
+
protected isCallHierarchyAvailable(): boolean;
|
|
21
|
+
openView(args?: Partial<OpenViewArguments>): Promise<CallHierarchyTreeWidget>;
|
|
22
|
+
registerCommands(commands: CommandRegistry): void;
|
|
23
|
+
registerMenus(menus: MenuModelRegistry): void;
|
|
24
|
+
registerKeybindings(keybindings: KeybindingRegistry): void;
|
|
25
|
+
}
|
|
26
26
|
//# sourceMappingURL=callhierarchy-contribution.d.ts.map
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 TypeFox 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 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
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.CallHierarchyContribution = exports.CallHierarchyCommands = exports.CALL_HIERARCHY_TOGGLE_COMMAND_ID = exports.CALL_HIERARCHY_LABEL = void 0;
|
|
28
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
-
const common_1 = require("@theia/core/lib/common");
|
|
30
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
31
|
-
const browser_2 = require("@theia/editor/lib/browser");
|
|
32
|
-
const callhierarchy_1 = require("./callhierarchy");
|
|
33
|
-
Object.defineProperty(exports, "CALL_HIERARCHY_LABEL", { enumerable: true, get: function () { return callhierarchy_1.CALL_HIERARCHY_LABEL; } });
|
|
34
|
-
Object.defineProperty(exports, "CALL_HIERARCHY_TOGGLE_COMMAND_ID", { enumerable: true, get: function () { return callhierarchy_1.CALL_HIERARCHY_TOGGLE_COMMAND_ID; } });
|
|
35
|
-
const callhierarchy_service_1 = require("./callhierarchy-service");
|
|
36
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
37
|
-
const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
|
|
38
|
-
var CallHierarchyCommands;
|
|
39
|
-
(function (CallHierarchyCommands) {
|
|
40
|
-
CallHierarchyCommands.OPEN = common_1.Command.toLocalizedCommand({
|
|
41
|
-
id: 'callhierarchy:open',
|
|
42
|
-
label: 'Open Call Hierarchy'
|
|
43
|
-
}, 'theia/callhierarchy/open');
|
|
44
|
-
})(CallHierarchyCommands = exports.CallHierarchyCommands || (exports.CallHierarchyCommands = {}));
|
|
45
|
-
let CallHierarchyContribution = class CallHierarchyContribution extends browser_1.AbstractViewContribution {
|
|
46
|
-
constructor() {
|
|
47
|
-
super({
|
|
48
|
-
widgetId: callhierarchy_1.CALLHIERARCHY_ID,
|
|
49
|
-
widgetName: callhierarchy_1.CALL_HIERARCHY_LABEL,
|
|
50
|
-
defaultWidgetOptions: {
|
|
51
|
-
area: 'bottom'
|
|
52
|
-
},
|
|
53
|
-
toggleCommandId: callhierarchy_1.CALL_HIERARCHY_TOGGLE_COMMAND_ID,
|
|
54
|
-
toggleKeybinding: 'ctrlcmd+shift+f1'
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
init() {
|
|
58
|
-
this.editorHasCallHierarchyProvider = this.contextKeyService.createKey('editorHasCallHierarchyProvider', false);
|
|
59
|
-
this.editorManager.onCurrentEditorChanged(() => this.editorHasCallHierarchyProvider.set(this.isCallHierarchyAvailable()));
|
|
60
|
-
this.callHierarchyServiceProvider.onDidChange(() => this.editorHasCallHierarchyProvider.set(this.isCallHierarchyAvailable()));
|
|
61
|
-
}
|
|
62
|
-
isCallHierarchyAvailable() {
|
|
63
|
-
const { selection, languageId } = this.editorAccess;
|
|
64
|
-
return !!selection && !!languageId && !!this.callHierarchyServiceProvider.get(languageId, new uri_1.default(selection.uri));
|
|
65
|
-
}
|
|
66
|
-
async openView(args) {
|
|
67
|
-
const widget = await super.openView(args);
|
|
68
|
-
const { selection, languageId } = this.editorAccess;
|
|
69
|
-
widget.initializeModel(selection, languageId);
|
|
70
|
-
return widget;
|
|
71
|
-
}
|
|
72
|
-
registerCommands(commands) {
|
|
73
|
-
commands.registerCommand(CallHierarchyCommands.OPEN, {
|
|
74
|
-
execute: () => this.openView({
|
|
75
|
-
toggle: false,
|
|
76
|
-
activate: true
|
|
77
|
-
}),
|
|
78
|
-
isEnabled: this.isCallHierarchyAvailable.bind(this)
|
|
79
|
-
});
|
|
80
|
-
super.registerCommands(commands);
|
|
81
|
-
}
|
|
82
|
-
registerMenus(menus) {
|
|
83
|
-
const menuPath = [...browser_2.EDITOR_CONTEXT_MENU, 'navigation'];
|
|
84
|
-
menus.registerMenuAction(menuPath, {
|
|
85
|
-
commandId: CallHierarchyCommands.OPEN.id,
|
|
86
|
-
label: callhierarchy_1.CALL_HIERARCHY_LABEL
|
|
87
|
-
});
|
|
88
|
-
super.registerMenus(menus);
|
|
89
|
-
}
|
|
90
|
-
registerKeybindings(keybindings) {
|
|
91
|
-
super.registerKeybindings(keybindings);
|
|
92
|
-
keybindings.registerKeybinding({
|
|
93
|
-
command: CallHierarchyCommands.OPEN.id,
|
|
94
|
-
keybinding: 'ctrlcmd+f1'
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
__decorate([
|
|
99
|
-
(0, inversify_1.inject)(browser_2.CurrentEditorAccess),
|
|
100
|
-
__metadata("design:type", browser_2.CurrentEditorAccess)
|
|
101
|
-
], CallHierarchyContribution.prototype, "editorAccess", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
(0, inversify_1.inject)(browser_2.EditorManager),
|
|
104
|
-
__metadata("design:type", browser_2.EditorManager)
|
|
105
|
-
], CallHierarchyContribution.prototype, "editorManager", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
(0, inversify_1.inject)(callhierarchy_service_1.CallHierarchyServiceProvider),
|
|
108
|
-
__metadata("design:type", callhierarchy_service_1.CallHierarchyServiceProvider)
|
|
109
|
-
], CallHierarchyContribution.prototype, "callHierarchyServiceProvider", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
(0, inversify_1.inject)(context_key_service_1.ContextKeyService),
|
|
112
|
-
__metadata("design:type", Object)
|
|
113
|
-
], CallHierarchyContribution.prototype, "contextKeyService", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
(0, inversify_1.postConstruct)(),
|
|
116
|
-
__metadata("design:type", Function),
|
|
117
|
-
__metadata("design:paramtypes", []),
|
|
118
|
-
__metadata("design:returntype", void 0)
|
|
119
|
-
], CallHierarchyContribution.prototype, "init", null);
|
|
120
|
-
CallHierarchyContribution = __decorate([
|
|
121
|
-
(0, inversify_1.injectable)(),
|
|
122
|
-
__metadata("design:paramtypes", [])
|
|
123
|
-
], CallHierarchyContribution);
|
|
124
|
-
exports.CallHierarchyContribution = CallHierarchyContribution;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 TypeFox 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 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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.CallHierarchyContribution = exports.CallHierarchyCommands = exports.CALL_HIERARCHY_TOGGLE_COMMAND_ID = exports.CALL_HIERARCHY_LABEL = void 0;
|
|
28
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
+
const common_1 = require("@theia/core/lib/common");
|
|
30
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
31
|
+
const browser_2 = require("@theia/editor/lib/browser");
|
|
32
|
+
const callhierarchy_1 = require("./callhierarchy");
|
|
33
|
+
Object.defineProperty(exports, "CALL_HIERARCHY_LABEL", { enumerable: true, get: function () { return callhierarchy_1.CALL_HIERARCHY_LABEL; } });
|
|
34
|
+
Object.defineProperty(exports, "CALL_HIERARCHY_TOGGLE_COMMAND_ID", { enumerable: true, get: function () { return callhierarchy_1.CALL_HIERARCHY_TOGGLE_COMMAND_ID; } });
|
|
35
|
+
const callhierarchy_service_1 = require("./callhierarchy-service");
|
|
36
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
37
|
+
const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
|
|
38
|
+
var CallHierarchyCommands;
|
|
39
|
+
(function (CallHierarchyCommands) {
|
|
40
|
+
CallHierarchyCommands.OPEN = common_1.Command.toLocalizedCommand({
|
|
41
|
+
id: 'callhierarchy:open',
|
|
42
|
+
label: 'Open Call Hierarchy'
|
|
43
|
+
}, 'theia/callhierarchy/open');
|
|
44
|
+
})(CallHierarchyCommands = exports.CallHierarchyCommands || (exports.CallHierarchyCommands = {}));
|
|
45
|
+
let CallHierarchyContribution = class CallHierarchyContribution extends browser_1.AbstractViewContribution {
|
|
46
|
+
constructor() {
|
|
47
|
+
super({
|
|
48
|
+
widgetId: callhierarchy_1.CALLHIERARCHY_ID,
|
|
49
|
+
widgetName: callhierarchy_1.CALL_HIERARCHY_LABEL,
|
|
50
|
+
defaultWidgetOptions: {
|
|
51
|
+
area: 'bottom'
|
|
52
|
+
},
|
|
53
|
+
toggleCommandId: callhierarchy_1.CALL_HIERARCHY_TOGGLE_COMMAND_ID,
|
|
54
|
+
toggleKeybinding: 'ctrlcmd+shift+f1'
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
init() {
|
|
58
|
+
this.editorHasCallHierarchyProvider = this.contextKeyService.createKey('editorHasCallHierarchyProvider', false);
|
|
59
|
+
this.editorManager.onCurrentEditorChanged(() => this.editorHasCallHierarchyProvider.set(this.isCallHierarchyAvailable()));
|
|
60
|
+
this.callHierarchyServiceProvider.onDidChange(() => this.editorHasCallHierarchyProvider.set(this.isCallHierarchyAvailable()));
|
|
61
|
+
}
|
|
62
|
+
isCallHierarchyAvailable() {
|
|
63
|
+
const { selection, languageId } = this.editorAccess;
|
|
64
|
+
return !!selection && !!languageId && !!this.callHierarchyServiceProvider.get(languageId, new uri_1.default(selection.uri));
|
|
65
|
+
}
|
|
66
|
+
async openView(args) {
|
|
67
|
+
const widget = await super.openView(args);
|
|
68
|
+
const { selection, languageId } = this.editorAccess;
|
|
69
|
+
widget.initializeModel(selection, languageId);
|
|
70
|
+
return widget;
|
|
71
|
+
}
|
|
72
|
+
registerCommands(commands) {
|
|
73
|
+
commands.registerCommand(CallHierarchyCommands.OPEN, {
|
|
74
|
+
execute: () => this.openView({
|
|
75
|
+
toggle: false,
|
|
76
|
+
activate: true
|
|
77
|
+
}),
|
|
78
|
+
isEnabled: this.isCallHierarchyAvailable.bind(this)
|
|
79
|
+
});
|
|
80
|
+
super.registerCommands(commands);
|
|
81
|
+
}
|
|
82
|
+
registerMenus(menus) {
|
|
83
|
+
const menuPath = [...browser_2.EDITOR_CONTEXT_MENU, 'navigation'];
|
|
84
|
+
menus.registerMenuAction(menuPath, {
|
|
85
|
+
commandId: CallHierarchyCommands.OPEN.id,
|
|
86
|
+
label: callhierarchy_1.CALL_HIERARCHY_LABEL
|
|
87
|
+
});
|
|
88
|
+
super.registerMenus(menus);
|
|
89
|
+
}
|
|
90
|
+
registerKeybindings(keybindings) {
|
|
91
|
+
super.registerKeybindings(keybindings);
|
|
92
|
+
keybindings.registerKeybinding({
|
|
93
|
+
command: CallHierarchyCommands.OPEN.id,
|
|
94
|
+
keybinding: 'ctrlcmd+f1'
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, inversify_1.inject)(browser_2.CurrentEditorAccess),
|
|
100
|
+
__metadata("design:type", browser_2.CurrentEditorAccess)
|
|
101
|
+
], CallHierarchyContribution.prototype, "editorAccess", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, inversify_1.inject)(browser_2.EditorManager),
|
|
104
|
+
__metadata("design:type", browser_2.EditorManager)
|
|
105
|
+
], CallHierarchyContribution.prototype, "editorManager", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, inversify_1.inject)(callhierarchy_service_1.CallHierarchyServiceProvider),
|
|
108
|
+
__metadata("design:type", callhierarchy_service_1.CallHierarchyServiceProvider)
|
|
109
|
+
], CallHierarchyContribution.prototype, "callHierarchyServiceProvider", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, inversify_1.inject)(context_key_service_1.ContextKeyService),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], CallHierarchyContribution.prototype, "contextKeyService", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, inversify_1.postConstruct)(),
|
|
116
|
+
__metadata("design:type", Function),
|
|
117
|
+
__metadata("design:paramtypes", []),
|
|
118
|
+
__metadata("design:returntype", void 0)
|
|
119
|
+
], CallHierarchyContribution.prototype, "init", null);
|
|
120
|
+
CallHierarchyContribution = __decorate([
|
|
121
|
+
(0, inversify_1.injectable)(),
|
|
122
|
+
__metadata("design:paramtypes", [])
|
|
123
|
+
], CallHierarchyContribution);
|
|
124
|
+
exports.CallHierarchyContribution = CallHierarchyContribution;
|
|
125
125
|
//# sourceMappingURL=callhierarchy-contribution.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
-
import '../../src/browser/style/index.css';
|
|
3
|
-
declare const _default: ContainerModule;
|
|
4
|
-
export default _default;
|
|
1
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
+
import '../../src/browser/style/index.css';
|
|
3
|
+
declare const _default: ContainerModule;
|
|
4
|
+
export default _default;
|
|
5
5
|
//# sourceMappingURL=callhierarchy-frontend-module.d.ts.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 TypeFox 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 WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const callhierarchy_contribution_1 = require("./callhierarchy-contribution");
|
|
19
|
-
const common_1 = require("@theia/core/lib/common");
|
|
20
|
-
const callhierarchy_service_1 = require("./callhierarchy-service");
|
|
21
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
-
const callhierarchy_1 = require("./callhierarchy");
|
|
23
|
-
const callhierarchy_tree_1 = require("./callhierarchy-tree");
|
|
24
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
-
require("../../src/browser/style/index.css");
|
|
26
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
27
|
-
(0, common_1.bindContributionProvider)(bind, callhierarchy_service_1.CallHierarchyService);
|
|
28
|
-
bind(callhierarchy_service_1.CallHierarchyServiceProvider).to(callhierarchy_service_1.CallHierarchyServiceProvider).inSingletonScope();
|
|
29
|
-
(0, browser_1.bindViewContribution)(bind, callhierarchy_contribution_1.CallHierarchyContribution);
|
|
30
|
-
bind(browser_1.WidgetFactory).toDynamicValue(context => ({
|
|
31
|
-
id: callhierarchy_1.CALLHIERARCHY_ID,
|
|
32
|
-
createWidget: () => (0, callhierarchy_tree_1.createHierarchyTreeWidget)(context.container)
|
|
33
|
-
}));
|
|
34
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 TypeFox 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 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const callhierarchy_contribution_1 = require("./callhierarchy-contribution");
|
|
19
|
+
const common_1 = require("@theia/core/lib/common");
|
|
20
|
+
const callhierarchy_service_1 = require("./callhierarchy-service");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const callhierarchy_1 = require("./callhierarchy");
|
|
23
|
+
const callhierarchy_tree_1 = require("./callhierarchy-tree");
|
|
24
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
+
require("../../src/browser/style/index.css");
|
|
26
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
27
|
+
(0, common_1.bindContributionProvider)(bind, callhierarchy_service_1.CallHierarchyService);
|
|
28
|
+
bind(callhierarchy_service_1.CallHierarchyServiceProvider).to(callhierarchy_service_1.CallHierarchyServiceProvider).inSingletonScope();
|
|
29
|
+
(0, browser_1.bindViewContribution)(bind, callhierarchy_contribution_1.CallHierarchyContribution);
|
|
30
|
+
bind(browser_1.WidgetFactory).toDynamicValue(context => ({
|
|
31
|
+
id: callhierarchy_1.CALLHIERARCHY_ID,
|
|
32
|
+
createWidget: () => (0, callhierarchy_tree_1.createHierarchyTreeWidget)(context.container)
|
|
33
|
+
}));
|
|
34
|
+
});
|
|
35
35
|
//# sourceMappingURL=callhierarchy-frontend-module.js.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Position, DocumentUri } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
2
|
-
import { CancellationToken } from '@theia/core';
|
|
3
|
-
import URI from '@theia/core/lib/common/uri';
|
|
4
|
-
import { ContributionProvider, Disposable, Emitter, Event } from '@theia/core/lib/common';
|
|
5
|
-
import { CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from './callhierarchy';
|
|
6
|
-
import { LanguageSelector } from '@theia/editor/lib/common/language-selector';
|
|
7
|
-
export declare const CallHierarchyService: unique symbol;
|
|
8
|
-
export interface CallHierarchySession {
|
|
9
|
-
items: CallHierarchyItem[];
|
|
10
|
-
dispose(): void;
|
|
11
|
-
}
|
|
12
|
-
export interface CallHierarchyService {
|
|
13
|
-
readonly selector: LanguageSelector;
|
|
14
|
-
getRootDefinition(uri: DocumentUri, position: Position, cancellationToken: CancellationToken): Promise<CallHierarchySession | undefined>;
|
|
15
|
-
getCallers(definition: CallHierarchyItem, cancellationToken: CancellationToken): Promise<CallHierarchyIncomingCall[] | undefined>;
|
|
16
|
-
getCallees?(definition: CallHierarchyItem, cancellationToken: CancellationToken): Promise<CallHierarchyOutgoingCall[] | undefined>;
|
|
17
|
-
}
|
|
18
|
-
export declare class CallHierarchyServiceProvider {
|
|
19
|
-
protected readonly contributions: ContributionProvider<CallHierarchyService>;
|
|
20
|
-
protected readonly onDidChangeEmitter: Emitter<void>;
|
|
21
|
-
get onDidChange(): Event<void>;
|
|
22
|
-
private services;
|
|
23
|
-
init(): void;
|
|
24
|
-
get(languageId: string, uri: URI): CallHierarchyService | undefined;
|
|
25
|
-
protected score(service: CallHierarchyService, languageId: string, uri: URI): number;
|
|
26
|
-
add(service: CallHierarchyService): Disposable;
|
|
27
|
-
private remove;
|
|
28
|
-
}
|
|
1
|
+
import { Position, DocumentUri } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
2
|
+
import { CancellationToken } from '@theia/core';
|
|
3
|
+
import URI from '@theia/core/lib/common/uri';
|
|
4
|
+
import { ContributionProvider, Disposable, Emitter, Event } from '@theia/core/lib/common';
|
|
5
|
+
import { CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from './callhierarchy';
|
|
6
|
+
import { LanguageSelector } from '@theia/editor/lib/common/language-selector';
|
|
7
|
+
export declare const CallHierarchyService: unique symbol;
|
|
8
|
+
export interface CallHierarchySession {
|
|
9
|
+
items: CallHierarchyItem[];
|
|
10
|
+
dispose(): void;
|
|
11
|
+
}
|
|
12
|
+
export interface CallHierarchyService {
|
|
13
|
+
readonly selector: LanguageSelector;
|
|
14
|
+
getRootDefinition(uri: DocumentUri, position: Position, cancellationToken: CancellationToken): Promise<CallHierarchySession | undefined>;
|
|
15
|
+
getCallers(definition: CallHierarchyItem, cancellationToken: CancellationToken): Promise<CallHierarchyIncomingCall[] | undefined>;
|
|
16
|
+
getCallees?(definition: CallHierarchyItem, cancellationToken: CancellationToken): Promise<CallHierarchyOutgoingCall[] | undefined>;
|
|
17
|
+
}
|
|
18
|
+
export declare class CallHierarchyServiceProvider {
|
|
19
|
+
protected readonly contributions: ContributionProvider<CallHierarchyService>;
|
|
20
|
+
protected readonly onDidChangeEmitter: Emitter<void>;
|
|
21
|
+
get onDidChange(): Event<void>;
|
|
22
|
+
private services;
|
|
23
|
+
init(): void;
|
|
24
|
+
get(languageId: string, uri: URI): CallHierarchyService | undefined;
|
|
25
|
+
protected score(service: CallHierarchyService, languageId: string, uri: URI): number;
|
|
26
|
+
add(service: CallHierarchyService): Disposable;
|
|
27
|
+
private remove;
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=callhierarchy-service.d.ts.map
|