@theia/editor 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 (149) hide show
  1. package/lib/browser/decorations/editor-decoration-style.d.ts +9 -0
  2. package/lib/browser/decorations/editor-decoration-style.d.ts.map +1 -0
  3. package/lib/browser/decorations/editor-decoration-style.js +37 -0
  4. package/lib/browser/decorations/editor-decoration-style.js.map +1 -0
  5. package/lib/browser/decorations/editor-decoration.d.ts +119 -0
  6. package/lib/browser/decorations/editor-decoration.d.ts.map +1 -0
  7. package/lib/browser/decorations/editor-decoration.js +38 -0
  8. package/lib/browser/decorations/editor-decoration.js.map +1 -0
  9. package/lib/browser/decorations/editor-decorator.d.ts +7 -0
  10. package/lib/browser/decorations/editor-decorator.d.ts.map +1 -0
  11. package/lib/browser/decorations/editor-decorator.js +39 -0
  12. package/lib/browser/decorations/editor-decorator.js.map +1 -0
  13. package/lib/browser/decorations/index.d.ts +4 -0
  14. package/lib/browser/decorations/index.d.ts.map +1 -0
  15. package/lib/browser/decorations/index.js +22 -0
  16. package/lib/browser/decorations/index.js.map +1 -0
  17. package/lib/browser/diff-navigator.d.ts +10 -0
  18. package/lib/browser/diff-navigator.d.ts.map +1 -0
  19. package/lib/browser/diff-navigator.js +20 -0
  20. package/lib/browser/diff-navigator.js.map +1 -0
  21. package/lib/browser/editor-command.d.ts +102 -0
  22. package/lib/browser/editor-command.d.ts.map +1 -0
  23. package/lib/browser/editor-command.js +402 -0
  24. package/lib/browser/editor-command.js.map +1 -0
  25. package/lib/browser/editor-contribution.d.ts +33 -0
  26. package/lib/browser/editor-contribution.d.ts.map +1 -0
  27. package/lib/browser/editor-contribution.js +222 -0
  28. package/lib/browser/editor-contribution.js.map +1 -0
  29. package/lib/browser/editor-frontend-module.d.ts +6 -0
  30. package/lib/browser/editor-frontend-module.d.ts.map +1 -0
  31. package/lib/browser/editor-frontend-module.js +88 -0
  32. package/lib/browser/editor-frontend-module.js.map +1 -0
  33. package/lib/browser/editor-keybinding.d.ts +6 -0
  34. package/lib/browser/editor-keybinding.d.ts.map +1 -0
  35. package/lib/browser/editor-keybinding.js +51 -0
  36. package/lib/browser/editor-keybinding.js.map +1 -0
  37. package/lib/browser/editor-language-quick-pick-service.d.ts +12 -0
  38. package/lib/browser/editor-language-quick-pick-service.d.ts.map +1 -0
  39. package/lib/browser/editor-language-quick-pick-service.js +77 -0
  40. package/lib/browser/editor-language-quick-pick-service.js.map +1 -0
  41. package/lib/browser/editor-linenumber-contribution.d.ts +16 -0
  42. package/lib/browser/editor-linenumber-contribution.d.ts.map +1 -0
  43. package/lib/browser/editor-linenumber-contribution.js +89 -0
  44. package/lib/browser/editor-linenumber-contribution.js.map +1 -0
  45. package/lib/browser/editor-manager.d.ts +135 -0
  46. package/lib/browser/editor-manager.d.ts.map +1 -0
  47. package/lib/browser/editor-manager.js +472 -0
  48. package/lib/browser/editor-manager.js.map +1 -0
  49. package/lib/browser/editor-menu.d.ts +51 -0
  50. package/lib/browser/editor-menu.d.ts.map +1 -0
  51. package/lib/browser/editor-menu.js +208 -0
  52. package/lib/browser/editor-menu.js.map +1 -0
  53. package/lib/browser/editor-navigation-contribution.d.ts +68 -0
  54. package/lib/browser/editor-navigation-contribution.d.ts.map +1 -0
  55. package/lib/browser/editor-navigation-contribution.js +324 -0
  56. package/lib/browser/editor-navigation-contribution.js.map +1 -0
  57. package/lib/browser/editor-variable-contribution.d.ts +9 -0
  58. package/lib/browser/editor-variable-contribution.d.ts.map +1 -0
  59. package/lib/browser/editor-variable-contribution.js +65 -0
  60. package/lib/browser/editor-variable-contribution.js.map +1 -0
  61. package/lib/browser/editor-widget-factory.d.ts +18 -0
  62. package/lib/browser/editor-widget-factory.d.ts.map +1 -0
  63. package/lib/browser/editor-widget-factory.js +84 -0
  64. package/lib/browser/editor-widget-factory.js.map +1 -0
  65. package/lib/browser/editor-widget.d.ts +28 -0
  66. package/lib/browser/editor-widget.d.ts.map +1 -0
  67. package/lib/browser/editor-widget.js +130 -0
  68. package/lib/browser/editor-widget.js.map +1 -0
  69. package/lib/browser/editor.d.ts +311 -0
  70. package/lib/browser/editor.d.ts.map +1 -0
  71. package/lib/browser/editor.js +104 -0
  72. package/lib/browser/editor.js.map +1 -0
  73. package/lib/browser/index.d.ts +12 -0
  74. package/lib/browser/index.d.ts.map +1 -0
  75. package/lib/browser/index.js +30 -0
  76. package/lib/browser/index.js.map +1 -0
  77. package/lib/browser/language-status/editor-language-status-service.d.ts +78 -0
  78. package/lib/browser/language-status/editor-language-status-service.d.ts.map +1 -0
  79. package/lib/browser/language-status/editor-language-status-service.js +244 -0
  80. package/lib/browser/language-status/editor-language-status-service.js.map +1 -0
  81. package/lib/browser/navigation/navigation-location-service.d.ts +132 -0
  82. package/lib/browser/navigation/navigation-location-service.d.ts.map +1 -0
  83. package/lib/browser/navigation/navigation-location-service.js +352 -0
  84. package/lib/browser/navigation/navigation-location-service.js.map +1 -0
  85. package/lib/browser/navigation/navigation-location-service.spec.d.ts +2 -0
  86. package/lib/browser/navigation/navigation-location-service.spec.d.ts.map +1 -0
  87. package/lib/browser/navigation/navigation-location-service.spec.js +185 -0
  88. package/lib/browser/navigation/navigation-location-service.spec.js.map +1 -0
  89. package/lib/browser/navigation/navigation-location-similarity.d.ts +16 -0
  90. package/lib/browser/navigation/navigation-location-similarity.d.ts.map +1 -0
  91. package/lib/browser/navigation/navigation-location-similarity.js +58 -0
  92. package/lib/browser/navigation/navigation-location-similarity.js.map +1 -0
  93. package/lib/browser/navigation/navigation-location-similarity.spec.d.ts +2 -0
  94. package/lib/browser/navigation/navigation-location-similarity.spec.d.ts.map +1 -0
  95. package/lib/browser/navigation/navigation-location-similarity.spec.js +33 -0
  96. package/lib/browser/navigation/navigation-location-similarity.spec.js.map +1 -0
  97. package/lib/browser/navigation/navigation-location-updater.d.ts +36 -0
  98. package/lib/browser/navigation/navigation-location-updater.d.ts.map +1 -0
  99. package/lib/browser/navigation/navigation-location-updater.js +206 -0
  100. package/lib/browser/navigation/navigation-location-updater.js.map +1 -0
  101. package/lib/browser/navigation/navigation-location-updater.spec.d.ts +2 -0
  102. package/lib/browser/navigation/navigation-location-updater.spec.d.ts.map +1 -0
  103. package/lib/browser/navigation/navigation-location-updater.spec.js +178 -0
  104. package/lib/browser/navigation/navigation-location-updater.spec.js.map +1 -0
  105. package/lib/browser/navigation/navigation-location.d.ts +192 -0
  106. package/lib/browser/navigation/navigation-location.d.ts.map +1 -0
  107. package/lib/browser/navigation/navigation-location.js +301 -0
  108. package/lib/browser/navigation/navigation-location.js.map +1 -0
  109. package/lib/browser/navigation/test/mock-navigation-location-updater.d.ts +16 -0
  110. package/lib/browser/navigation/test/mock-navigation-location-updater.d.ts.map +1 -0
  111. package/lib/browser/navigation/test/mock-navigation-location-updater.js +39 -0
  112. package/lib/browser/navigation/test/mock-navigation-location-updater.js.map +1 -0
  113. package/lib/browser/quick-editor-service.d.ts +17 -0
  114. package/lib/browser/quick-editor-service.d.ts.map +1 -0
  115. package/lib/browser/quick-editor-service.js +102 -0
  116. package/lib/browser/quick-editor-service.js.map +1 -0
  117. package/lib/browser/split-editor-contribution.d.ts +27 -0
  118. package/lib/browser/split-editor-contribution.d.ts.map +1 -0
  119. package/lib/browser/split-editor-contribution.js +23 -0
  120. package/lib/browser/split-editor-contribution.js.map +1 -0
  121. package/lib/browser/text-editor-split-contribution.d.ts +13 -0
  122. package/lib/browser/text-editor-split-contribution.d.ts.map +1 -0
  123. package/lib/browser/text-editor-split-contribution.js +50 -0
  124. package/lib/browser/text-editor-split-contribution.js.map +1 -0
  125. package/lib/browser/undo-redo-service.d.ts +24 -0
  126. package/lib/browser/undo-redo-service.d.ts.map +1 -0
  127. package/lib/browser/undo-redo-service.js +106 -0
  128. package/lib/browser/undo-redo-service.js.map +1 -0
  129. package/lib/common/editor-generated-preference-schema.d.ts +303 -0
  130. package/lib/common/editor-generated-preference-schema.d.ts.map +1 -0
  131. package/lib/common/editor-generated-preference-schema.js +2666 -0
  132. package/lib/common/editor-generated-preference-schema.js.map +1 -0
  133. package/lib/common/editor-preferences.d.ts +42 -0
  134. package/lib/common/editor-preferences.d.ts.map +1 -0
  135. package/lib/common/editor-preferences.js +179 -0
  136. package/lib/common/editor-preferences.js.map +1 -0
  137. package/lib/common/language-selector.d.ts +14 -0
  138. package/lib/common/language-selector.d.ts.map +1 -0
  139. package/lib/common/language-selector.js +91 -0
  140. package/lib/common/language-selector.js.map +1 -0
  141. package/lib/node/editor-backend-module.d.ts +4 -0
  142. package/lib/node/editor-backend-module.d.ts.map +1 -0
  143. package/lib/node/editor-backend-module.js +23 -0
  144. package/lib/node/editor-backend-module.js.map +1 -0
  145. package/lib/package.spec.d.ts +1 -0
  146. package/lib/package.spec.d.ts.map +1 -0
  147. package/lib/package.spec.js +26 -0
  148. package/lib/package.spec.js.map +1 -0
  149. package/package.json +4 -4
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2021 SAP SE or an SAP affiliate company 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
+ var QuickEditorService_1;
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.QuickEditorService = void 0;
20
+ const tslib_1 = require("tslib");
21
+ const inversify_1 = require("@theia/core/shared/inversify");
22
+ const common_1 = require("@theia/core/lib/common");
23
+ const label_provider_1 = require("@theia/core/lib/browser/label-provider");
24
+ const quick_access_1 = require("@theia/core/lib/browser/quick-input/quick-access");
25
+ const quick_input_service_1 = require("@theia/core/lib/browser/quick-input/quick-input-service");
26
+ const browser_1 = require("@theia/core/lib/browser");
27
+ let QuickEditorService = QuickEditorService_1 = class QuickEditorService {
28
+ constructor() {
29
+ this.groupLocalizations = [];
30
+ }
31
+ registerQuickAccessProvider() {
32
+ this.quickAccessRegistry.registerQuickAccessProvider({
33
+ getInstance: () => this,
34
+ prefix: QuickEditorService_1.PREFIX,
35
+ placeholder: '',
36
+ helpEntries: [{ description: 'Show All Opened Editors', needsEditor: false }]
37
+ });
38
+ }
39
+ getPicks(filter, token) {
40
+ const editorItems = [];
41
+ const hasUri = (widget) => Boolean(browser_1.NavigatableWidget.getUri(widget));
42
+ const handleWidgets = (widgets, label) => {
43
+ if (widgets.length) {
44
+ editorItems.push({ type: 'separator', label });
45
+ }
46
+ editorItems.push(...widgets.map(widget => this.toItem(widget)));
47
+ };
48
+ const handleSplittableArea = (tabbars, labelPrefix) => {
49
+ tabbars.forEach((tabbar, index) => {
50
+ const editorsOnTabbar = tabbar.titles.reduce((widgets, title) => {
51
+ if (hasUri(title.owner)) {
52
+ widgets.push(title.owner);
53
+ }
54
+ return widgets;
55
+ }, []);
56
+ const label = tabbars.length > 1 ? `${labelPrefix} ${this.getGroupLocalization(index)}` : labelPrefix;
57
+ handleWidgets(editorsOnTabbar, label);
58
+ });
59
+ };
60
+ handleSplittableArea(this.shell.mainAreaTabBars, browser_1.ApplicationShell.areaLabels.main);
61
+ handleSplittableArea(this.shell.bottomAreaTabBars, browser_1.ApplicationShell.areaLabels.bottom);
62
+ for (const area of ['left', 'right']) {
63
+ const editorsInArea = this.shell.getWidgets(area).filter(hasUri);
64
+ handleWidgets(editorsInArea, browser_1.ApplicationShell.areaLabels[area]);
65
+ }
66
+ return (0, quick_input_service_1.filterItems)(editorItems.slice(), filter);
67
+ }
68
+ getGroupLocalization(index) {
69
+ return this.groupLocalizations[index] || common_1.nls.localizeByDefault('Group {0}', index + 1);
70
+ }
71
+ toItem(widget) {
72
+ const uri = browser_1.NavigatableWidget.getUri(widget);
73
+ const icon = this.labelProvider.getIcon(uri);
74
+ const iconClasses = icon ? icon.split(' ').concat('file-icon') : [];
75
+ return {
76
+ label: this.labelProvider.getName(uri),
77
+ description: this.labelProvider.getDetails(uri),
78
+ iconClasses,
79
+ ariaLabel: uri.path.fsPath(),
80
+ alwaysShow: true,
81
+ execute: () => this.shell.activateWidget(widget.id),
82
+ };
83
+ }
84
+ };
85
+ exports.QuickEditorService = QuickEditorService;
86
+ QuickEditorService.PREFIX = 'edt ';
87
+ tslib_1.__decorate([
88
+ (0, inversify_1.inject)(label_provider_1.LabelProvider),
89
+ tslib_1.__metadata("design:type", label_provider_1.LabelProvider)
90
+ ], QuickEditorService.prototype, "labelProvider", void 0);
91
+ tslib_1.__decorate([
92
+ (0, inversify_1.inject)(quick_access_1.QuickAccessRegistry),
93
+ tslib_1.__metadata("design:type", Object)
94
+ ], QuickEditorService.prototype, "quickAccessRegistry", void 0);
95
+ tslib_1.__decorate([
96
+ (0, inversify_1.inject)(browser_1.ApplicationShell),
97
+ tslib_1.__metadata("design:type", browser_1.ApplicationShell)
98
+ ], QuickEditorService.prototype, "shell", void 0);
99
+ exports.QuickEditorService = QuickEditorService = QuickEditorService_1 = tslib_1.__decorate([
100
+ (0, inversify_1.injectable)()
101
+ ], QuickEditorService);
102
+ //# sourceMappingURL=quick-editor-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quick-editor-service.js","sourceRoot":"","sources":["../../src/browser/quick-editor-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oEAAoE;AACpE,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,4DAAkE;AAClE,mDAA0F;AAC1F,2EAAuE;AACvE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,MAAM,CAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7C,MAAM,WAAW,GAAa,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9E,OAAO;YACH,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC;YACtC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC;YAC/C,WAAW;YACX,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE;YAC5B,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;SACtD,CAAC;IACN,CAAC;;AApEQ,gDAAkB;AACpB,yBAAM,GAAG,MAAM,AAAT,CAAU;AAEmB;IAAzC,IAAA,kBAAM,EAAC,8BAAa,CAAC;sCAAmC,8BAAa;yDAAC;AACvB;IAA/C,IAAA,kBAAM,EAAC,kCAAmB,CAAC;;+DAA6D;AAC5C;IAA5C,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCAA2B,0BAAgB;iDAAC;6BAL5D,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CAqE9B"}
@@ -0,0 +1,27 @@
1
+ import { Widget, DockLayout } from '@theia/core/lib/browser';
2
+ /**
3
+ * Symbol used to bind SplitEditorContribution implementations.
4
+ */
5
+ export declare const SplitEditorContribution: unique symbol;
6
+ /**
7
+ * A contribution interface for handling split operations on different editor types.
8
+ * Implementations should handle specific editor widget types (e.g., text editors, notebook editors).
9
+ *
10
+ * @template W the specific widget type this contribution handles
11
+ */
12
+ export interface SplitEditorContribution<W extends Widget = Widget> {
13
+ /**
14
+ * Determines whether this contribution can handle the split operation for the given widget.
15
+ * @param widget the widget to check
16
+ * @returns a priority number (higher means higher priority), or 0 if this contribution cannot handle the widget
17
+ */
18
+ canHandle(widget: Widget): number;
19
+ /**
20
+ * Splits the given widget according to the specified split mode.
21
+ * @param widget the widget to split
22
+ * @param splitMode the direction in which to split
23
+ * @returns the newly created widget, or undefined if the split operation failed
24
+ */
25
+ split(widget: W, splitMode: DockLayout.InsertMode): Promise<W | undefined>;
26
+ }
27
+ //# sourceMappingURL=split-editor-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-editor-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/split-editor-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,uBAAuB,eAAoC,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC9D;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;CAC9E"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 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.SplitEditorContribution = void 0;
19
+ /**
20
+ * Symbol used to bind SplitEditorContribution implementations.
21
+ */
22
+ exports.SplitEditorContribution = Symbol('SplitEditorContribution');
23
+ //# sourceMappingURL=split-editor-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-editor-contribution.js","sourceRoot":"","sources":["../../src/browser/split-editor-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;;;AAIhF;;GAEG;AACU,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Widget, DockLayout } from '@theia/core/lib/browser';
2
+ import { SplitEditorContribution } from './split-editor-contribution';
3
+ import { EditorWidget } from './editor-widget';
4
+ import { EditorManager } from './editor-manager';
5
+ /**
6
+ * Implementation of SplitEditorContribution for text editors (EditorWidget).
7
+ */
8
+ export declare class TextEditorSplitContribution implements SplitEditorContribution<EditorWidget> {
9
+ protected readonly editorManager: EditorManager;
10
+ canHandle(widget: Widget): number;
11
+ split(widget: EditorWidget, splitMode: DockLayout.InsertMode): Promise<EditorWidget | undefined>;
12
+ }
13
+ //# sourceMappingURL=text-editor-split-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-editor-split-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/text-editor-split-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;GAEG;AACH,qBACa,2BAA4B,YAAW,uBAAuB,CAAC,YAAY,CAAC;IAGrF,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEhD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI3B,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;CAazG"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 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.TextEditorSplitContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const editor_widget_1 = require("./editor-widget");
22
+ const editor_manager_1 = require("./editor-manager");
23
+ /**
24
+ * Implementation of SplitEditorContribution for text editors (EditorWidget).
25
+ */
26
+ let TextEditorSplitContribution = class TextEditorSplitContribution {
27
+ canHandle(widget) {
28
+ return widget instanceof editor_widget_1.EditorWidget ? 100 : 0;
29
+ }
30
+ async split(widget, splitMode) {
31
+ const selection = widget.editor.selection;
32
+ const newEditor = await this.editorManager.openToSide(widget.editor.uri, {
33
+ selection,
34
+ widgetOptions: { mode: splitMode, ref: widget }
35
+ });
36
+ // Preserve the view state (scroll position, etc.) from the original editor
37
+ const oldEditorState = widget.editor.storeViewState();
38
+ newEditor.editor.restoreViewState(oldEditorState);
39
+ return newEditor;
40
+ }
41
+ };
42
+ exports.TextEditorSplitContribution = TextEditorSplitContribution;
43
+ tslib_1.__decorate([
44
+ (0, inversify_1.inject)(editor_manager_1.EditorManager),
45
+ tslib_1.__metadata("design:type", editor_manager_1.EditorManager)
46
+ ], TextEditorSplitContribution.prototype, "editorManager", void 0);
47
+ exports.TextEditorSplitContribution = TextEditorSplitContribution = tslib_1.__decorate([
48
+ (0, inversify_1.injectable)()
49
+ ], TextEditorSplitContribution);
50
+ //# sourceMappingURL=text-editor-split-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-editor-split-contribution.js","sourceRoot":"","sources":["../../src/browser/text-editor-split-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,4DAAkE;AAGlE,mDAA+C;AAC/C,qDAAiD;AAEjD;;GAEG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAKpC,SAAS,CAAC,MAAc;QACpB,OAAO,MAAM,YAAY,4BAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,MAAoB,EAAE,SAAgC;QAC9D,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QAC1C,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACrE,SAAS;YACT,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE;SAClD,CAAC,CAAC;QAEH,2EAA2E;QAC3E,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QACtD,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAElD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ,CAAA;AAtBY,kEAA2B;AAGjB;IADlB,IAAA,kBAAM,EAAC,8BAAa,CAAC;sCACY,8BAAa;kEAAC;sCAHvC,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CAsBvC"}
@@ -0,0 +1,24 @@
1
+ import URI from '@theia/core/lib/common/uri';
2
+ export declare class UndoRedoService {
3
+ private readonly editStacks;
4
+ pushElement(resource: URI, undo: () => Promise<void>, redo: () => Promise<void>): void;
5
+ removeElements(resource: URI): void;
6
+ undo(resource: URI): void;
7
+ redo(resource: URI): void;
8
+ }
9
+ interface StackElement {
10
+ undo(): Promise<void> | void;
11
+ redo(): Promise<void> | void;
12
+ }
13
+ export declare class ResourceEditStack {
14
+ private past;
15
+ private future;
16
+ constructor();
17
+ pushElement(element: StackElement): void;
18
+ getClosestPastElement(): StackElement | undefined;
19
+ getClosestFutureElement(): StackElement | undefined;
20
+ moveBackward(element: StackElement): void;
21
+ moveForward(element: StackElement): void;
22
+ }
23
+ export {};
24
+ //# sourceMappingURL=undo-redo-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undo-redo-service.d.ts","sourceRoot":"","sources":["../../src/browser/undo-redo-service.ts"],"names":[],"mappings":"AAsBA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,qBACa,eAAe;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAwC;IAEnE,WAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAYtF,cAAc,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI;IAMnC,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI;IAezB,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI;CAc5B;AAED,UAAU,YAAY;IAClB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAChC;AAED,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,MAAM,CAAiB;;IAO/B,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAKxC,qBAAqB,IAAI,YAAY,GAAG,SAAS;IAOjD,uBAAuB,IAAI,YAAY,GAAG,SAAS;IAOnD,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAKzC,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;CAI3C"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2021 SAP SE or an SAP affiliate company 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
+ /*---------------------------------------------------------------------------------------------
18
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19
+ * Licensed under the MIT License. See License.txt in the project root for license information.
20
+ *--------------------------------------------------------------------------------------------*/
21
+ // copied and modified from https://github.com/microsoft/vscode/blob/53eac52308c4611000a171cc7bf1214293473c78/src/vs/platform/undoRedo/common/undoRedoService.ts#
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.ResourceEditStack = exports.UndoRedoService = void 0;
24
+ const tslib_1 = require("tslib");
25
+ const inversify_1 = require("@theia/core/shared/inversify");
26
+ let UndoRedoService = class UndoRedoService {
27
+ constructor() {
28
+ this.editStacks = new Map();
29
+ }
30
+ pushElement(resource, undo, redo) {
31
+ let editStack;
32
+ if (this.editStacks.has(resource.toString())) {
33
+ editStack = this.editStacks.get(resource.toString());
34
+ }
35
+ else {
36
+ editStack = new ResourceEditStack();
37
+ this.editStacks.set(resource.toString(), editStack);
38
+ }
39
+ editStack.pushElement({ undo, redo });
40
+ }
41
+ removeElements(resource) {
42
+ if (this.editStacks.has(resource.toString())) {
43
+ this.editStacks.delete(resource.toString());
44
+ }
45
+ }
46
+ undo(resource) {
47
+ if (!this.editStacks.has(resource.toString())) {
48
+ return;
49
+ }
50
+ const editStack = this.editStacks.get(resource.toString());
51
+ const element = editStack.getClosestPastElement();
52
+ if (!element) {
53
+ return;
54
+ }
55
+ editStack.moveBackward(element);
56
+ element.undo();
57
+ }
58
+ redo(resource) {
59
+ if (!this.editStacks.has(resource.toString())) {
60
+ return;
61
+ }
62
+ const editStack = this.editStacks.get(resource.toString());
63
+ const element = editStack.getClosestFutureElement();
64
+ if (!element) {
65
+ return;
66
+ }
67
+ editStack.moveForward(element);
68
+ element.redo();
69
+ }
70
+ };
71
+ exports.UndoRedoService = UndoRedoService;
72
+ exports.UndoRedoService = UndoRedoService = tslib_1.__decorate([
73
+ (0, inversify_1.injectable)()
74
+ ], UndoRedoService);
75
+ class ResourceEditStack {
76
+ constructor() {
77
+ this.past = [];
78
+ this.future = [];
79
+ }
80
+ pushElement(element) {
81
+ this.future = [];
82
+ this.past.push(element);
83
+ }
84
+ getClosestPastElement() {
85
+ if (this.past.length === 0) {
86
+ return undefined;
87
+ }
88
+ return this.past[this.past.length - 1];
89
+ }
90
+ getClosestFutureElement() {
91
+ if (this.future.length === 0) {
92
+ return undefined;
93
+ }
94
+ return this.future[this.future.length - 1];
95
+ }
96
+ moveBackward(element) {
97
+ this.past.pop();
98
+ this.future.push(element);
99
+ }
100
+ moveForward(element) {
101
+ this.future.pop();
102
+ this.past.push(element);
103
+ }
104
+ }
105
+ exports.ResourceEditStack = ResourceEditStack;
106
+ //# sourceMappingURL=undo-redo-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undo-redo-service.js","sourceRoot":"","sources":["../../src/browser/undo-redo-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oEAAoE;AACpE,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;;;gGAGgG;AAChG,iKAAiK;;;;AAEjK,4DAA0D;AAInD,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QACc,eAAU,GAAG,IAAI,GAAG,EAA6B,CAAC;IAiDvE,CAAC;IA/CG,WAAW,CAAC,QAAa,EAAE,IAAyB,EAAE,IAAyB;QAC3E,IAAI,SAA4B,CAAC;QACjC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;YAC3C,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAE,CAAC;QAC1D,CAAC;aAAM,CAAC;YACJ,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;YACpC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC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