@theia/typehierarchy 1.67.0-next.56 → 1.67.0-next.86

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 (45) hide show
  1. package/lib/browser/index.d.ts +5 -0
  2. package/lib/browser/index.d.ts.map +1 -0
  3. package/lib/browser/index.js +23 -0
  4. package/lib/browser/index.js.map +1 -0
  5. package/lib/browser/tree/typehierarchy-tree-container.d.ts +4 -0
  6. package/lib/browser/tree/typehierarchy-tree-container.d.ts.map +1 -0
  7. package/lib/browser/tree/typehierarchy-tree-container.js +35 -0
  8. package/lib/browser/tree/typehierarchy-tree-container.js.map +1 -0
  9. package/lib/browser/tree/typehierarchy-tree-model.d.ts +17 -0
  10. package/lib/browser/tree/typehierarchy-tree-model.d.ts.map +1 -0
  11. package/lib/browser/tree/typehierarchy-tree-model.js +85 -0
  12. package/lib/browser/tree/typehierarchy-tree-model.js.map +1 -0
  13. package/lib/browser/tree/typehierarchy-tree-widget.d.ts +37 -0
  14. package/lib/browser/tree/typehierarchy-tree-widget.d.ts.map +1 -0
  15. package/lib/browser/tree/typehierarchy-tree-widget.js +108 -0
  16. package/lib/browser/tree/typehierarchy-tree-widget.js.map +1 -0
  17. package/lib/browser/tree/typehierarchy-tree.d.ts +39 -0
  18. package/lib/browser/tree/typehierarchy-tree.d.ts.map +1 -0
  19. package/lib/browser/tree/typehierarchy-tree.js +169 -0
  20. package/lib/browser/tree/typehierarchy-tree.js.map +1 -0
  21. package/lib/browser/typehierarchy-contribution.d.ts +50 -0
  22. package/lib/browser/typehierarchy-contribution.d.ts.map +1 -0
  23. package/lib/browser/typehierarchy-contribution.js +165 -0
  24. package/lib/browser/typehierarchy-contribution.js.map +1 -0
  25. package/lib/browser/typehierarchy-frontend-module.d.ts +5 -0
  26. package/lib/browser/typehierarchy-frontend-module.d.ts.map +1 -0
  27. package/lib/browser/typehierarchy-frontend-module.js +38 -0
  28. package/lib/browser/typehierarchy-frontend-module.js.map +1 -0
  29. package/lib/browser/typehierarchy-provider.d.ts +105 -0
  30. package/lib/browser/typehierarchy-provider.d.ts.map +1 -0
  31. package/lib/browser/typehierarchy-provider.js +42 -0
  32. package/lib/browser/typehierarchy-provider.js.map +1 -0
  33. package/lib/browser/typehierarchy-service.d.ts +29 -0
  34. package/lib/browser/typehierarchy-service.d.ts.map +1 -0
  35. package/lib/browser/typehierarchy-service.js +78 -0
  36. package/lib/browser/typehierarchy-service.js.map +1 -0
  37. package/lib/browser/typehierarchy.d.ts +14 -0
  38. package/lib/browser/typehierarchy.d.ts.map +1 -0
  39. package/lib/browser/typehierarchy.js +18 -0
  40. package/lib/browser/typehierarchy.js.map +1 -0
  41. package/lib/package.spec.d.ts +1 -0
  42. package/lib/package.spec.d.ts.map +1 -0
  43. package/lib/package.spec.js +26 -0
  44. package/lib/package.spec.js.map +1 -0
  45. package/package.json +4 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/typehierarchy-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAE9G,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAGvE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,6CAA6C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AM,cAAc,SAGiB,CAAC;CAEhD"}
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 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-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TypeHierarchyCommands = exports.TypeHierarchyContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const shell_1 = require("@theia/core/lib/browser/shell");
22
+ const command_1 = require("@theia/core/lib/common/command");
23
+ const editor_menu_1 = require("@theia/editor/lib/browser/editor-menu");
24
+ const editor_manager_1 = require("@theia/editor/lib/browser/editor-manager");
25
+ const view_contribution_1 = require("@theia/core/lib/browser/shell/view-contribution");
26
+ const typehierarchy_tree_1 = require("./tree/typehierarchy-tree");
27
+ const typehierarchy_tree_widget_1 = require("./tree/typehierarchy-tree-widget");
28
+ const typehierarchy_service_1 = require("./typehierarchy-service");
29
+ const uri_1 = require("@theia/core/lib/common/uri");
30
+ const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
31
+ let TypeHierarchyContribution = class TypeHierarchyContribution extends view_contribution_1.AbstractViewContribution {
32
+ constructor() {
33
+ super({
34
+ widgetId: typehierarchy_tree_widget_1.TypeHierarchyTreeWidget.WIDGET_ID,
35
+ widgetName: typehierarchy_tree_widget_1.TypeHierarchyTreeWidget.WIDGET_LABEL,
36
+ defaultWidgetOptions: {
37
+ area: 'bottom'
38
+ },
39
+ toggleCommandId: TypeHierarchyCommands.TOGGLE_VIEW.id,
40
+ toggleKeybinding: 'ctrlcmd+shift+h'
41
+ });
42
+ }
43
+ init() {
44
+ this.editorHasTypeHierarchyProvider = this.contextKeyService.createKey('editorHasTypeHierarchyProvider', false);
45
+ this.editorManager.onCurrentEditorChanged(() => this.editorHasTypeHierarchyProvider.set(this.isTypeHierarchyAvailable()));
46
+ this.typeHierarchyServiceProvider.onDidChange(() => this.editorHasTypeHierarchyProvider.set(this.isTypeHierarchyAvailable()));
47
+ }
48
+ isTypeHierarchyAvailable() {
49
+ const { selection, languageId } = this.editorAccess;
50
+ return !!selection && !!languageId && !!this.typeHierarchyServiceProvider.get(languageId, new uri_1.default(selection.uri));
51
+ }
52
+ async openView(args) {
53
+ const widget = await super.openView(args);
54
+ const { selection, languageId } = this.editorAccess;
55
+ const direction = this.getDirection(args);
56
+ await widget.initialize({ location: selection, languageId, direction });
57
+ return widget;
58
+ }
59
+ registerCommands(commands) {
60
+ super.registerCommands(commands);
61
+ commands.registerCommand(TypeHierarchyCommands.OPEN_SUBTYPE, {
62
+ execute: () => this.openViewOrFlipHierarchyDirection(0 /* TypeHierarchyDirection.Children */),
63
+ isEnabled: this.isEnabled.bind(this)
64
+ });
65
+ commands.registerCommand(TypeHierarchyCommands.OPEN_SUPERTYPE, {
66
+ execute: () => this.openViewOrFlipHierarchyDirection(1 /* TypeHierarchyDirection.Parents */),
67
+ isEnabled: this.isEnabled.bind(this)
68
+ });
69
+ }
70
+ registerMenus(menus) {
71
+ super.registerMenus(menus);
72
+ const menuPath = [...editor_menu_1.EDITOR_CONTEXT_MENU, 'type-hierarchy'];
73
+ menus.registerMenuAction(menuPath, {
74
+ commandId: TypeHierarchyCommands.OPEN_SUBTYPE.id
75
+ });
76
+ menus.registerMenuAction(menuPath, {
77
+ commandId: TypeHierarchyCommands.OPEN_SUPERTYPE.id
78
+ });
79
+ }
80
+ registerKeybindings(keybindings) {
81
+ super.registerKeybindings(keybindings);
82
+ keybindings.registerKeybinding({
83
+ command: TypeHierarchyCommands.OPEN_SUBTYPE.id,
84
+ keybinding: 'ctrlcmd+alt+h'
85
+ });
86
+ }
87
+ /**
88
+ * Flips the hierarchy direction in the `Type Hierarchy` view, if it is active and has a valid root.
89
+ * Otherwise, calculates the type hierarchy based on the selection of the current editor.
90
+ */
91
+ async openViewOrFlipHierarchyDirection(direction) {
92
+ if (this.isEnabled()) {
93
+ const { activeWidget } = this.shell;
94
+ if (activeWidget instanceof typehierarchy_tree_widget_1.TypeHierarchyTreeWidget && typehierarchy_tree_1.TypeHierarchyTree.RootNode.is(activeWidget.model.root)) {
95
+ await activeWidget.model.flipDirection();
96
+ }
97
+ else {
98
+ await this.openView({
99
+ toggle: false,
100
+ activate: true,
101
+ direction
102
+ });
103
+ }
104
+ }
105
+ }
106
+ /**
107
+ * Enabled if the `current` editor has the `languageId` or the `Type Hierarchy` widget is the active one.
108
+ */
109
+ isEnabled(languageId = this.editorAccess.languageId) {
110
+ return !!languageId || this.shell.activeWidget instanceof typehierarchy_tree_widget_1.TypeHierarchyTreeWidget;
111
+ }
112
+ /**
113
+ * Extracts the type hierarchy direction from the argument. If the direction cannot be extracted, returns with the `Children` as the default type.
114
+ */
115
+ getDirection(args) {
116
+ return !!args && !!args.direction ? args.direction : 0 /* TypeHierarchyDirection.Children */;
117
+ }
118
+ };
119
+ exports.TypeHierarchyContribution = TypeHierarchyContribution;
120
+ tslib_1.__decorate([
121
+ (0, inversify_1.inject)(shell_1.ApplicationShell),
122
+ tslib_1.__metadata("design:type", shell_1.ApplicationShell)
123
+ ], TypeHierarchyContribution.prototype, "shell", void 0);
124
+ tslib_1.__decorate([
125
+ (0, inversify_1.inject)(editor_manager_1.EditorAccess),
126
+ (0, inversify_1.named)(editor_manager_1.EditorAccess.CURRENT),
127
+ tslib_1.__metadata("design:type", editor_manager_1.EditorAccess)
128
+ ], TypeHierarchyContribution.prototype, "editorAccess", void 0);
129
+ tslib_1.__decorate([
130
+ (0, inversify_1.inject)(editor_manager_1.EditorManager),
131
+ tslib_1.__metadata("design:type", editor_manager_1.EditorManager)
132
+ ], TypeHierarchyContribution.prototype, "editorManager", void 0);
133
+ tslib_1.__decorate([
134
+ (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
135
+ tslib_1.__metadata("design:type", Object)
136
+ ], TypeHierarchyContribution.prototype, "contextKeyService", void 0);
137
+ tslib_1.__decorate([
138
+ (0, inversify_1.inject)(typehierarchy_service_1.TypeHierarchyServiceProvider),
139
+ tslib_1.__metadata("design:type", typehierarchy_service_1.TypeHierarchyServiceProvider)
140
+ ], TypeHierarchyContribution.prototype, "typeHierarchyServiceProvider", void 0);
141
+ tslib_1.__decorate([
142
+ (0, inversify_1.postConstruct)(),
143
+ tslib_1.__metadata("design:type", Function),
144
+ tslib_1.__metadata("design:paramtypes", []),
145
+ tslib_1.__metadata("design:returntype", void 0)
146
+ ], TypeHierarchyContribution.prototype, "init", null);
147
+ exports.TypeHierarchyContribution = TypeHierarchyContribution = tslib_1.__decorate([
148
+ (0, inversify_1.injectable)(),
149
+ tslib_1.__metadata("design:paramtypes", [])
150
+ ], TypeHierarchyContribution);
151
+ var TypeHierarchyCommands;
152
+ (function (TypeHierarchyCommands) {
153
+ TypeHierarchyCommands.TOGGLE_VIEW = {
154
+ id: 'typehierarchy:toggle'
155
+ };
156
+ TypeHierarchyCommands.OPEN_SUBTYPE = command_1.Command.toLocalizedCommand({
157
+ id: 'typehierarchy:open-subtype',
158
+ label: 'Subtype Hierarchy'
159
+ }, 'theia/typehierarchy/subtypeHierarchy');
160
+ TypeHierarchyCommands.OPEN_SUPERTYPE = command_1.Command.toLocalizedCommand({
161
+ id: 'typehierarchy:open-supertype',
162
+ label: 'Supertype Hierarchy'
163
+ }, 'theia/typehierarchy/supertypeHierarchy');
164
+ })(TypeHierarchyCommands || (exports.TypeHierarchyCommands = TypeHierarchyCommands = {}));
165
+ //# sourceMappingURL=typehierarchy-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy-contribution.js","sourceRoot":"","sources":["../../src/browser/typehierarchy-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAwF;AAExF,yDAAiE;AAEjE,4DAA0E;AAC1E,uEAA4E;AAC5E,6EAAuF;AACvF,uFAA8G;AAC9G,kEAA8D;AAC9D,gFAA2E;AAE3E,mEAAuE;AACvE,oDAA6C;AAE7C,qFAA4F;AAGrF,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,4CAAiD;IAkB5F;QACI,KAAK,CAAC;YACF,QAAQ,EAAE,mDAAuB,CAAC,SAAS;YAC3C,UAAU,EAAE,mDAAuB,CAAC,YAAY;YAChD,oBAAoB,EAAE;gBAClB,IAAI,EAAE,QAAQ;aACjB;YACD,eAAe,EAAE,qBAAqB,CAAC,WAAW,CAAC,EAAE;YACrD,gBAAgB,EAAE,iBAAiB;SACtC,CAAC,CAAC;IACP,CAAC;IAGS,IAAI;QACV,IAAI,CAAC,8BAA8B,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QAChH,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC;QAC1H,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC;IAClI,CAAC;IAES,wBAAwB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AED;;OAEG;IACO,YAAY,CAAC,IAA8C;QACjE,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,wCAAgC,CAAC;IACzF,CAAC;CAEJ,CAAA;AAlHY,8DAAyB;AAGN;IAD3B,IAAA,kBAAM,EAAC,wBAAgB,CAAC;sCACU,wBAAgB;wDAAC;AAIjC;IAFlB,IAAA,kBAAM,EAAC,6BAAY,CAAC;IACpB,IAAA,iBAAK,EAAC,6BAAY,CAAC,OAAO,CAAC;sCACK,6BAAY;+DAAC;AAG3B;IADlB,IAAA,kBAAM,EAAC,8BAAa,CAAC;sCACY,8BAAa;gEAAC;AAEF;IAA7C,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;oEAAyD;AAIhE;IADlB,IAAA,kBAAM,EAAC,oDAA4B,CAAC;sCACY,oDAA4B;+EAAC;AAepE;IADT,IAAA,yBAAa,GAAE;;;;qDAKf;oCAnCQ,yBAAyB;IADrC,IAAA,sBAAU,GAAE;;GACA,yBAAyB,CAkHrC;AAWD,IAAiB,qBAAqB,CAgBrC;AAhBD,WAAiB,qBAAqB;IAErB,iCAAW,GAAY;QAChC,EAAE,EAAE,sBAAsB;KAC7B,CAAC;IAEW,kCAAY,GAAG,iBAAO,CAAC,kBAAkB,CAAC;QACnD,EAAE,EAAE,4BAA4B;QAChC,KAAK,EAAE,mBAAmB;KAC7B,EAAE,sCAAsC,CAAC,CAAC;IAE9B,oCAAc,GAAG,iBAAO,CAAC,kBAAkB,CAAC;QACrD,EAAE,EAAE,8BAA8B;QAClC,KAAK,EAAE,qBAAqB;KAC/B,EAAE,wCAAwC,CAAC,CAAC;AAEjD,CAAC,EAhBgB,qBAAqB,qCAArB,qBAAqB,QAgBrC"}
@@ -0,0 +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;
5
+ //# sourceMappingURL=typehierarchy-frontend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/typehierarchy-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAS/D,OAAO,mCAAmC,CAAC;;AAE3C,wBAUG"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // *****************************************************************************
4
+ // Copyright (C) 2019 TypeFox and others.
5
+ //
6
+ // This program and the accompanying materials are made available under the
7
+ // terms of the Eclipse Public License v. 2.0 which is available at
8
+ // http://www.eclipse.org/legal/epl-2.0.
9
+ //
10
+ // This Source Code may also be made available under the following Secondary
11
+ // Licenses when the conditions for such availability set forth in the Eclipse
12
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
13
+ // with the GNU Classpath Exception which is available at
14
+ // https://www.gnu.org/software/classpath/license.html.
15
+ //
16
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
17
+ // *****************************************************************************
18
+ const common_1 = require("@theia/core/lib/common");
19
+ const inversify_1 = require("@theia/core/shared/inversify");
20
+ const widget_manager_1 = require("@theia/core/lib/browser/widget-manager");
21
+ const view_contribution_1 = require("@theia/core/lib/browser/shell/view-contribution");
22
+ const typehierarchy_provider_1 = require("./typehierarchy-provider");
23
+ const typehierarchy_contribution_1 = require("./typehierarchy-contribution");
24
+ const typehierarchy_tree_widget_1 = require("./tree/typehierarchy-tree-widget");
25
+ const typehierarchy_service_1 = require("./typehierarchy-service");
26
+ const typehierarchy_tree_container_1 = require("./tree/typehierarchy-tree-container");
27
+ require("../../src/browser/style/index.css");
28
+ exports.default = new inversify_1.ContainerModule(bind => {
29
+ (0, common_1.bindContributionProvider)(bind, typehierarchy_service_1.TypeHierarchyService);
30
+ bind(typehierarchy_service_1.TypeHierarchyServiceProvider).to(typehierarchy_service_1.TypeHierarchyServiceProvider).inSingletonScope();
31
+ bind(typehierarchy_provider_1.TypeHierarchyRegistry).toSelf().inSingletonScope();
32
+ (0, view_contribution_1.bindViewContribution)(bind, typehierarchy_contribution_1.TypeHierarchyContribution);
33
+ bind(widget_manager_1.WidgetFactory).toDynamicValue(context => ({
34
+ id: typehierarchy_tree_widget_1.TypeHierarchyTreeWidget.WIDGET_ID,
35
+ createWidget: () => (0, typehierarchy_tree_container_1.createHierarchyTreeWidget)(context.container)
36
+ }));
37
+ });
38
+ //# sourceMappingURL=typehierarchy-frontend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy-frontend-module.js","sourceRoot":"","sources":["../../src/browser/typehierarchy-frontend-module.ts"],"names":[],"mappings":";;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,mDAAkE;AAClE,4DAA+D;AAC/D,2EAAuE;AACvE,uFAAuF;AACvF,qEAAiE;AACjE,6EAAyE;AACzE,gFAA2E;AAC3E,mEAA6F;AAC7F,sFAAgF;AAEhF,6CAA2C;AAE3C,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAA,iCAAwB,EAAC,IAAI,EAAE,4CAAoB,CAAC,CAAC;IACrD,IAAI,CAAC,oDAA4B,CAAC,CAAC,EAAE,CAAC,oDAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAEvF,IAAI,CAAC,8CAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxD,IAAA,wCAAoB,EAAC,IAAI,EAAE,sDAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,8BAAa,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC3C,EAAE,EAAE,mDAAuB,CAAC,SAAS;QACrC,YAAY,EAAE,GAAG,EAAE,CAAC,IAAA,wDAAyB,EAAC,OAAO,CAAC,SAAS,CAAC;KACnE,CAAC,CAAC,CAAC;AACR,CAAC,CAAC,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { Disposable } from '@theia/core/lib/common/disposable';
2
+ import { SymbolKind, Range, TextDocumentPositionParams } from '@theia/core/shared/vscode-languageserver-protocol';
3
+ export declare class TypeHierarchyRegistry {
4
+ protected readonly providers: Map<string, TypeHierarchyProvider>;
5
+ get(languageId: string | undefined): Promise<TypeHierarchyProvider | undefined>;
6
+ register(provider: TypeHierarchyProvider): Disposable;
7
+ }
8
+ export interface TypeHierarchyProvider extends Disposable {
9
+ readonly languageId: string;
10
+ get(params: TypeHierarchyParams): Promise<TypeHierarchyItem | undefined>;
11
+ resolve(params: ResolveTypeHierarchyItemParams): Promise<TypeHierarchyItem | undefined>;
12
+ }
13
+ /**
14
+ * The type hierarchy params is an extension of the `TextDocumentPositionParams` with optional properties
15
+ * which can be used to eagerly resolve the item when requesting from the server.
16
+ */
17
+ export interface TypeHierarchyParams extends TextDocumentPositionParams {
18
+ /**
19
+ * The hierarchy levels to resolve. `0` indicates no level. When not defined, it is treated as `0`.
20
+ */
21
+ resolve?: number;
22
+ /**
23
+ * The direction of the hierarchy levels to resolve.
24
+ */
25
+ direction?: TypeHierarchyDirection;
26
+ }
27
+ export declare const enum TypeHierarchyDirection {
28
+ /**
29
+ * Flag for retrieving/resolving the subtypes.
30
+ */
31
+ Children = 0,
32
+ /**
33
+ * Flag to use when retrieving/resolving the supertypes.
34
+ */
35
+ Parents = 1,
36
+ /**
37
+ * Flag for resolving both the super- and subtypes.
38
+ */
39
+ Both = 2
40
+ }
41
+ /**
42
+ * Parameters for the `typeHierarchy/resolve` request.
43
+ */
44
+ export interface ResolveTypeHierarchyItemParams {
45
+ /**
46
+ * The item to resolve.
47
+ */
48
+ item: TypeHierarchyItem;
49
+ /**
50
+ * The hierarchy levels to resolve. `0` indicates no level.
51
+ */
52
+ resolve: number;
53
+ /**
54
+ * The direction of the hierarchy levels to resolve.
55
+ */
56
+ direction: TypeHierarchyDirection;
57
+ }
58
+ export interface TypeHierarchyItem {
59
+ /**
60
+ * The human readable name of the hierarchy item.
61
+ */
62
+ name: string;
63
+ /**
64
+ * Optional detail for the hierarchy item. It can be, for instance, the signature of a function or method.
65
+ */
66
+ detail?: string;
67
+ /**
68
+ * The kind of the hierarchy item. For instance, class or interface.
69
+ */
70
+ kind: SymbolKind;
71
+ /**
72
+ * `true` if the hierarchy item is deprecated. Otherwise, `false`. It is `false` by default.
73
+ */
74
+ deprecated?: boolean;
75
+ /**
76
+ * The URI of the text document where this type hierarchy item belongs to.
77
+ */
78
+ uri: string;
79
+ /**
80
+ * The range enclosing this type hierarchy item not including leading/trailing whitespace but everything else
81
+ * like comments. This information is typically used to determine if the clients cursor is inside the type
82
+ * hierarchy item to reveal in the symbol in the UI.
83
+ */
84
+ range: Range;
85
+ /**
86
+ * The range that should be selected and revealed when this type hierarchy item is being picked, e.g the name
87
+ * of a function. Must be contained by the `range`.
88
+ */
89
+ selectionRange: Range;
90
+ /**
91
+ * If this type hierarchy item is resolved, it contains the direct parents. Could be empty if the item does
92
+ * not have any direct parents. If not defined, the parents have not been resolved yet.
93
+ */
94
+ parents?: TypeHierarchyItem[];
95
+ /**
96
+ * If this type hierarchy item is resolved, it contains the direct children of the current item. Could be
97
+ * empty if the item does not have any descendants. If not defined, the children have not been resolved.
98
+ */
99
+ children?: TypeHierarchyItem[];
100
+ /**
101
+ * An optional data field can be used to identify a type hierarchy item in a resolve request.
102
+ */
103
+ data?: any;
104
+ }
105
+ //# sourceMappingURL=typehierarchy-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy-provider.d.ts","sourceRoot":"","sources":["../../src/browser/typehierarchy-provider.ts"],"names":[],"mappings":"AA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;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;OAIG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAE/B;;OAEG;IAEH,IAAI,CAAC,EAAE,GAAG,CAAC;CACd"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 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-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TypeHierarchyRegistry = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const disposable_1 = require("@theia/core/lib/common/disposable");
22
+ let TypeHierarchyRegistry = class TypeHierarchyRegistry {
23
+ constructor() {
24
+ this.providers = new Map();
25
+ }
26
+ async get(languageId) {
27
+ return languageId ? this.providers.get(languageId) : undefined;
28
+ }
29
+ register(provider) {
30
+ const { languageId } = provider;
31
+ if (this.providers.has(languageId)) {
32
+ throw new Error(`type hierarchy provider for '${languageId}' language is already registered`);
33
+ }
34
+ this.providers.set(languageId, provider);
35
+ return disposable_1.Disposable.create(() => this.providers.delete(languageId));
36
+ }
37
+ };
38
+ exports.TypeHierarchyRegistry = TypeHierarchyRegistry;
39
+ exports.TypeHierarchyRegistry = TypeHierarchyRegistry = tslib_1.__decorate([
40
+ (0, inversify_1.injectable)()
41
+ ], TypeHierarchyRegistry);
42
+ //# sourceMappingURL=typehierarchy-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy-provider.js","sourceRoot":"","sources":["../../src/browser/typehierarchy-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAA0D;AAC1D,kEAA+D;AAIxD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAA3B;QAEgB,cAAS,GAAG,IAAI,GAAG,EAAiC,CAAC;IAe5E,CAAC;IAbG,KAAK,CAAC,GAAG,CAAC,UAA8B;QACpC,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,CAAC;IAED,QAAQ,CAAC,QAA+B;QACpC,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;QAChC,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,gCAAgC,UAAU,kCAAkC,CAAC,CAAC;QAClG,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACzC,OAAO,uBAAU,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IACtE,CAAC;CAEJ,CAAA;AAjBY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAiBjC"}
@@ -0,0 +1,29 @@
1
+ import { CancellationToken } from '@theia/core';
2
+ import { ContributionProvider, Disposable, Emitter, Event } from '@theia/core/lib/common';
3
+ import URI from '@theia/core/lib/common/uri';
4
+ import { DocumentUri, Position } from '@theia/core/shared/vscode-languageserver-protocol';
5
+ import { LanguageSelector } from '@theia/editor/lib/common/language-selector';
6
+ import { TypeHierarchyItem } from './typehierarchy';
7
+ export declare const TypeHierarchyService: unique symbol;
8
+ export interface TypeHierarchySession {
9
+ items: TypeHierarchyItem[];
10
+ dispose(): void;
11
+ }
12
+ export interface TypeHierarchyService {
13
+ readonly selector: LanguageSelector;
14
+ prepareSession(uri: DocumentUri, position: Position, cancellationToken: CancellationToken): Promise<TypeHierarchySession | undefined>;
15
+ provideSuperTypes(sessionId: string, itemId: string, cancellationToken: CancellationToken): Promise<TypeHierarchyItem[] | undefined>;
16
+ provideSubTypes(sessionId: string, itemId: string, cancellationToken: CancellationToken): Promise<TypeHierarchyItem[] | undefined>;
17
+ }
18
+ export declare class TypeHierarchyServiceProvider {
19
+ protected readonly contributions: ContributionProvider<TypeHierarchyService>;
20
+ protected readonly onDidChangeEmitter: Emitter<void>;
21
+ get onDidChange(): Event<void>;
22
+ private services;
23
+ init(): void;
24
+ get(languageId: string, uri: URI): TypeHierarchyService | undefined;
25
+ protected score(service: TypeHierarchyService, languageId: string, uri: URI): number;
26
+ add(service: TypeHierarchyService): Disposable;
27
+ private remove;
28
+ }
29
+ //# sourceMappingURL=typehierarchy-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy-service.d.ts","sourceRoot":"","sources":["../../src/browser/typehierarchy-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,UAAU,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,EAAE,GAAG,GAAG,oBAAoB,GAAG,SAAS;IAMnE,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IAIpF,GAAG,CAAC,OAAO,EAAE,oBAAoB,GAAG,UAAU;IAW9C,OAAO,CAAC,MAAM;CASjB"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2022 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TypeHierarchyServiceProvider = exports.TypeHierarchyService = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const common_1 = require("@theia/core/lib/common");
21
+ const inversify_1 = require("@theia/core/shared/inversify");
22
+ const language_selector_1 = require("@theia/editor/lib/common/language-selector");
23
+ exports.TypeHierarchyService = Symbol('TypeHierarchyService');
24
+ let TypeHierarchyServiceProvider = class TypeHierarchyServiceProvider {
25
+ constructor() {
26
+ this.onDidChangeEmitter = new common_1.Emitter();
27
+ this.services = [];
28
+ }
29
+ get onDidChange() {
30
+ return this.onDidChangeEmitter.event;
31
+ }
32
+ init() {
33
+ this.services = this.services.concat(this.contributions.getContributions());
34
+ }
35
+ get(languageId, uri) {
36
+ return this.services
37
+ .filter(service => this.score(service, languageId, uri) > 0)
38
+ .sort((left, right) => this.score(right, languageId, uri) - this.score(left, languageId, uri))[0];
39
+ }
40
+ score(service, languageId, uri) {
41
+ return (0, language_selector_1.score)(service.selector, uri.scheme, uri.path.toString(), languageId, true);
42
+ }
43
+ add(service) {
44
+ this.services.push(service);
45
+ const that = this;
46
+ this.onDidChangeEmitter.fire();
47
+ return {
48
+ dispose: () => {
49
+ that.remove(service);
50
+ }
51
+ };
52
+ }
53
+ remove(service) {
54
+ const length = this.services.length;
55
+ this.services = this.services.filter(value => value !== service);
56
+ const serviceWasRemoved = length !== this.services.length;
57
+ if (serviceWasRemoved) {
58
+ this.onDidChangeEmitter.fire();
59
+ }
60
+ return serviceWasRemoved;
61
+ }
62
+ };
63
+ exports.TypeHierarchyServiceProvider = TypeHierarchyServiceProvider;
64
+ tslib_1.__decorate([
65
+ (0, inversify_1.inject)(common_1.ContributionProvider),
66
+ (0, inversify_1.named)(exports.TypeHierarchyService),
67
+ tslib_1.__metadata("design:type", Object)
68
+ ], TypeHierarchyServiceProvider.prototype, "contributions", void 0);
69
+ tslib_1.__decorate([
70
+ (0, inversify_1.postConstruct)(),
71
+ tslib_1.__metadata("design:type", Function),
72
+ tslib_1.__metadata("design:paramtypes", []),
73
+ tslib_1.__metadata("design:returntype", void 0)
74
+ ], TypeHierarchyServiceProvider.prototype, "init", null);
75
+ exports.TypeHierarchyServiceProvider = TypeHierarchyServiceProvider = tslib_1.__decorate([
76
+ (0, inversify_1.injectable)()
77
+ ], TypeHierarchyServiceProvider);
78
+ //# sourceMappingURL=typehierarchy-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy-service.js","sourceRoot":"","sources":["../../src/browser/typehierarchy-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;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AAC;QAClB,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;QAC/B,OAAO;YACH,OAAO,EAAE,GAAG,EAAE;gBACV,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACzB,CAAC;SACJ,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,OAA6B;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;QACjE,MAAM,iBAAiB,GAAG,MAAM,KAAK,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC1D,IAAI,iBAAiB,EAAE,CAAC;YACpB,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;QACnC,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ,CAAA;AA/CY,oEAA4B;AAGlB;IADlB,IAAA,kBAAM,EAAC,6BAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,4BAAoB,CAAC;;mEACmB;AAU7E;IADC,IAAA,yBAAa,GAAE;;;;wDAGf;uCAfQ,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CA+CxC"}
@@ -0,0 +1,14 @@
1
+ import { UriComponents } from '@theia/core/lib/common/uri';
2
+ import { Range, SymbolKind, SymbolTag } from '@theia/core/shared/vscode-languageserver-protocol';
3
+ export interface TypeHierarchyItem {
4
+ _sessionId?: string;
5
+ _itemId?: string;
6
+ kind: SymbolKind;
7
+ tags?: readonly SymbolTag[];
8
+ name: string;
9
+ detail?: string;
10
+ uri: UriComponents;
11
+ range: Range;
12
+ selectionRange: Range;
13
+ }
14
+ //# sourceMappingURL=typehierarchy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy.d.ts","sourceRoot":"","sources":["../../src/browser/typehierarchy.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mDAAmD,CAAC;AAEjG,MAAM,WAAW,iBAAiB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,aAAa,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACzB"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2022 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //# sourceMappingURL=typehierarchy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typehierarchy.js","sourceRoot":"","sources":["../../src/browser/typehierarchy.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=package.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
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
+ /* note: this bogus test file is required so that
17
+ we are able to run mocha unit tests on this
18
+ package, without having any actual unit tests in it.
19
+ This way a coverage report will be generated,
20
+ showing 0% coverage, instead of no report.
21
+ This file can be removed once we have real unit
22
+ tests in place. */
23
+ describe('typehierarchy package', () => {
24
+ it('support code coverage statistics', () => true);
25
+ });
26
+ //# sourceMappingURL=package.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;;;qBAMqB;AAErB,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IAEnC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AAEvD,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@theia/typehierarchy",
3
- "version": "1.67.0-next.56+d8f18cc386c",
3
+ "version": "1.67.0-next.86+03f92ff1d",
4
4
  "description": "Theia - Type Hierarchy Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.67.0-next.56+d8f18cc386c",
7
- "@theia/editor": "1.67.0-next.56+d8f18cc386c",
6
+ "@theia/core": "1.67.0-next.86+03f92ff1d",
7
+ "@theia/editor": "1.67.0-next.86+03f92ff1d",
8
8
  "tslib": "^2.6.2"
9
9
  },
10
10
  "publishConfig": {
@@ -45,5 +45,5 @@
45
45
  "nyc": {
46
46
  "extends": "../../configs/nyc.json"
47
47
  },
48
- "gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
48
+ "gitHead": "03f92ff1d97dcb199de39b48e60a53535de22808"
49
49
  }