@opensumi/ide-editor 2.15.9 → 2.16.0
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/lib/browser/breadcrumb/default.d.ts.map +1 -1
- package/lib/browser/breadcrumb/default.js.map +1 -1
- package/lib/browser/breadcrumb/document-symbol.d.ts +1 -1
- package/lib/browser/breadcrumb/document-symbol.d.ts.map +1 -1
- package/lib/browser/breadcrumb/document-symbol.js +4 -4
- package/lib/browser/breadcrumb/document-symbol.js.map +1 -1
- package/lib/browser/breadcrumb/index.d.ts +2 -2
- package/lib/browser/breadcrumb/index.d.ts.map +1 -1
- package/lib/browser/breadcrumb/index.js.map +1 -1
- package/lib/browser/component/scroll/scroll.d.ts.map +1 -1
- package/lib/browser/component/scroll/scroll.js +1 -1
- package/lib/browser/component/scroll/scroll.js.map +1 -1
- package/lib/browser/component.d.ts +1 -1
- package/lib/browser/component.d.ts.map +1 -1
- package/lib/browser/component.js +3 -3
- package/lib/browser/component.js.map +1 -1
- package/lib/browser/decoration-applier.d.ts +1 -1
- package/lib/browser/decoration-applier.d.ts.map +1 -1
- package/lib/browser/decoration-applier.js +1 -1
- package/lib/browser/decoration-applier.js.map +1 -1
- package/lib/browser/diff/compare.d.ts +1 -1
- package/lib/browser/diff/compare.d.ts.map +1 -1
- package/lib/browser/diff/compare.js +1 -1
- package/lib/browser/diff/compare.js.map +1 -1
- package/lib/browser/diff/index.d.ts +1 -1
- package/lib/browser/diff/index.d.ts.map +1 -1
- package/lib/browser/diff/index.js +2 -2
- package/lib/browser/diff/index.js.map +1 -1
- package/lib/browser/doc-cache/empty-doc-cache.d.ts.map +1 -1
- package/lib/browser/doc-cache/empty-doc-cache.js.map +1 -1
- package/lib/browser/doc-cache/local-storage-cache.d.ts.map +1 -1
- package/lib/browser/doc-cache/local-storage-cache.js +1 -1
- package/lib/browser/doc-cache/local-storage-cache.js.map +1 -1
- package/lib/browser/doc-model/editor-document-model-service.d.ts +3 -3
- package/lib/browser/doc-model/editor-document-model-service.d.ts.map +1 -1
- package/lib/browser/doc-model/editor-document-model-service.js +4 -4
- package/lib/browser/doc-model/editor-document-model-service.js.map +1 -1
- package/lib/browser/doc-model/editor-document-model.d.ts +2 -2
- package/lib/browser/doc-model/editor-document-model.d.ts.map +1 -1
- package/lib/browser/doc-model/editor-document-model.js +21 -21
- package/lib/browser/doc-model/editor-document-model.js.map +1 -1
- package/lib/browser/doc-model/override.d.ts +1 -1
- package/lib/browser/doc-model/override.d.ts.map +1 -1
- package/lib/browser/doc-model/override.js.map +1 -1
- package/lib/browser/doc-model/save-task.d.ts.map +1 -1
- package/lib/browser/doc-model/save-task.js.map +1 -1
- package/lib/browser/doc-model/saveParticipants.d.ts.map +1 -1
- package/lib/browser/doc-model/saveParticipants.js +10 -10
- package/lib/browser/doc-model/saveParticipants.js.map +1 -1
- package/lib/browser/doc-model/types.d.ts +2 -2
- package/lib/browser/doc-model/types.d.ts.map +1 -1
- package/lib/browser/doc-model/types.js.map +1 -1
- package/lib/browser/editor-collection.service.d.ts +9 -9
- package/lib/browser/editor-collection.service.d.ts.map +1 -1
- package/lib/browser/editor-collection.service.js +6 -6
- package/lib/browser/editor-collection.service.js.map +1 -1
- package/lib/browser/editor-opener.d.ts.map +1 -1
- package/lib/browser/editor-opener.js.map +1 -1
- package/lib/browser/editor.contribution.d.ts +3 -2
- package/lib/browser/editor.contribution.d.ts.map +1 -1
- package/lib/browser/editor.contribution.js +31 -18
- package/lib/browser/editor.contribution.js.map +1 -1
- package/lib/browser/editor.decoration.service.d.ts +3 -3
- package/lib/browser/editor.decoration.service.d.ts.map +1 -1
- package/lib/browser/editor.decoration.service.js +2 -2
- package/lib/browser/editor.decoration.service.js.map +1 -1
- package/lib/browser/editor.module.less +6 -1
- package/lib/browser/editor.override.d.ts +2 -2
- package/lib/browser/editor.override.d.ts.map +1 -1
- package/lib/browser/editor.override.js +6 -6
- package/lib/browser/editor.override.js.map +1 -1
- package/lib/browser/editor.status-bar.service.d.ts +1 -1
- package/lib/browser/editor.status-bar.service.d.ts.map +1 -1
- package/lib/browser/editor.status-bar.service.js +3 -1
- package/lib/browser/editor.status-bar.service.js.map +1 -1
- package/lib/browser/editor.view.d.ts +1 -1
- package/lib/browser/editor.view.d.ts.map +1 -1
- package/lib/browser/editor.view.js +6 -6
- package/lib/browser/editor.view.js.map +1 -1
- package/lib/browser/feature.d.ts +1 -1
- package/lib/browser/feature.d.ts.map +1 -1
- package/lib/browser/feature.js.map +1 -1
- package/lib/browser/format/formatterSelect.d.ts +1 -1
- package/lib/browser/format/formatterSelect.d.ts.map +1 -1
- package/lib/browser/format/formatterSelect.js +3 -5
- package/lib/browser/format/formatterSelect.js.map +1 -1
- package/lib/browser/fs-resource/fs-editor-doc.d.ts +2 -2
- package/lib/browser/fs-resource/fs-editor-doc.d.ts.map +1 -1
- package/lib/browser/fs-resource/fs-editor-doc.js +1 -1
- package/lib/browser/fs-resource/fs-editor-doc.js.map +1 -1
- package/lib/browser/fs-resource/fs-resource.d.ts +1 -1
- package/lib/browser/fs-resource/fs-resource.d.ts.map +1 -1
- package/lib/browser/fs-resource/fs-resource.js +11 -11
- package/lib/browser/fs-resource/fs-resource.js.map +1 -1
- package/lib/browser/fs-resource/index.d.ts +2 -2
- package/lib/browser/fs-resource/index.d.ts.map +1 -1
- package/lib/browser/fs-resource/index.js +2 -2
- package/lib/browser/fs-resource/index.js.map +1 -1
- package/lib/browser/grid/grid.service.d.ts +4 -2
- package/lib/browser/grid/grid.service.d.ts.map +1 -1
- package/lib/browser/grid/grid.service.js +8 -1
- package/lib/browser/grid/grid.service.js.map +1 -1
- package/lib/browser/history/index.d.ts +1 -1
- package/lib/browser/history/index.d.ts.map +1 -1
- package/lib/browser/history/index.js +1 -1
- package/lib/browser/history/index.js.map +1 -1
- package/lib/browser/index.d.ts +4 -4
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +40 -40
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/language/diagnostic-collection.d.ts +1 -1
- package/lib/browser/language/diagnostic-collection.d.ts.map +1 -1
- package/lib/browser/language/diagnostic-collection.js +3 -1
- package/lib/browser/language/diagnostic-collection.js.map +1 -1
- package/lib/browser/language/language-status.contribution.d.ts.map +1 -1
- package/lib/browser/language/language-status.contribution.js.map +1 -1
- package/lib/browser/language/language-status.service.d.ts +1 -1
- package/lib/browser/language/language-status.service.d.ts.map +1 -1
- package/lib/browser/language/language-status.service.js.map +1 -1
- package/lib/browser/language/language.service.d.ts +2 -2
- package/lib/browser/language/language.service.d.ts.map +1 -1
- package/lib/browser/language/language.service.js +2 -2
- package/lib/browser/language/language.service.js.map +1 -1
- package/lib/browser/menu/editor.context.d.ts.map +1 -1
- package/lib/browser/menu/editor.context.js +3 -3
- package/lib/browser/menu/editor.context.js.map +1 -1
- package/lib/browser/menu/editor.menu.d.ts +2 -2
- package/lib/browser/menu/editor.menu.d.ts.map +1 -1
- package/lib/browser/menu/editor.menu.js.map +1 -1
- package/lib/browser/menu/title-context.menu.d.ts +1 -1
- package/lib/browser/menu/title-context.menu.d.ts.map +1 -1
- package/lib/browser/menu/title-context.menu.js +2 -2
- package/lib/browser/menu/title-context.menu.js.map +1 -1
- package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.contribution.d.ts.map +1 -1
- package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.contribution.js.map +1 -1
- package/lib/browser/monaco-contrib/command/command.service.d.ts.map +1 -1
- package/lib/browser/monaco-contrib/command/command.service.js +2 -1
- package/lib/browser/monaco-contrib/command/command.service.js.map +1 -1
- package/lib/browser/monaco-contrib/tokenizer/textmate-registry.d.ts.map +1 -1
- package/lib/browser/monaco-contrib/tokenizer/textmate-registry.js.map +1 -1
- package/lib/browser/monaco-contrib/tokenizer/textmate-tokenizer.d.ts +1 -1
- package/lib/browser/monaco-contrib/tokenizer/textmate-tokenizer.d.ts.map +1 -1
- package/lib/browser/monaco-contrib/tokenizer/textmate-tokenizer.js +1 -1
- package/lib/browser/monaco-contrib/tokenizer/textmate-tokenizer.js.map +1 -1
- package/lib/browser/monaco-contrib/tokenizer/textmate.service.d.ts +3 -3
- package/lib/browser/monaco-contrib/tokenizer/textmate.service.d.ts.map +1 -1
- package/lib/browser/monaco-contrib/tokenizer/textmate.service.js +6 -6
- package/lib/browser/monaco-contrib/tokenizer/textmate.service.js.map +1 -1
- package/lib/browser/navigation.module.less +8 -5
- package/lib/browser/navigation.view.d.ts.map +1 -1
- package/lib/browser/navigation.view.js +7 -7
- package/lib/browser/navigation.view.js.map +1 -1
- package/lib/browser/preference/contribution.d.ts.map +1 -1
- package/lib/browser/preference/contribution.js.map +1 -1
- package/lib/browser/preference/converter.d.ts +1 -1
- package/lib/browser/preference/converter.d.ts.map +1 -1
- package/lib/browser/preference/converter.js.map +1 -1
- package/lib/browser/preference/util.d.ts.map +1 -1
- package/lib/browser/preference/util.js.map +1 -1
- package/lib/browser/quick-open/go-to-line.d.ts +33 -0
- package/lib/browser/quick-open/go-to-line.d.ts.map +1 -0
- package/lib/browser/quick-open/go-to-line.js +147 -0
- package/lib/browser/quick-open/go-to-line.js.map +1 -0
- package/lib/browser/{language → quick-open}/workspace-symbol-quickopen.d.ts +2 -2
- package/lib/browser/quick-open/workspace-symbol-quickopen.d.ts.map +1 -0
- package/lib/browser/{language → quick-open}/workspace-symbol-quickopen.js +3 -3
- package/lib/browser/quick-open/workspace-symbol-quickopen.js.map +1 -0
- package/lib/browser/resource.service.d.ts +1 -1
- package/lib/browser/resource.service.d.ts.map +1 -1
- package/lib/browser/resource.service.js +2 -2
- package/lib/browser/resource.service.js.map +1 -1
- package/lib/browser/tab.view.d.ts.map +1 -1
- package/lib/browser/tab.view.js +6 -6
- package/lib/browser/tab.view.js.map +1 -1
- package/lib/browser/types.d.ts +3 -3
- package/lib/browser/types.d.ts.map +1 -1
- package/lib/browser/types.js.map +1 -1
- package/lib/browser/untitled-resource.d.ts.map +1 -1
- package/lib/browser/untitled-resource.js.map +1 -1
- package/lib/browser/view/editor.react.d.ts.map +1 -1
- package/lib/browser/view/editor.react.js.map +1 -1
- package/lib/browser/view/react-hook.d.ts.map +1 -1
- package/lib/browser/view/react-hook.js.map +1 -1
- package/lib/browser/view/suggest-widget.d.ts +1 -1
- package/lib/browser/view/suggest-widget.d.ts.map +1 -1
- package/lib/browser/view/suggest-widget.js +2 -2
- package/lib/browser/view/suggest-widget.js.map +1 -1
- package/lib/browser/view/topPadding.d.ts +1 -1
- package/lib/browser/view/topPadding.d.ts.map +1 -1
- package/lib/browser/view/topPadding.js.map +1 -1
- package/lib/browser/workbench-editor.service.d.ts +5 -4
- package/lib/browser/workbench-editor.service.d.ts.map +1 -1
- package/lib/browser/workbench-editor.service.js +96 -91
- package/lib/browser/workbench-editor.service.js.map +1 -1
- package/lib/common/doc-cache.d.ts +1 -1
- package/lib/common/doc-cache.d.ts.map +1 -1
- package/lib/common/doc-cache.js.map +1 -1
- package/lib/common/editor.d.ts +4 -4
- package/lib/common/editor.d.ts.map +1 -1
- package/lib/common/editor.js.map +1 -1
- package/lib/common/language-status.d.ts +1 -1
- package/lib/common/language-status.d.ts.map +1 -1
- package/lib/common/language-status.js.map +1 -1
- package/lib/common/language.d.ts +3 -3
- package/lib/common/language.d.ts.map +1 -1
- package/lib/common/language.js +1 -1
- package/lib/common/language.js.map +1 -1
- package/lib/common/mocks/workbench-editor.service.d.ts +2 -2
- package/lib/common/mocks/workbench-editor.service.d.ts.map +1 -1
- package/lib/common/mocks/workbench-editor.service.js +2 -2
- package/lib/common/mocks/workbench-editor.service.js.map +1 -1
- package/package.json +12 -12
- package/lib/browser/language/workspace-symbol-quickopen.d.ts.map +0 -1
- package/lib/browser/language/workspace-symbol-quickopen.js.map +0 -1
|
@@ -2,41 +2,41 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EditorGroup = exports.WorkbenchEditorServiceImpl = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const monaco = tslib_1.__importStar(require("@opensumi/monaco-editor-core/esm/vs/editor/editor.api"));
|
|
6
5
|
const mobx_1 = require("mobx");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
6
|
const di_1 = require("@opensumi/di");
|
|
9
|
-
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
10
|
-
const types_1 = require("./types");
|
|
11
|
-
const grid_service_1 = require("./grid/grid.service");
|
|
12
|
-
const functional_1 = require("@opensumi/ide-core-common/lib/functional");
|
|
13
7
|
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
14
|
-
const types_2 = require("./doc-model/types");
|
|
15
|
-
const ide_core_common_2 = require("@opensumi/ide-core-common");
|
|
16
8
|
const resource_1 = require("@opensumi/ide-core-browser/lib/contextkey/resource");
|
|
9
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
10
|
+
const ide_core_common_2 = require("@opensumi/ide-core-common");
|
|
11
|
+
const functional_1 = require("@opensumi/ide-core-common/lib/functional");
|
|
17
12
|
const ide_overlay_1 = require("@opensumi/ide-overlay");
|
|
13
|
+
const monaco = tslib_1.__importStar(require("@opensumi/monaco-editor-core/esm/vs/editor/editor.api"));
|
|
14
|
+
const common_1 = require("../common");
|
|
15
|
+
const types_1 = require("./doc-model/types");
|
|
18
16
|
const error_1 = require("./error");
|
|
19
|
-
|
|
17
|
+
const grid_service_1 = require("./grid/grid.service");
|
|
18
|
+
const types_2 = require("./types");
|
|
19
|
+
let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_core_common_2.WithEventBus {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
22
|
this.editorGroups = [];
|
|
23
|
-
this._onDidEditorGroupsChanged = new
|
|
23
|
+
this._onDidEditorGroupsChanged = new ide_core_common_2.Emitter();
|
|
24
24
|
this.onDidEditorGroupsChanged = this._onDidEditorGroupsChanged.event;
|
|
25
25
|
this._sortedEditorGroups = [];
|
|
26
|
-
this._onActiveResourceChange = new
|
|
26
|
+
this._onActiveResourceChange = new ide_core_common_2.Emitter();
|
|
27
27
|
this.onActiveResourceChange = this._onActiveResourceChange.event;
|
|
28
|
-
this._onActiveEditorUriChange = new
|
|
28
|
+
this._onActiveEditorUriChange = new ide_core_common_2.Emitter();
|
|
29
29
|
this.onActiveEditorUriChange = this._onActiveEditorUriChange.event;
|
|
30
|
-
this._onCursorChange = new
|
|
30
|
+
this._onCursorChange = new ide_core_common_2.Emitter();
|
|
31
31
|
this.onCursorChange = this._onCursorChange.event;
|
|
32
|
-
this._onDidCurrentEditorGroupChanged = new
|
|
32
|
+
this._onDidCurrentEditorGroupChanged = new ide_core_common_2.Emitter();
|
|
33
33
|
this.onDidCurrentEditorGroupChanged = this._onDidCurrentEditorGroupChanged.event;
|
|
34
34
|
this._restoring = true;
|
|
35
|
-
this.contributionsReady = new
|
|
35
|
+
this.contributionsReady = new ide_core_common_2.Deferred();
|
|
36
36
|
this.untitledIndex = 1;
|
|
37
37
|
this.untitledCloseIndex = [];
|
|
38
38
|
this.gridReady = false;
|
|
39
|
-
this._onDidGridReady = new
|
|
39
|
+
this._onDidGridReady = new ide_core_common_2.Emitter();
|
|
40
40
|
this.onDidGridReady = this._onDidGridReady.event;
|
|
41
41
|
this.initialize();
|
|
42
42
|
}
|
|
@@ -51,7 +51,7 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
51
51
|
}
|
|
52
52
|
this._currentEditorGroup = editorGroup;
|
|
53
53
|
this._onActiveResourceChange.fire(editorGroup.currentResource);
|
|
54
|
-
this.eventBus.fire(new
|
|
54
|
+
this.eventBus.fire(new types_2.EditorActiveResourceStateChangedEvent({
|
|
55
55
|
resource: editorGroup.currentResource,
|
|
56
56
|
openType: editorGroup.currentOpenType,
|
|
57
57
|
editorUri: (_a = this.currentEditor) === null || _a === void 0 ? void 0 : _a.currentUri,
|
|
@@ -62,7 +62,7 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
62
62
|
onEditorGroupChangeEvent(e) {
|
|
63
63
|
var _a;
|
|
64
64
|
if (e.payload.group === this.currentEditorGroup) {
|
|
65
|
-
this.eventBus.fire(new
|
|
65
|
+
this.eventBus.fire(new types_2.EditorActiveResourceStateChangedEvent({
|
|
66
66
|
resource: e.payload.newResource,
|
|
67
67
|
openType: e.payload.newOpenType,
|
|
68
68
|
editorUri: (_a = this.currentEditor) === null || _a === void 0 ? void 0 : _a.currentUri,
|
|
@@ -97,7 +97,7 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
97
97
|
createEditorGroup() {
|
|
98
98
|
const editorGroup = this.injector.get(EditorGroup, [this.generateRandomEditorGroupName()]);
|
|
99
99
|
this.editorGroups.push(editorGroup);
|
|
100
|
-
const currentWatchDisposer = new
|
|
100
|
+
const currentWatchDisposer = new ide_core_common_2.Disposable(editorGroup.onDidEditorGroupBodyChanged(() => {
|
|
101
101
|
if (editorGroup === this.currentEditorGroup) {
|
|
102
102
|
if (!editorGroup.currentOpenType && editorGroup.currentResource) {
|
|
103
103
|
// 暂时状态,不发事件
|
|
@@ -135,8 +135,6 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
135
135
|
this._onCursorChange.fire(e);
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
-
this._sortedEditorGroups = undefined;
|
|
139
|
-
this._onDidEditorGroupsChanged.fire();
|
|
140
138
|
return editorGroup;
|
|
141
139
|
}
|
|
142
140
|
/**
|
|
@@ -162,7 +160,7 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
162
160
|
this._currentEditorGroup = this.editorGroups[0];
|
|
163
161
|
}
|
|
164
162
|
async initializeState() {
|
|
165
|
-
const state = await this.getStorage(
|
|
163
|
+
const state = await this.getStorage(ide_core_common_2.STORAGE_NAMESPACE.WORKBENCH);
|
|
166
164
|
return state;
|
|
167
165
|
}
|
|
168
166
|
get currentEditor() {
|
|
@@ -219,14 +217,12 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
219
217
|
this.setCurrentGroup(this.editorGroups[0]);
|
|
220
218
|
}
|
|
221
219
|
for (let i = index; i < this.editorGroups.length; i++) {
|
|
222
|
-
this.eventBus.fire(new
|
|
220
|
+
this.eventBus.fire(new types_2.EditorGroupIndexChangedEvent({
|
|
223
221
|
group: this.editorGroups[i],
|
|
224
222
|
index: i,
|
|
225
223
|
}));
|
|
226
224
|
}
|
|
227
|
-
this._onDidEditorGroupsChanged.fire();
|
|
228
225
|
}
|
|
229
|
-
this._sortedEditorGroups = undefined;
|
|
230
226
|
}
|
|
231
227
|
async saveOpenedResourceState() {
|
|
232
228
|
if (this._restoring) {
|
|
@@ -288,10 +284,18 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
288
284
|
this.editorContextKeyService.attachToDomNode(domNode);
|
|
289
285
|
}
|
|
290
286
|
}
|
|
287
|
+
notifyGroupChanged() {
|
|
288
|
+
this._sortedEditorGroups = undefined;
|
|
289
|
+
this._onDidEditorGroupsChanged.fire();
|
|
290
|
+
}
|
|
291
291
|
async restoreState() {
|
|
292
292
|
let state = { editorGroup: { uris: [], previewIndex: -1 } };
|
|
293
293
|
state = this.openedResourceState.get('grid', state);
|
|
294
294
|
this.topGrid = new grid_service_1.EditorGrid();
|
|
295
|
+
this.topGrid.onDidGridAndDesendantStateChange(() => {
|
|
296
|
+
this._sortedEditorGroups = undefined;
|
|
297
|
+
this._onDidEditorGroupsChanged.fire();
|
|
298
|
+
});
|
|
295
299
|
const editorRestorePromises = [];
|
|
296
300
|
const promise = this.topGrid
|
|
297
301
|
.deserialize(state, () => this.createEditorGroup(), editorRestorePromises)
|
|
@@ -301,6 +305,7 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
301
305
|
}
|
|
302
306
|
this.gridReady = true;
|
|
303
307
|
this._onDidGridReady.fire();
|
|
308
|
+
this.notifyGroupChanged();
|
|
304
309
|
});
|
|
305
310
|
Promise.all(editorRestorePromises).then(() => {
|
|
306
311
|
this._restoring = false;
|
|
@@ -333,7 +338,7 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
333
338
|
return this._sortedEditorGroups;
|
|
334
339
|
}
|
|
335
340
|
handleOnCloseUntitledResource(e) {
|
|
336
|
-
if (e.payload.resource.uri.scheme ===
|
|
341
|
+
if (e.payload.resource.uri.scheme === ide_core_common_1.Schemas.untitled) {
|
|
337
342
|
const { index } = e.payload.resource.uri.getParsedQuery();
|
|
338
343
|
this.untitledCloseIndex.push(parseInt(index, 10));
|
|
339
344
|
// 升序排序,每次可以去到最小的 index
|
|
@@ -343,7 +348,7 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
343
348
|
createUntitledURI() {
|
|
344
349
|
// 优先从已删除的 index 中获取
|
|
345
350
|
const index = this.untitledCloseIndex.shift() || this.untitledIndex++;
|
|
346
|
-
return new
|
|
351
|
+
return new ide_core_common_2.URI().withScheme(ide_core_common_1.Schemas.untitled).withQuery(`name=Untitled-${index}&index=${index}`);
|
|
347
352
|
}
|
|
348
353
|
createUntitledResource(options = {
|
|
349
354
|
uri: this.createUntitledURI(),
|
|
@@ -356,27 +361,27 @@ tslib_1.__decorate([
|
|
|
356
361
|
tslib_1.__metadata("design:type", di_1.Injector)
|
|
357
362
|
], WorkbenchEditorServiceImpl.prototype, "injector", void 0);
|
|
358
363
|
tslib_1.__decorate([
|
|
359
|
-
(0, di_1.Autowired)(
|
|
364
|
+
(0, di_1.Autowired)(ide_core_common_2.StorageProvider),
|
|
360
365
|
tslib_1.__metadata("design:type", Function)
|
|
361
366
|
], WorkbenchEditorServiceImpl.prototype, "getStorage", void 0);
|
|
362
367
|
tslib_1.__decorate([
|
|
363
|
-
(0, di_1.Autowired)(
|
|
368
|
+
(0, di_1.Autowired)(types_2.BrowserEditorContribution),
|
|
364
369
|
tslib_1.__metadata("design:type", Object)
|
|
365
370
|
], WorkbenchEditorServiceImpl.prototype, "contributions", void 0);
|
|
366
371
|
tslib_1.__decorate([
|
|
367
|
-
(0, di_1.Autowired)(
|
|
372
|
+
(0, di_1.Autowired)(types_1.IEditorDocumentModelService),
|
|
368
373
|
tslib_1.__metadata("design:type", Object)
|
|
369
374
|
], WorkbenchEditorServiceImpl.prototype, "documentModelManager", void 0);
|
|
370
375
|
tslib_1.__decorate([
|
|
371
|
-
(0,
|
|
376
|
+
(0, ide_core_common_2.OnEvent)(types_2.EditorGroupChangeEvent),
|
|
372
377
|
tslib_1.__metadata("design:type", Function),
|
|
373
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
378
|
+
tslib_1.__metadata("design:paramtypes", [types_2.EditorGroupChangeEvent]),
|
|
374
379
|
tslib_1.__metadata("design:returntype", void 0)
|
|
375
380
|
], WorkbenchEditorServiceImpl.prototype, "onEditorGroupChangeEvent", null);
|
|
376
381
|
tslib_1.__decorate([
|
|
377
|
-
(0,
|
|
382
|
+
(0, ide_core_common_2.OnEvent)(types_2.EditorGroupCloseEvent),
|
|
378
383
|
tslib_1.__metadata("design:type", Function),
|
|
379
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
384
|
+
tslib_1.__metadata("design:paramtypes", [types_2.EditorGroupCloseEvent]),
|
|
380
385
|
tslib_1.__metadata("design:returntype", void 0)
|
|
381
386
|
], WorkbenchEditorServiceImpl.prototype, "handleOnCloseUntitledResource", null);
|
|
382
387
|
WorkbenchEditorServiceImpl = tslib_1.__decorate([
|
|
@@ -388,27 +393,27 @@ exports.WorkbenchEditorServiceImpl = WorkbenchEditorServiceImpl;
|
|
|
388
393
|
* Editor Group是一个可视的编辑区域
|
|
389
394
|
* 它由tab,editor,diff-editor,富组件container组成
|
|
390
395
|
*/
|
|
391
|
-
let EditorGroup = class EditorGroup extends
|
|
396
|
+
let EditorGroup = class EditorGroup extends ide_core_common_2.WithEventBus {
|
|
392
397
|
constructor(name) {
|
|
393
398
|
super();
|
|
394
399
|
this.name = name;
|
|
395
400
|
this.openingPromise = new Map();
|
|
396
|
-
this._onDidEditorFocusChange = this.registerDispose(new
|
|
401
|
+
this._onDidEditorFocusChange = this.registerDispose(new ide_core_common_2.Emitter());
|
|
397
402
|
this.onDidEditorFocusChange = this._onDidEditorFocusChange.event;
|
|
398
403
|
/**
|
|
399
404
|
* 当编辑器的tab部分发生变更
|
|
400
405
|
*/
|
|
401
|
-
this._onDidEditorGroupTabChanged = new
|
|
406
|
+
this._onDidEditorGroupTabChanged = new ide_core_common_2.Emitter();
|
|
402
407
|
this.onDidEditorGroupTabChanged = this._onDidEditorGroupTabChanged.event;
|
|
403
408
|
/**
|
|
404
409
|
* 当编辑器的主体部分发生变更
|
|
405
410
|
*/
|
|
406
|
-
this._onDidEditorGroupBodyChanged = new
|
|
411
|
+
this._onDidEditorGroupBodyChanged = new ide_core_common_2.Emitter();
|
|
407
412
|
this.onDidEditorGroupBodyChanged = this._onDidEditorGroupBodyChanged.event;
|
|
408
413
|
/**
|
|
409
414
|
* 当编辑器有内容处于加载状态
|
|
410
415
|
*/
|
|
411
|
-
this._onDidEditorGroupContentLoading = new
|
|
416
|
+
this._onDidEditorGroupContentLoading = new ide_core_common_2.Emitter();
|
|
412
417
|
this.onDidEditorGroupContentLoading = this._onDidEditorGroupContentLoading.event;
|
|
413
418
|
/**
|
|
414
419
|
* 每个group只能有一个preview
|
|
@@ -435,24 +440,24 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
435
440
|
this._codeEditorPendingLayout = false;
|
|
436
441
|
this._diffEditorPendingLayout = false;
|
|
437
442
|
// 当前为EditorComponent,且monaco光标变化时触发
|
|
438
|
-
this._onCurrentEditorCursorChange = new
|
|
443
|
+
this._onCurrentEditorCursorChange = new ide_core_common_2.Emitter();
|
|
439
444
|
this.onCurrentEditorCursorChange = this._onCurrentEditorCursorChange.event;
|
|
440
445
|
this.resourceOpenHistory = [];
|
|
441
446
|
this._domNode = null;
|
|
442
|
-
this.codeEditorReady = new
|
|
443
|
-
this.diffEditorReady = new
|
|
447
|
+
this.codeEditorReady = new ide_core_common_2.ReadyEvent();
|
|
448
|
+
this.diffEditorReady = new ide_core_common_2.ReadyEvent();
|
|
444
449
|
this._restoringState = false;
|
|
445
450
|
this.eventBus.on(ide_core_browser_1.ResizeEvent, (e) => {
|
|
446
451
|
if (e.payload.slotLocation === (0, ide_core_browser_1.getSlotLocation)('@opensumi/ide-editor', this.config.layoutConfig)) {
|
|
447
452
|
this.doLayoutEditors();
|
|
448
453
|
}
|
|
449
454
|
});
|
|
450
|
-
this.eventBus.on(
|
|
455
|
+
this.eventBus.on(types_2.GridResizeEvent, (e) => {
|
|
451
456
|
if (e.payload.gridId === this.grid.uid) {
|
|
452
457
|
this.doLayoutEditors();
|
|
453
458
|
}
|
|
454
459
|
});
|
|
455
|
-
this.eventBus.on(
|
|
460
|
+
this.eventBus.on(types_2.EditorComponentDisposeEvent, (e) => {
|
|
456
461
|
this.activeComponents.delete(e.payload);
|
|
457
462
|
this.activateComponentsProps.delete(e.payload);
|
|
458
463
|
});
|
|
@@ -601,7 +606,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
601
606
|
this._onDidEditorFocusChange.fire();
|
|
602
607
|
}
|
|
603
608
|
};
|
|
604
|
-
this.updateContextKeyWhenEditorChangesFocusDisposer = new
|
|
609
|
+
this.updateContextKeyWhenEditorChangesFocusDisposer = new ide_core_common_2.Disposable(this.diffEditor.modifiedEditor.onFocus(() => {
|
|
605
610
|
this._currentOrPreviousFocusedEditor = this.diffEditor.modifiedEditor;
|
|
606
611
|
this.setContextKeys();
|
|
607
612
|
this._onDidEditorFocusChange.fire();
|
|
@@ -746,7 +751,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
746
751
|
}));
|
|
747
752
|
this.toDispose.push(this.codeEditor.onSelectionsChanged((e) => {
|
|
748
753
|
if (this.currentOpenType && this.currentOpenType.type === 'code') {
|
|
749
|
-
this.eventBus.fire(new
|
|
754
|
+
this.eventBus.fire(new types_2.EditorSelectionChangeEvent({
|
|
750
755
|
group: this,
|
|
751
756
|
resource: this.currentResource,
|
|
752
757
|
selections: e.selections,
|
|
@@ -757,7 +762,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
757
762
|
}));
|
|
758
763
|
this.toDispose.push(this.codeEditor.onVisibleRangesChanged((e) => {
|
|
759
764
|
if (this.currentOpenType && this.currentOpenType.type === 'code') {
|
|
760
|
-
this.eventBus.fire(new
|
|
765
|
+
this.eventBus.fire(new types_2.EditorVisibleChangeEvent({
|
|
761
766
|
group: this,
|
|
762
767
|
resource: this.currentResource,
|
|
763
768
|
visibleRanges: e,
|
|
@@ -767,14 +772,14 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
767
772
|
}));
|
|
768
773
|
this.toDispose.push(this.codeEditor.onConfigurationChanged(() => {
|
|
769
774
|
if (this.currentOpenType && this.currentOpenType.type === 'code') {
|
|
770
|
-
this.eventBus.fire(new
|
|
775
|
+
this.eventBus.fire(new types_2.EditorConfigurationChangedEvent({
|
|
771
776
|
group: this,
|
|
772
777
|
resource: this.currentResource,
|
|
773
778
|
editorUri: this.codeEditor.currentUri,
|
|
774
779
|
}));
|
|
775
780
|
}
|
|
776
781
|
}));
|
|
777
|
-
this.eventBus.fire(new
|
|
782
|
+
this.eventBus.fire(new types_2.CodeEditorDidVisibleEvent({
|
|
778
783
|
groupName: this.name,
|
|
779
784
|
type: 'code',
|
|
780
785
|
editorId: this.codeEditor.getId(),
|
|
@@ -791,7 +796,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
791
796
|
// 这里应该还要加上 originalEditor 的相关监听,目前为了避免复杂度,先不放
|
|
792
797
|
this.toDispose.push(this.diffEditor.modifiedEditor.onSelectionsChanged((e) => {
|
|
793
798
|
if (this.currentOpenType && this.currentOpenType.type === 'diff') {
|
|
794
|
-
this.eventBus.fire(new
|
|
799
|
+
this.eventBus.fire(new types_2.EditorSelectionChangeEvent({
|
|
795
800
|
group: this,
|
|
796
801
|
resource: this.currentResource,
|
|
797
802
|
selections: e.selections,
|
|
@@ -802,7 +807,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
802
807
|
}));
|
|
803
808
|
this.toDispose.push(this.diffEditor.modifiedEditor.onVisibleRangesChanged((e) => {
|
|
804
809
|
if (this.currentOpenType && this.currentOpenType.type === 'diff') {
|
|
805
|
-
this.eventBus.fire(new
|
|
810
|
+
this.eventBus.fire(new types_2.EditorVisibleChangeEvent({
|
|
806
811
|
group: this,
|
|
807
812
|
resource: this.currentResource,
|
|
808
813
|
visibleRanges: e,
|
|
@@ -812,14 +817,14 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
812
817
|
}));
|
|
813
818
|
this.toDispose.push(this.diffEditor.modifiedEditor.onConfigurationChanged(() => {
|
|
814
819
|
if (this.currentOpenType && this.currentOpenType.type === 'diff') {
|
|
815
|
-
this.eventBus.fire(new
|
|
820
|
+
this.eventBus.fire(new types_2.EditorConfigurationChangedEvent({
|
|
816
821
|
group: this,
|
|
817
822
|
resource: this.currentResource,
|
|
818
823
|
editorUri: this.diffEditor.modifiedEditor.currentUri,
|
|
819
824
|
}));
|
|
820
825
|
}
|
|
821
826
|
}));
|
|
822
|
-
this.eventBus.fire(new
|
|
827
|
+
this.eventBus.fire(new types_2.CodeEditorDidVisibleEvent({
|
|
823
828
|
groupName: this.name,
|
|
824
829
|
type: 'diff',
|
|
825
830
|
editorId: this.diffEditor.modifiedEditor.getId(),
|
|
@@ -850,7 +855,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
850
855
|
return editorGroup.open(uri, Object.assign(Object.assign({}, options), { preview: false }));
|
|
851
856
|
}
|
|
852
857
|
async open(uri, options = {}) {
|
|
853
|
-
if (uri.scheme ===
|
|
858
|
+
if (uri.scheme === ide_core_common_1.Schemas.file) {
|
|
854
859
|
// 只记录 file 类型的
|
|
855
860
|
this.recentFilesManager.setMostRecentlyOpenedFile(uri.withoutFragment().toString());
|
|
856
861
|
}
|
|
@@ -866,7 +871,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
866
871
|
this.openingPromise.delete(uri.toString());
|
|
867
872
|
});
|
|
868
873
|
}
|
|
869
|
-
const previewMode = this.preferenceService.get('editor.previewMode') && ((0,
|
|
874
|
+
const previewMode = this.preferenceService.get('editor.previewMode') && ((0, ide_core_common_1.isUndefinedOrNull)(options.preview) ? true : options.preview);
|
|
870
875
|
if (!previewMode) {
|
|
871
876
|
this.openingPromise.get(uri.toString()).then(() => {
|
|
872
877
|
this.pinPreviewed(uri);
|
|
@@ -886,7 +891,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
886
891
|
let resourceReady;
|
|
887
892
|
try {
|
|
888
893
|
const previewMode = this.preferenceService.get('editor.previewMode') &&
|
|
889
|
-
((0,
|
|
894
|
+
((0, ide_core_common_1.isUndefinedOrNull)(options.preview) ? true : options.preview);
|
|
890
895
|
if (this.currentResource && this.currentResource.uri.isEqual(uri)) {
|
|
891
896
|
// 就是当前打开的resource
|
|
892
897
|
if (options.focus && this.currentEditor) {
|
|
@@ -974,8 +979,8 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
974
979
|
this._currentOpenType = null;
|
|
975
980
|
this.notifyBodyChanged();
|
|
976
981
|
// 只有真正打开的文件才会走到这里,backend模式的只更新了tab,文件内容并未加载
|
|
977
|
-
const reportTimer = this.reporterService.time(
|
|
978
|
-
resourceReady = new
|
|
982
|
+
const reportTimer = this.reporterService.time(ide_core_common_1.REPORT_NAME.EDITOR_REACTIVE);
|
|
983
|
+
resourceReady = new ide_core_common_2.Deferred();
|
|
979
984
|
this.resourceStatus.set(resource, resourceReady.promise);
|
|
980
985
|
// 超过60ms loading时间的才展示加载
|
|
981
986
|
const delayTimer = setTimeout(() => {
|
|
@@ -988,7 +993,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
988
993
|
this._currentOrPreviousFocusedEditor = this.currentEditor;
|
|
989
994
|
this._onDidEditorFocusChange.fire();
|
|
990
995
|
this.setContextKeys();
|
|
991
|
-
this.eventBus.fire(new
|
|
996
|
+
this.eventBus.fire(new types_2.EditorGroupOpenEvent({
|
|
992
997
|
group: this,
|
|
993
998
|
resource,
|
|
994
999
|
}));
|
|
@@ -998,7 +1003,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
998
1003
|
else {
|
|
999
1004
|
this.locateInFileTree(uri);
|
|
1000
1005
|
}
|
|
1001
|
-
this.eventBus.fire(new
|
|
1006
|
+
this.eventBus.fire(new types_2.EditorGroupChangeEvent({
|
|
1002
1007
|
group: this,
|
|
1003
1008
|
newOpenType: this.currentOpenType,
|
|
1004
1009
|
newResource: this.currentResource,
|
|
@@ -1012,10 +1017,10 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1012
1017
|
}
|
|
1013
1018
|
}
|
|
1014
1019
|
catch (e) {
|
|
1015
|
-
(0,
|
|
1020
|
+
(0, ide_core_common_2.getDebugLogger)().error(e);
|
|
1016
1021
|
resourceReady && resourceReady.reject();
|
|
1017
1022
|
if (!(0, error_1.isEditorError)(e, error_1.EditorTabChangedError)) {
|
|
1018
|
-
this.messageService.error((0,
|
|
1023
|
+
this.messageService.error((0, ide_core_common_2.formatLocalize)('editor.failToOpen', uri.displayName, e.message), [], true);
|
|
1019
1024
|
}
|
|
1020
1025
|
return false;
|
|
1021
1026
|
// todo 给用户显示error
|
|
@@ -1040,8 +1045,8 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1040
1045
|
disposeDocumentRef(uri) {
|
|
1041
1046
|
if (uri.scheme === 'diff') {
|
|
1042
1047
|
const query = uri.getParsedQuery();
|
|
1043
|
-
this.doDisposeDocRef(new
|
|
1044
|
-
this.doDisposeDocRef(new
|
|
1048
|
+
this.doDisposeDocRef(new ide_core_common_2.URI(query.original));
|
|
1049
|
+
this.doDisposeDocRef(new ide_core_common_2.URI(query.modified));
|
|
1045
1050
|
}
|
|
1046
1051
|
else {
|
|
1047
1052
|
this.doDisposeDocRef(uri);
|
|
@@ -1094,7 +1099,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1094
1099
|
// monaco 编辑器的 focus 多了一步检查,由于此时其实对应编辑器的 dom 的 display 为 none (需要等 React 下一次渲染才会改变为 block),
|
|
1095
1100
|
// 会引起 document.activeElement !== editor.textArea.domNode,进而会导致focus失败
|
|
1096
1101
|
// 需要等待真正 append 之后再
|
|
1097
|
-
const disposer = this.eventBus.on(
|
|
1102
|
+
const disposer = this.eventBus.on(types_2.CodeEditorDidVisibleEvent, (e) => {
|
|
1098
1103
|
var _a;
|
|
1099
1104
|
if (e.payload.groupName === this.name && e.payload.type === 'code') {
|
|
1100
1105
|
disposer.dispose();
|
|
@@ -1134,7 +1139,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1134
1139
|
if (options.focus) {
|
|
1135
1140
|
(_a = this._domNode) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1136
1141
|
// 理由见上方 codeEditor.focus 部分
|
|
1137
|
-
const disposer = this.eventBus.on(
|
|
1142
|
+
const disposer = this.eventBus.on(types_2.CodeEditorDidVisibleEvent, (e) => {
|
|
1138
1143
|
if (e.payload.groupName === this.name && e.payload.type === 'diff') {
|
|
1139
1144
|
disposer.dispose();
|
|
1140
1145
|
if (this.disposed) {
|
|
@@ -1164,7 +1169,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1164
1169
|
}
|
|
1165
1170
|
else {
|
|
1166
1171
|
this.activateComponentsProps.set(component, initialProps);
|
|
1167
|
-
if (component.renderMode ===
|
|
1172
|
+
if (component.renderMode === types_2.EditorComponentRenderMode.ONE_PER_RESOURCE) {
|
|
1168
1173
|
const openedResources = this.activeComponents.get(component) || [];
|
|
1169
1174
|
const index = openedResources.findIndex((r) => r.uri.toString() === resource.uri.toString());
|
|
1170
1175
|
if (index === -1) {
|
|
@@ -1172,10 +1177,10 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1172
1177
|
}
|
|
1173
1178
|
this.activeComponents.set(component, openedResources);
|
|
1174
1179
|
}
|
|
1175
|
-
else if (component.renderMode ===
|
|
1180
|
+
else if (component.renderMode === types_2.EditorComponentRenderMode.ONE_PER_GROUP) {
|
|
1176
1181
|
this.activeComponents.set(component, [resource]);
|
|
1177
1182
|
}
|
|
1178
|
-
else if (component.renderMode ===
|
|
1183
|
+
else if (component.renderMode === types_2.EditorComponentRenderMode.ONE_PER_WORKBENCH) {
|
|
1179
1184
|
const promises = [];
|
|
1180
1185
|
this.workbenchEditorService.editorGroups.forEach((g) => {
|
|
1181
1186
|
if (g === this) {
|
|
@@ -1186,7 +1191,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1186
1191
|
promises.push(g.close(r.uri));
|
|
1187
1192
|
}
|
|
1188
1193
|
});
|
|
1189
|
-
await Promise.all(promises).catch((0,
|
|
1194
|
+
await Promise.all(promises).catch((0, ide_core_common_2.getDebugLogger)().error);
|
|
1190
1195
|
this.activeComponents.set(component, [resource]);
|
|
1191
1196
|
}
|
|
1192
1197
|
}
|
|
@@ -1228,7 +1233,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1228
1233
|
}
|
|
1229
1234
|
}
|
|
1230
1235
|
this.resources.splice(index, 1);
|
|
1231
|
-
this.eventBus.fire(new
|
|
1236
|
+
this.eventBus.fire(new types_2.EditorGroupCloseEvent({
|
|
1232
1237
|
group: this,
|
|
1233
1238
|
resource,
|
|
1234
1239
|
}));
|
|
@@ -1318,7 +1323,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1318
1323
|
this._currentOrPreviousFocusedEditor = null;
|
|
1319
1324
|
this._onDidEditorFocusChange.fire();
|
|
1320
1325
|
// 关闭最后一个时,应该发送一个 EditorGroupChangeEvent
|
|
1321
|
-
this.eventBus.fire(new
|
|
1326
|
+
this.eventBus.fire(new types_2.EditorGroupChangeEvent({
|
|
1322
1327
|
group: this,
|
|
1323
1328
|
newOpenType: this.currentOpenType,
|
|
1324
1329
|
newResource: this.currentResource,
|
|
@@ -1386,7 +1391,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1386
1391
|
}
|
|
1387
1392
|
}
|
|
1388
1393
|
clearResourceOnClose(resource) {
|
|
1389
|
-
this.eventBus.fire(new
|
|
1394
|
+
this.eventBus.fire(new types_2.EditorGroupCloseEvent({
|
|
1390
1395
|
group: this,
|
|
1391
1396
|
resource,
|
|
1392
1397
|
}));
|
|
@@ -1431,7 +1436,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1431
1436
|
}
|
|
1432
1437
|
const oldOpenType = this.currentOpenType;
|
|
1433
1438
|
await this.displayResourceComponent(this.currentResource, { forceOpenType: type });
|
|
1434
|
-
this.eventBus.fire(new
|
|
1439
|
+
this.eventBus.fire(new types_2.EditorGroupChangeEvent({
|
|
1435
1440
|
group: this,
|
|
1436
1441
|
newOpenType: this.currentOpenType,
|
|
1437
1442
|
newResource: this.currentResource,
|
|
@@ -1443,7 +1448,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1443
1448
|
* 拖拽drop方法
|
|
1444
1449
|
*/
|
|
1445
1450
|
async dropUri(uri, position, sourceGroup, targetResource) {
|
|
1446
|
-
if (position !==
|
|
1451
|
+
if (position !== types_2.DragOverPosition.CENTER) {
|
|
1447
1452
|
await this.split((0, common_1.getSplitActionFromDragDrop)(position), uri, { preview: false, focus: true });
|
|
1448
1453
|
}
|
|
1449
1454
|
else {
|
|
@@ -1486,7 +1491,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1486
1491
|
// 从其他group拖动过来
|
|
1487
1492
|
await sourceGroup.close(uri);
|
|
1488
1493
|
}
|
|
1489
|
-
else if (position !==
|
|
1494
|
+
else if (position !== types_2.DragOverPosition.CENTER) {
|
|
1490
1495
|
// split行为
|
|
1491
1496
|
await this.close(uri);
|
|
1492
1497
|
}
|
|
@@ -1511,7 +1516,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1511
1516
|
this.codeEditor && this.codeEditor.dispose();
|
|
1512
1517
|
this.diffEditor && this.diffEditor.dispose();
|
|
1513
1518
|
this.toDispose.forEach((disposable) => disposable.dispose());
|
|
1514
|
-
this.eventBus.fire(new
|
|
1519
|
+
this.eventBus.fire(new types_2.EditorGroupDisposeEvent({
|
|
1515
1520
|
group: this,
|
|
1516
1521
|
}));
|
|
1517
1522
|
}
|
|
@@ -1535,17 +1540,17 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1535
1540
|
}
|
|
1536
1541
|
async restoreState(state) {
|
|
1537
1542
|
this._restoringState = true;
|
|
1538
|
-
this.previewURI = state.uris[state.previewIndex] ? null : new
|
|
1543
|
+
this.previewURI = state.uris[state.previewIndex] ? null : new ide_core_common_2.URI(state.uris[state.previewIndex]);
|
|
1539
1544
|
for (const uri of state.uris) {
|
|
1540
|
-
await this.doOpen(new
|
|
1545
|
+
await this.doOpen(new ide_core_common_2.URI(uri), { disableNavigate: true, backend: true, preview: false, deletedPolicy: 'skip' });
|
|
1541
1546
|
}
|
|
1542
1547
|
let targetUri;
|
|
1543
1548
|
if (state.current) {
|
|
1544
|
-
targetUri = new
|
|
1549
|
+
targetUri = new ide_core_common_2.URI(state.current);
|
|
1545
1550
|
}
|
|
1546
1551
|
else {
|
|
1547
1552
|
if (state.uris.length > 0) {
|
|
1548
|
-
targetUri = new
|
|
1553
|
+
targetUri = new ide_core_common_2.URI(state.uris[state.uris.length - 1]);
|
|
1549
1554
|
}
|
|
1550
1555
|
}
|
|
1551
1556
|
if (targetUri) {
|
|
@@ -1561,7 +1566,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1561
1566
|
async saveAll(includeUntitled, reason) {
|
|
1562
1567
|
for (const r of this.resources) {
|
|
1563
1568
|
// 不保存无标题文件
|
|
1564
|
-
if (!includeUntitled && r.uri.scheme ===
|
|
1569
|
+
if (!includeUntitled && r.uri.scheme === ide_core_common_1.Schemas.untitled) {
|
|
1565
1570
|
continue;
|
|
1566
1571
|
}
|
|
1567
1572
|
await this.saveResource(r, reason);
|
|
@@ -1650,18 +1655,18 @@ tslib_1.__decorate([
|
|
|
1650
1655
|
], EditorGroup.prototype, "resourceService", void 0);
|
|
1651
1656
|
tslib_1.__decorate([
|
|
1652
1657
|
(0, di_1.Autowired)(),
|
|
1653
|
-
tslib_1.__metadata("design:type",
|
|
1658
|
+
tslib_1.__metadata("design:type", types_2.EditorComponentRegistry)
|
|
1654
1659
|
], EditorGroup.prototype, "editorComponentRegistry", void 0);
|
|
1655
1660
|
tslib_1.__decorate([
|
|
1656
1661
|
(0, di_1.Autowired)(common_1.WorkbenchEditorService),
|
|
1657
1662
|
tslib_1.__metadata("design:type", WorkbenchEditorServiceImpl)
|
|
1658
1663
|
], EditorGroup.prototype, "workbenchEditorService", void 0);
|
|
1659
1664
|
tslib_1.__decorate([
|
|
1660
|
-
(0, di_1.Autowired)(
|
|
1665
|
+
(0, di_1.Autowired)(types_1.IEditorDocumentModelService),
|
|
1661
1666
|
tslib_1.__metadata("design:type", Object)
|
|
1662
1667
|
], EditorGroup.prototype, "documentModelManager", void 0);
|
|
1663
1668
|
tslib_1.__decorate([
|
|
1664
|
-
(0, di_1.Autowired)(
|
|
1669
|
+
(0, di_1.Autowired)(ide_core_common_2.CommandService),
|
|
1665
1670
|
tslib_1.__metadata("design:type", Object)
|
|
1666
1671
|
], EditorGroup.prototype, "commands", void 0);
|
|
1667
1672
|
tslib_1.__decorate([
|
|
@@ -1677,7 +1682,7 @@ tslib_1.__decorate([
|
|
|
1677
1682
|
tslib_1.__metadata("design:type", Object)
|
|
1678
1683
|
], EditorGroup.prototype, "messageService", void 0);
|
|
1679
1684
|
tslib_1.__decorate([
|
|
1680
|
-
(0, di_1.Autowired)(
|
|
1685
|
+
(0, di_1.Autowired)(ide_core_common_2.IReporterService),
|
|
1681
1686
|
tslib_1.__metadata("design:type", Object)
|
|
1682
1687
|
], EditorGroup.prototype, "reporterService", void 0);
|
|
1683
1688
|
tslib_1.__decorate([
|
|
@@ -1689,7 +1694,7 @@ tslib_1.__decorate([
|
|
|
1689
1694
|
tslib_1.__metadata("design:type", Object)
|
|
1690
1695
|
], EditorGroup.prototype, "openerService", void 0);
|
|
1691
1696
|
tslib_1.__decorate([
|
|
1692
|
-
(0, di_1.Autowired)(
|
|
1697
|
+
(0, di_1.Autowired)(ide_core_common_2.ILogger),
|
|
1693
1698
|
tslib_1.__metadata("design:type", Object)
|
|
1694
1699
|
], EditorGroup.prototype, "logger", void 0);
|
|
1695
1700
|
tslib_1.__decorate([
|
|
@@ -1697,19 +1702,19 @@ tslib_1.__decorate([
|
|
|
1697
1702
|
tslib_1.__metadata("design:type", Array)
|
|
1698
1703
|
], EditorGroup.prototype, "availableOpenTypes", void 0);
|
|
1699
1704
|
tslib_1.__decorate([
|
|
1700
|
-
(0,
|
|
1705
|
+
(0, ide_core_common_2.OnEvent)(common_1.ResourceDecorationChangeEvent),
|
|
1701
1706
|
tslib_1.__metadata("design:type", Function),
|
|
1702
1707
|
tslib_1.__metadata("design:paramtypes", [common_1.ResourceDecorationChangeEvent]),
|
|
1703
1708
|
tslib_1.__metadata("design:returntype", void 0)
|
|
1704
1709
|
], EditorGroup.prototype, "onResourceDecorationChangeEvent", null);
|
|
1705
1710
|
tslib_1.__decorate([
|
|
1706
|
-
(0,
|
|
1711
|
+
(0, ide_core_common_2.OnEvent)(types_2.ResourceOpenTypeChangedEvent),
|
|
1707
1712
|
tslib_1.__metadata("design:type", Function),
|
|
1708
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
1713
|
+
tslib_1.__metadata("design:paramtypes", [types_2.ResourceOpenTypeChangedEvent]),
|
|
1709
1714
|
tslib_1.__metadata("design:returntype", void 0)
|
|
1710
1715
|
], EditorGroup.prototype, "oResourceOpenTypeChangedEvent", null);
|
|
1711
1716
|
tslib_1.__decorate([
|
|
1712
|
-
(0,
|
|
1717
|
+
(0, ide_core_common_2.OnEvent)(types_2.RegisterEditorComponentEvent),
|
|
1713
1718
|
tslib_1.__metadata("design:type", Function),
|
|
1714
1719
|
tslib_1.__metadata("design:paramtypes", []),
|
|
1715
1720
|
tslib_1.__metadata("design:returntype", Promise)
|