@opensumi/ide-editor 3.9.1-next-1749540423.0 → 3.9.1-next-1749546307.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/decoration-applier.d.ts +1 -1
- package/lib/browser/decoration-applier.d.ts.map +1 -1
- package/lib/browser/decoration-applier.js +4 -4
- package/lib/browser/decoration-applier.js.map +1 -1
- package/lib/browser/editor-collection.service.d.ts +57 -21
- package/lib/browser/editor-collection.service.d.ts.map +1 -1
- package/lib/browser/editor-collection.service.js +207 -56
- package/lib/browser/editor-collection.service.js.map +1 -1
- package/lib/browser/editor.contribution.d.ts.map +1 -1
- package/lib/browser/editor.contribution.js +0 -1
- package/lib/browser/editor.contribution.js.map +1 -1
- package/lib/browser/editor.less +0 -31
- package/lib/browser/editor.view.js +1 -1
- package/lib/browser/editor.view.js.map +1 -1
- package/lib/browser/multi-diff/multi-diff-editor.d.ts +7 -10
- package/lib/browser/multi-diff/multi-diff-editor.d.ts.map +1 -1
- package/lib/browser/multi-diff/multi-diff-editor.js +7 -62
- package/lib/browser/multi-diff/multi-diff-editor.js.map +1 -1
- package/lib/browser/multi-diff/multi-diff-resource.d.ts.map +1 -1
- package/lib/browser/multi-diff/multi-diff-resource.js.map +1 -1
- package/lib/browser/workbench-editor.service.js +1 -1
- package/lib/browser/workbench-editor.service.js.map +1 -1
- package/lib/common/editor.d.ts +0 -11
- package/lib/common/editor.d.ts.map +1 -1
- package/lib/common/editor.js.map +1 -1
- package/lib/common/multi-diff.d.ts +1 -6
- package/lib/common/multi-diff.d.ts.map +1 -1
- package/lib/common/multi-diff.js.map +1 -1
- package/package.json +14 -14
- package/src/browser/decoration-applier.ts +8 -12
- package/src/browser/editor-collection.service.ts +264 -65
- package/src/browser/editor.contribution.ts +0 -2
- package/src/browser/editor.less +0 -31
- package/src/browser/editor.view.tsx +1 -1
- package/src/browser/multi-diff/multi-diff-editor.ts +10 -97
- package/src/browser/multi-diff/multi-diff-resource.ts +1 -0
- package/src/browser/workbench-editor.service.ts +1 -1
- package/src/common/editor.ts +0 -14
- package/src/common/multi-diff.ts +1 -8
- package/lib/browser/base-editor-wrapper.d.ts +0 -63
- package/lib/browser/base-editor-wrapper.d.ts.map +0 -1
- package/lib/browser/base-editor-wrapper.js +0 -224
- package/lib/browser/base-editor-wrapper.js.map +0 -1
- package/src/browser/base-editor-wrapper.ts +0 -279
|
@@ -12,7 +12,7 @@ export declare class MonacoEditorDecorationApplier extends Disposable {
|
|
|
12
12
|
private decorations;
|
|
13
13
|
constructor(editor: IMonacoCodeEditor);
|
|
14
14
|
private getEditorUri;
|
|
15
|
-
applyDecorationFromProvider
|
|
15
|
+
private applyDecorationFromProvider;
|
|
16
16
|
dispose(): void;
|
|
17
17
|
clearDecorations(): void;
|
|
18
18
|
deltaDecoration(key: string, decorations: monaco.editor.IModelDeltaDecoration[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoration-applier.d.ts","sourceRoot":"","sources":["../../src/browser/decoration-applier.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAwB,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAKL,kCAAkC,EAEnC,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAE1G,qBACa,6BAA8B,SAAQ,UAAU;IAY/C,OAAO,CAAC,MAAM;IAV1B,iBAAiB,EAAE,kCAAkC,CAAC;IAGtD,YAAY,EAAE,aAAa,CAAC;IAG5B,QAAQ,EAAE,SAAS,CAAC;IAEpB,OAAO,CAAC,WAAW,CAA0E;gBAEzE,MAAM,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"decoration-applier.d.ts","sourceRoot":"","sources":["../../src/browser/decoration-applier.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAwB,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAKL,kCAAkC,EAEnC,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAE1G,qBACa,6BAA8B,SAAQ,UAAU;IAY/C,OAAO,CAAC,MAAM;IAV1B,iBAAiB,EAAE,kCAAkC,CAAC;IAGtD,YAAY,EAAE,aAAa,CAAC;IAG5B,QAAQ,EAAE,SAAS,CAAC;IAEpB,OAAO,CAAC,WAAW,CAA0E;gBAEzE,MAAM,EAAE,iBAAiB;IAyB7C,OAAO,CAAC,YAAY;YASN,2BAA2B;IAqBzC,OAAO;IAKP,gBAAgB;IAQhB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;IAiB/E,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE;IA6B/D,yBAAyB,CACvB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,wBAAwB,GACjC;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE;CAqB3E"}
|
|
@@ -13,13 +13,13 @@ let MonacoEditorDecorationApplier = class MonacoEditorDecorationApplier extends
|
|
|
13
13
|
this.editor = editor;
|
|
14
14
|
this.decorations = new Map();
|
|
15
15
|
this.applyDecorationFromProvider();
|
|
16
|
-
this.
|
|
16
|
+
this.editor.onDidChangeModel(() => {
|
|
17
17
|
this.clearDecorations();
|
|
18
18
|
this.applyDecorationFromProvider();
|
|
19
|
-
})
|
|
20
|
-
this.
|
|
19
|
+
});
|
|
20
|
+
this.editor.onDidDispose(() => {
|
|
21
21
|
this.dispose();
|
|
22
|
-
})
|
|
22
|
+
});
|
|
23
23
|
this.addDispose(this.eventBus.on(types_1.EditorDecorationChangeEvent, (e) => {
|
|
24
24
|
const currentUri = this.getEditorUri();
|
|
25
25
|
if (currentUri && e.payload.uri.isEqual(currentUri)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoration-applier.js","sourceRoot":"","sources":["../../src/browser/decoration-applier.ts"],"names":[],"mappings":";;;;AAAA,oEAA6B;AAE7B,qCAAqD;AACrD,+DAAwF;AAExF,mDAAoD;AAIpD,mCAOiB;AAKV,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,4BAAU;IAY3D,YAAoB,MAAyB;QAC3C,KAAK,EAAE,CAAC;QADU,WAAM,GAAN,MAAM,CAAmB;QAFrC,gBAAW,GAAgE,IAAI,GAAG,EAAE,CAAC;QAI3F,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACnC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"decoration-applier.js","sourceRoot":"","sources":["../../src/browser/decoration-applier.ts"],"names":[],"mappings":";;;;AAAA,oEAA6B;AAE7B,qCAAqD;AACrD,+DAAwF;AAExF,mDAAoD;AAIpD,mCAOiB;AAKV,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,4BAAU;IAY3D,YAAoB,MAAyB;QAC3C,KAAK,EAAE,CAAC;QADU,WAAM,GAAN,MAAM,CAAmB;QAFrC,gBAAW,GAAgE,IAAI,GAAG,EAAE,CAAC;QAI3F,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE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C,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,kBAAkB,CAAC;QACxD,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAC1B,GAA6D;IAE7D,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;QACzB,OAAO,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,GAA6B;IACrD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO;YACL,KAAK,EAAE,GAAG;YACV,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Injector } from '@opensumi/di';
|
|
2
|
-
import { IContextKeyService, PreferenceService } from '@opensumi/ide-core-browser';
|
|
2
|
+
import { IContextKeyService, IRange, PreferenceService } from '@opensumi/ide-core-browser';
|
|
3
3
|
import { MonacoService } from '@opensumi/ide-core-browser/lib/monaco';
|
|
4
|
-
import { Event, ILineChange, URI, WithEventBus } from '@opensumi/ide-core-common';
|
|
4
|
+
import { Disposable, Event, ILineChange, URI, WithEventBus } from '@opensumi/ide-core-common';
|
|
5
5
|
import * as monaco from '@opensumi/ide-monaco';
|
|
6
6
|
import { IConfigurationService } from '@opensumi/monaco-editor-core/esm/vs/platform/configuration/common/configuration';
|
|
7
|
-
import { CursorStatus, EditorCollectionService, EditorType, ICodeEditor, IDiffEditor, IEditor, IResourceOpenOptions } from '../common';
|
|
8
|
-
import { IEditorDocumentModelRef } from '../common/editor';
|
|
9
|
-
import {
|
|
10
|
-
import { BaseMonacoEditorWrapper, ISumiEditor } from './base-editor-wrapper';
|
|
7
|
+
import { CursorStatus, EditorCollectionService, EditorType, ICodeEditor, IDecorationApplyOptions, IDiffEditor, IEditor, IResourceOpenOptions, IUndoStopOptions } from '../common';
|
|
8
|
+
import { IEditorDocumentModel, IEditorDocumentModelRef } from '../common/editor';
|
|
9
|
+
import { MonacoEditorDecorationApplier } from './decoration-applier';
|
|
11
10
|
import { EditorDocumentModelContentChangedEvent, IEditorDocumentModelService } from './doc-model/types';
|
|
12
11
|
import { EditorFeatureRegistryImpl } from './feature';
|
|
13
12
|
import { BrowserMultiDiffEditor } from './multi-diff/multi-diff-editor';
|
|
@@ -20,19 +19,10 @@ export declare class EditorCollectionServiceImpl extends WithEventBus implements
|
|
|
20
19
|
protected readonly editorFeatureRegistry: EditorFeatureRegistryImpl;
|
|
21
20
|
private _editors;
|
|
22
21
|
private _diffEditors;
|
|
23
|
-
private _multiDiffEditors;
|
|
24
22
|
private _onCodeEditorCreate;
|
|
25
23
|
private _onDiffEditorCreate;
|
|
26
|
-
private _onMultiDiffEditorCreate;
|
|
27
|
-
private _onCodeEditorChange;
|
|
28
|
-
private _onDiffEditorChange;
|
|
29
|
-
private _onMultiDiffEditorChange;
|
|
30
24
|
onCodeEditorCreate: Event<ICodeEditor>;
|
|
31
25
|
onDiffEditorCreate: Event<IDiffEditor>;
|
|
32
|
-
onMultiDiffEditorCreate: Event<IMultiDiffEditor>;
|
|
33
|
-
onCodeEditorChange: Event<void>;
|
|
34
|
-
onDiffEditorChange: Event<void>;
|
|
35
|
-
onMultiDiffEditorChange: Event<void>;
|
|
36
26
|
documentModelService: IEditorDocumentModelService;
|
|
37
27
|
private _currentEditor;
|
|
38
28
|
get currentEditor(): IEditor | undefined;
|
|
@@ -56,11 +46,51 @@ export declare class EditorCollectionServiceImpl extends WithEventBus implements
|
|
|
56
46
|
listDiffEditors(): IDiffEditor[];
|
|
57
47
|
addDiffEditors(diffEditors: IDiffEditor[]): void;
|
|
58
48
|
removeDiffEditors(diffEditors: IDiffEditor[]): void;
|
|
59
|
-
listMultiDiffEditors(): IMultiDiffEditor[];
|
|
60
|
-
addMultiDiffEditors(multiDiffEditors: IMultiDiffEditor[]): void;
|
|
61
|
-
removeMultiDiffEditors(multiDiffEditors: IMultiDiffEditor[]): void;
|
|
62
49
|
onDocModelContentChangedEvent(e: EditorDocumentModelContentChangedEvent): void;
|
|
63
50
|
}
|
|
51
|
+
export type ISumiEditor = IEditor;
|
|
52
|
+
export declare function insertSnippetWithMonacoEditor(editor: IMonacoCodeEditor, template: string, ranges: IRange[], opts: IUndoStopOptions): void;
|
|
53
|
+
export declare abstract class BaseMonacoEditorWrapper extends WithEventBus implements IEditor {
|
|
54
|
+
readonly monacoEditor: IMonacoCodeEditor;
|
|
55
|
+
private type;
|
|
56
|
+
abstract readonly currentDocumentModel: IEditorDocumentModel | null;
|
|
57
|
+
get currentUri(): URI | null;
|
|
58
|
+
getId(): string;
|
|
59
|
+
getSelections(): monaco.Selection[];
|
|
60
|
+
onFocus: monaco.Event<void>;
|
|
61
|
+
onBlur: monaco.Event<void>;
|
|
62
|
+
protected _specialEditorOptions: any;
|
|
63
|
+
protected _specialModelOptions: monaco.editor.ITextModelUpdateOptions;
|
|
64
|
+
protected _editorOptionsFromContribution: any;
|
|
65
|
+
protected readonly editorFeatureRegistry: IEditorFeatureRegistry;
|
|
66
|
+
protected readonly configurationService: IConfigurationService;
|
|
67
|
+
protected readonly decorationApplier: MonacoEditorDecorationApplier;
|
|
68
|
+
private _disableSelectionEmitter;
|
|
69
|
+
protected disableSelectionEmitter(): void;
|
|
70
|
+
protected enableSelectionEmitter(): void;
|
|
71
|
+
private injector;
|
|
72
|
+
constructor(monacoEditor: IMonacoCodeEditor, type: EditorType);
|
|
73
|
+
private onDidChangeModel;
|
|
74
|
+
getType(): EditorType;
|
|
75
|
+
updateOptions(editorOptions?: monaco.editor.IEditorOptions, modelOptions?: monaco.editor.ITextModelUpdateOptions): void;
|
|
76
|
+
private _doUpdateOptions;
|
|
77
|
+
/**
|
|
78
|
+
* 合并所有的选项
|
|
79
|
+
* 优先关系: (从高到底)
|
|
80
|
+
* 1. 当前编辑器的特殊选项(通过调用 updateOptions或者启动时传入)
|
|
81
|
+
* 2. 来自 featureRegistry 的根据 当前uri 提供的选项
|
|
82
|
+
* 3. 来自偏好设置的选项
|
|
83
|
+
*/
|
|
84
|
+
private _calculateFinalOptions;
|
|
85
|
+
insertSnippet(template: string, ranges: IRange[], opts: IUndoStopOptions): void;
|
|
86
|
+
applyDecoration(key: string, options: IDecorationApplyOptions[]): void;
|
|
87
|
+
onSelectionsChanged(listener: any): import("@opensumi/monaco-editor-core/esm/vs/base/common/lifecycle").IDisposable;
|
|
88
|
+
onVisibleRangesChanged(listener: any): Disposable;
|
|
89
|
+
setSelections(selections: any): void;
|
|
90
|
+
setSelection(selection: any): void;
|
|
91
|
+
save(): Promise<void>;
|
|
92
|
+
onConfigurationChanged(listener: any): import("@opensumi/monaco-editor-core/esm/vs/base/common/lifecycle").IDisposable;
|
|
93
|
+
}
|
|
64
94
|
export declare class BrowserCodeEditor extends BaseMonacoEditorWrapper implements ICodeEditor {
|
|
65
95
|
readonly monacoEditor: IMonacoCodeEditor;
|
|
66
96
|
private collectionService;
|
|
@@ -71,7 +101,7 @@ export declare class BrowserCodeEditor extends BaseMonacoEditorWrapper implement
|
|
|
71
101
|
onCursorPositionChanged: Event<CursorStatus>;
|
|
72
102
|
private _onRefOpen;
|
|
73
103
|
onRefOpen: Event<IEditorDocumentModelRef>;
|
|
74
|
-
get currentDocumentModel():
|
|
104
|
+
get currentDocumentModel(): IEditorDocumentModel | null;
|
|
75
105
|
getType(): EditorType;
|
|
76
106
|
constructor(monacoEditor: IMonacoCodeEditor, options?: any);
|
|
77
107
|
layout(dimension?: monaco.IDimension, postponeRendering?: boolean): void;
|
|
@@ -85,10 +115,11 @@ export declare class BrowserDiffEditor extends WithEventBus implements IDiffEdit
|
|
|
85
115
|
readonly monacoDiffEditor: IMonacoDiffEditor;
|
|
86
116
|
private specialOptions;
|
|
87
117
|
private collectionService;
|
|
118
|
+
private appConfig;
|
|
88
119
|
private originalDocModelRef;
|
|
89
120
|
private modifiedDocModelRef;
|
|
90
|
-
get originalDocModel():
|
|
91
|
-
get modifiedDocModel():
|
|
121
|
+
get originalDocModel(): IEditorDocumentModel | null;
|
|
122
|
+
get modifiedDocModel(): IEditorDocumentModel | null;
|
|
92
123
|
originalEditor: ISumiEditor;
|
|
93
124
|
modifiedEditor: ISumiEditor;
|
|
94
125
|
_disposed: boolean;
|
|
@@ -116,4 +147,9 @@ export declare class BrowserDiffEditor extends WithEventBus implements IDiffEdit
|
|
|
116
147
|
focus(): void;
|
|
117
148
|
dispose(): void;
|
|
118
149
|
}
|
|
150
|
+
export declare class DiffEditorPart extends BaseMonacoEditorWrapper implements IEditor {
|
|
151
|
+
private getDocumentModel;
|
|
152
|
+
get currentDocumentModel(): IEditorDocumentModel | null;
|
|
153
|
+
constructor(monacoEditor: IMonacoCodeEditor, getDocumentModel: () => IEditorDocumentModel | null, type: EditorType);
|
|
154
|
+
}
|
|
119
155
|
//# sourceMappingURL=editor-collection.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-collection.service.d.ts","sourceRoot":"","sources":["../../src/browser/editor-collection.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"editor-collection.service.d.ts","sourceRoot":"","sources":["../../src/browser/editor-collection.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAa,kBAAkB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEtG,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EACL,UAAU,EAEV,KAAK,EAEL,WAAW,EAGX,GAAG,EACH,YAAY,EAGb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pl = void 0;
|
|
3
|
+
exports.DiffEditorPart = exports.BrowserDiffEditor = exports.BrowserCodeEditor = exports.BaseMonacoEditorWrapper = exports.EditorCollectionServiceImpl = void 0;
|
|
4
|
+
exports.insertSnippetWithMonacoEditor = insertSnippetWithMonacoEditor;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const di_1 = require("@opensumi/di");
|
|
6
7
|
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
7
8
|
const contextkey_1 = require("@opensumi/ide-core-browser/lib/contextkey");
|
|
8
9
|
const monaco_1 = require("@opensumi/ide-core-browser/lib/monaco");
|
|
9
10
|
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
11
|
+
const monaco = tslib_1.__importStar(require("@opensumi/ide-monaco"));
|
|
10
12
|
const configuration_1 = require("@opensumi/monaco-editor-core/esm/vs/platform/configuration/common/configuration");
|
|
11
13
|
const common_1 = require("../common");
|
|
12
14
|
const editor_1 = require("../common/editor");
|
|
13
|
-
const
|
|
15
|
+
const decoration_applier_1 = require("./decoration-applier");
|
|
14
16
|
const types_1 = require("./doc-model/types");
|
|
15
17
|
const feature_1 = require("./feature");
|
|
16
18
|
const multi_diff_editor_1 = require("./multi-diff/multi-diff-editor");
|
|
17
19
|
const converter_1 = require("./preference/converter");
|
|
18
20
|
const types_2 = require("./types");
|
|
21
|
+
const { removeUndefined } = ide_core_common_1.objects;
|
|
19
22
|
let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_core_common_1.WithEventBus {
|
|
20
23
|
get currentEditor() {
|
|
21
24
|
return this._currentEditor;
|
|
@@ -24,19 +27,10 @@ let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_
|
|
|
24
27
|
super();
|
|
25
28
|
this._editors = new Set();
|
|
26
29
|
this._diffEditors = new Set();
|
|
27
|
-
this._multiDiffEditors = new Set();
|
|
28
30
|
this._onCodeEditorCreate = new ide_core_common_1.Emitter();
|
|
29
31
|
this._onDiffEditorCreate = new ide_core_common_1.Emitter();
|
|
30
|
-
this._onMultiDiffEditorCreate = new ide_core_common_1.Emitter();
|
|
31
|
-
this._onCodeEditorChange = new ide_core_common_1.Emitter();
|
|
32
|
-
this._onDiffEditorChange = new ide_core_common_1.Emitter();
|
|
33
|
-
this._onMultiDiffEditorChange = new ide_core_common_1.Emitter();
|
|
34
32
|
this.onCodeEditorCreate = this._onCodeEditorCreate.event;
|
|
35
33
|
this.onDiffEditorCreate = this._onDiffEditorCreate.event;
|
|
36
|
-
this.onMultiDiffEditorCreate = this._onMultiDiffEditorCreate.event;
|
|
37
|
-
this.onCodeEditorChange = this._onCodeEditorChange.event;
|
|
38
|
-
this.onDiffEditorChange = this._onDiffEditorChange.event;
|
|
39
|
-
this.onMultiDiffEditorChange = this._onMultiDiffEditorChange.event;
|
|
40
34
|
this.addDispose(this.editorFeatureRegistry.onDidRegisterFeature((contribution) => {
|
|
41
35
|
this._editors.forEach((editor) => {
|
|
42
36
|
this.editorFeatureRegistry.runOneContribution(editor, contribution);
|
|
@@ -64,16 +58,7 @@ let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_
|
|
|
64
58
|
addEditors(editors) {
|
|
65
59
|
const beforeSize = this._editors.size;
|
|
66
60
|
editors.forEach((editor) => {
|
|
67
|
-
|
|
68
|
-
// 查找是否存在相同 URI 的 editor
|
|
69
|
-
const existingEditor = Array.from(this._editors).find((e) => e.currentUri && editor.currentUri && e.currentUri.isEqual(editor.currentUri));
|
|
70
|
-
// 如果存在相同 URI 的 editor,先移除它
|
|
71
|
-
if (existingEditor) {
|
|
72
|
-
if (existingEditor.monacoEditor.getId() === editor.monacoEditor.getId()) {
|
|
73
|
-
exist = true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (!exist) {
|
|
61
|
+
if (!this._editors.has(editor)) {
|
|
77
62
|
this._editors.add(editor);
|
|
78
63
|
this.editorFeatureRegistry.runContributions(editor);
|
|
79
64
|
editor.monacoEditor.onDidFocusEditorWidget(() => {
|
|
@@ -83,13 +68,9 @@ let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_
|
|
|
83
68
|
this._currentEditor = editor;
|
|
84
69
|
});
|
|
85
70
|
}
|
|
86
|
-
else {
|
|
87
|
-
editor.decorationApplier.clearDecorations();
|
|
88
|
-
editor.decorationApplier.applyDecorationFromProvider();
|
|
89
|
-
}
|
|
90
71
|
});
|
|
91
72
|
if (this._editors.size !== beforeSize) {
|
|
92
|
-
|
|
73
|
+
// fire event;
|
|
93
74
|
}
|
|
94
75
|
}
|
|
95
76
|
removeEditors(editors) {
|
|
@@ -101,7 +82,7 @@ let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_
|
|
|
101
82
|
}
|
|
102
83
|
});
|
|
103
84
|
if (this._editors.size !== beforeSize) {
|
|
104
|
-
|
|
85
|
+
// fire event;
|
|
105
86
|
}
|
|
106
87
|
}
|
|
107
88
|
createDiffEditor(dom, options, overrides) {
|
|
@@ -116,7 +97,7 @@ let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_
|
|
|
116
97
|
const convertedOptions = (0, converter_1.getConvertedMonacoOptions)(this.configurationService);
|
|
117
98
|
const monacoMultiDiffEditorWidget = this.monacoService.createMultiDiffEditorWidget(dom, overrides);
|
|
118
99
|
const mergedOptions = { ...convertedOptions.diffOptions, ...options };
|
|
119
|
-
const editor = this.injector.get(multi_diff_editor_1.BrowserMultiDiffEditor, [monacoMultiDiffEditorWidget, mergedOptions
|
|
100
|
+
const editor = this.injector.get(multi_diff_editor_1.BrowserMultiDiffEditor, [monacoMultiDiffEditorWidget, mergedOptions]);
|
|
120
101
|
return editor;
|
|
121
102
|
}
|
|
122
103
|
createMergeEditor(dom, options, overrides) {
|
|
@@ -142,7 +123,7 @@ let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_
|
|
|
142
123
|
}
|
|
143
124
|
});
|
|
144
125
|
if (this._diffEditors.size !== beforeSize) {
|
|
145
|
-
|
|
126
|
+
// fire event _onDiffEditorAdd;
|
|
146
127
|
}
|
|
147
128
|
}
|
|
148
129
|
removeDiffEditors(diffEditors) {
|
|
@@ -151,32 +132,10 @@ let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_
|
|
|
151
132
|
this._diffEditors.delete(diffEditor);
|
|
152
133
|
});
|
|
153
134
|
if (this._diffEditors.size !== beforeSize) {
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
listMultiDiffEditors() {
|
|
158
|
-
return Array.from(this._multiDiffEditors.values());
|
|
159
|
-
}
|
|
160
|
-
addMultiDiffEditors(multiDiffEditors) {
|
|
161
|
-
const beforeSize = this._multiDiffEditors.size;
|
|
162
|
-
multiDiffEditors.forEach((multiDiffEditor) => {
|
|
163
|
-
if (!this._multiDiffEditors.has(multiDiffEditor)) {
|
|
164
|
-
this._multiDiffEditors.add(multiDiffEditor);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
if (this._multiDiffEditors.size !== beforeSize) {
|
|
168
|
-
this._onMultiDiffEditorChange.fire();
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
removeMultiDiffEditors(multiDiffEditors) {
|
|
172
|
-
const beforeSize = this._multiDiffEditors.size;
|
|
173
|
-
multiDiffEditors.forEach((multiDiffEditor) => {
|
|
174
|
-
this._multiDiffEditors.delete(multiDiffEditor);
|
|
175
|
-
});
|
|
176
|
-
if (this._multiDiffEditors.size !== beforeSize) {
|
|
177
|
-
this._onMultiDiffEditorChange.fire();
|
|
135
|
+
// fire event _onDiffEditorRemove;
|
|
178
136
|
}
|
|
179
137
|
}
|
|
138
|
+
// 将docModel的变更事件反映至resource的dirty装饰
|
|
180
139
|
onDocModelContentChangedEvent(e) {
|
|
181
140
|
this.eventBus.fire(new common_1.ResourceDecorationNeedChangeEvent({
|
|
182
141
|
uri: e.payload.uri,
|
|
@@ -218,7 +177,181 @@ exports.EditorCollectionServiceImpl = EditorCollectionServiceImpl = tslib_1.__de
|
|
|
218
177
|
(0, di_1.Injectable)(),
|
|
219
178
|
tslib_1.__metadata("design:paramtypes", [])
|
|
220
179
|
], EditorCollectionServiceImpl);
|
|
221
|
-
|
|
180
|
+
function insertSnippetWithMonacoEditor(editor, template, ranges, opts) {
|
|
181
|
+
const snippetController = editor.getContribution('snippetController2');
|
|
182
|
+
const selections = ranges.map((r) => new monaco.Selection(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn));
|
|
183
|
+
editor.setSelections(selections);
|
|
184
|
+
editor.focus();
|
|
185
|
+
snippetController.insert(template, 0, 0, opts.undoStopBefore, opts.undoStopAfter);
|
|
186
|
+
}
|
|
187
|
+
function updateOptionsWithMonacoEditor(monacoEditor, editorOptions, modelOptions) {
|
|
188
|
+
monacoEditor.updateOptions(editorOptions);
|
|
189
|
+
if (monacoEditor.getModel()) {
|
|
190
|
+
monacoEditor.getModel().updateOptions(modelOptions);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
let BaseMonacoEditorWrapper = class BaseMonacoEditorWrapper extends ide_core_common_1.WithEventBus {
|
|
194
|
+
get currentUri() {
|
|
195
|
+
return this.currentDocumentModel ? this.currentDocumentModel.uri : null;
|
|
196
|
+
}
|
|
197
|
+
getId() {
|
|
198
|
+
return this.monacoEditor.getId();
|
|
199
|
+
}
|
|
200
|
+
getSelections() {
|
|
201
|
+
return this.monacoEditor.getSelections() || [];
|
|
202
|
+
}
|
|
203
|
+
disableSelectionEmitter() {
|
|
204
|
+
this._disableSelectionEmitter = true;
|
|
205
|
+
}
|
|
206
|
+
enableSelectionEmitter() {
|
|
207
|
+
this._disableSelectionEmitter = false;
|
|
208
|
+
}
|
|
209
|
+
constructor(monacoEditor, type) {
|
|
210
|
+
super();
|
|
211
|
+
this.monacoEditor = monacoEditor;
|
|
212
|
+
this.type = type;
|
|
213
|
+
this.onFocus = this.monacoEditor.onDidFocusEditorWidget;
|
|
214
|
+
this.onBlur = this.monacoEditor.onDidBlurEditorWidget;
|
|
215
|
+
this._specialEditorOptions = {};
|
|
216
|
+
this._specialModelOptions = {};
|
|
217
|
+
this._editorOptionsFromContribution = {};
|
|
218
|
+
this._disableSelectionEmitter = false;
|
|
219
|
+
this.decorationApplier = this.injector.get(decoration_applier_1.MonacoEditorDecorationApplier, [this.monacoEditor]);
|
|
220
|
+
this.addDispose(this.monacoEditor.onDidChangeModel(this.onDidChangeModel.bind(this)));
|
|
221
|
+
this.addDispose(this.monacoEditor.onDidChangeModelLanguage(() => {
|
|
222
|
+
this._doUpdateOptions();
|
|
223
|
+
}));
|
|
224
|
+
this.addDispose(this.configurationService.onDidChangeConfiguration((e) => {
|
|
225
|
+
const changedEditorKeys = Array.from(e.affectedKeys.values()).filter((key) => (0, converter_1.isEditorOption)(key));
|
|
226
|
+
if (changedEditorKeys.length > 0) {
|
|
227
|
+
this._doUpdateOptions();
|
|
228
|
+
}
|
|
229
|
+
}));
|
|
230
|
+
}
|
|
231
|
+
async onDidChangeModel() {
|
|
232
|
+
this._editorOptionsFromContribution = {};
|
|
233
|
+
const uri = this.currentUri;
|
|
234
|
+
if (uri) {
|
|
235
|
+
Promise.resolve(this.editorFeatureRegistry.runProvideEditorOptionsForUri(uri)).then((options) => {
|
|
236
|
+
if (!this.currentUri || !uri.isEqual(this.currentUri)) {
|
|
237
|
+
return; // uri可能已经变了
|
|
238
|
+
}
|
|
239
|
+
if (options && Object.keys(options).length > 0) {
|
|
240
|
+
this._editorOptionsFromContribution = options;
|
|
241
|
+
if (!(0, ide_core_common_1.isEmptyObject)(this._editorOptionsFromContribution)) {
|
|
242
|
+
this._doUpdateOptions();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
getType() {
|
|
249
|
+
return this.type;
|
|
250
|
+
}
|
|
251
|
+
updateOptions(editorOptions = {}, modelOptions = {}) {
|
|
252
|
+
this._specialEditorOptions = removeUndefined({ ...this._specialEditorOptions, ...editorOptions });
|
|
253
|
+
this._specialModelOptions = removeUndefined({ ...this._specialModelOptions, ...modelOptions });
|
|
254
|
+
this._doUpdateOptions();
|
|
255
|
+
}
|
|
256
|
+
_doUpdateOptions() {
|
|
257
|
+
const { editorOptions, modelOptions } = this._calculateFinalOptions();
|
|
258
|
+
updateOptionsWithMonacoEditor(this.monacoEditor, editorOptions, modelOptions);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* 合并所有的选项
|
|
262
|
+
* 优先关系: (从高到底)
|
|
263
|
+
* 1. 当前编辑器的特殊选项(通过调用 updateOptions或者启动时传入)
|
|
264
|
+
* 2. 来自 featureRegistry 的根据 当前uri 提供的选项
|
|
265
|
+
* 3. 来自偏好设置的选项
|
|
266
|
+
*/
|
|
267
|
+
_calculateFinalOptions() {
|
|
268
|
+
var _a;
|
|
269
|
+
const uriStr = this.currentUri ? this.currentUri.toString() : undefined;
|
|
270
|
+
const languageId = this.currentDocumentModel ? this.currentDocumentModel.languageId : undefined;
|
|
271
|
+
const options = (0, converter_1.getConvertedMonacoOptions)(this.configurationService, uriStr, languageId, undefined);
|
|
272
|
+
const basicEditorOptions = {
|
|
273
|
+
readOnly: ((_a = this.currentDocumentModel) === null || _a === void 0 ? void 0 : _a.readonly) || false,
|
|
274
|
+
};
|
|
275
|
+
let editorOptions = {
|
|
276
|
+
...basicEditorOptions,
|
|
277
|
+
...options.editorOptions,
|
|
278
|
+
...this._editorOptionsFromContribution,
|
|
279
|
+
...this._specialEditorOptions,
|
|
280
|
+
};
|
|
281
|
+
if (this.type !== common_1.EditorType.CODE) {
|
|
282
|
+
editorOptions = {
|
|
283
|
+
...editorOptions,
|
|
284
|
+
...options.diffOptions,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
return {
|
|
288
|
+
editorOptions,
|
|
289
|
+
modelOptions: { ...options.modelOptions, ...this._specialModelOptions },
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
insertSnippet(template, ranges, opts) {
|
|
293
|
+
insertSnippetWithMonacoEditor(this.monacoEditor, template, ranges, opts);
|
|
294
|
+
}
|
|
295
|
+
applyDecoration(key, options) {
|
|
296
|
+
this.decorationApplier.applyDecoration(key, options);
|
|
297
|
+
}
|
|
298
|
+
onSelectionsChanged(listener) {
|
|
299
|
+
return this.monacoEditor.onDidChangeCursorSelection((e) => {
|
|
300
|
+
if (!this._disableSelectionEmitter) {
|
|
301
|
+
listener({
|
|
302
|
+
selections: this.getSelections(),
|
|
303
|
+
source: e.source,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
onVisibleRangesChanged(listener) {
|
|
309
|
+
const disposer = new ide_core_common_1.Disposable();
|
|
310
|
+
const monacoEditor = this.monacoEditor;
|
|
311
|
+
disposer.addDispose(monacoEditor.onDidScrollChange((e) => {
|
|
312
|
+
listener(this.monacoEditor.getVisibleRanges());
|
|
313
|
+
}));
|
|
314
|
+
disposer.addDispose(monacoEditor.onDidLayoutChange((e) => {
|
|
315
|
+
listener(this.monacoEditor.getVisibleRanges());
|
|
316
|
+
}));
|
|
317
|
+
return disposer;
|
|
318
|
+
}
|
|
319
|
+
setSelections(selections) {
|
|
320
|
+
return this.monacoEditor.setSelections(selections);
|
|
321
|
+
}
|
|
322
|
+
setSelection(selection) {
|
|
323
|
+
return this.monacoEditor.setSelection(selection);
|
|
324
|
+
}
|
|
325
|
+
async save() {
|
|
326
|
+
if (this.currentDocumentModel) {
|
|
327
|
+
await this.currentDocumentModel.save();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
onConfigurationChanged(listener) {
|
|
331
|
+
const monacoEditor = this.monacoEditor;
|
|
332
|
+
return monacoEditor.onDidChangeConfiguration((e) => {
|
|
333
|
+
listener();
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
exports.BaseMonacoEditorWrapper = BaseMonacoEditorWrapper;
|
|
338
|
+
tslib_1.__decorate([
|
|
339
|
+
(0, di_1.Autowired)(types_2.IEditorFeatureRegistry),
|
|
340
|
+
tslib_1.__metadata("design:type", Object)
|
|
341
|
+
], BaseMonacoEditorWrapper.prototype, "editorFeatureRegistry", void 0);
|
|
342
|
+
tslib_1.__decorate([
|
|
343
|
+
(0, di_1.Autowired)(configuration_1.IConfigurationService),
|
|
344
|
+
tslib_1.__metadata("design:type", Object)
|
|
345
|
+
], BaseMonacoEditorWrapper.prototype, "configurationService", void 0);
|
|
346
|
+
tslib_1.__decorate([
|
|
347
|
+
(0, di_1.Autowired)(di_1.INJECTOR_TOKEN),
|
|
348
|
+
tslib_1.__metadata("design:type", di_1.Injector)
|
|
349
|
+
], BaseMonacoEditorWrapper.prototype, "injector", void 0);
|
|
350
|
+
exports.BaseMonacoEditorWrapper = BaseMonacoEditorWrapper = tslib_1.__decorate([
|
|
351
|
+
(0, di_1.Injectable)({ multiple: true }),
|
|
352
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object])
|
|
353
|
+
], BaseMonacoEditorWrapper);
|
|
354
|
+
let BrowserCodeEditor = class BrowserCodeEditor extends BaseMonacoEditorWrapper {
|
|
222
355
|
get currentDocumentModel() {
|
|
223
356
|
if (this._currentDocumentModelRef && !this._currentDocumentModelRef.disposed) {
|
|
224
357
|
return this._currentDocumentModelRef.instance;
|
|
@@ -499,12 +632,12 @@ class BrowserDiffEditor extends ide_core_common_1.WithEventBus {
|
|
|
499
632
|
wrapEditors() {
|
|
500
633
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
501
634
|
const diffEditor = this;
|
|
502
|
-
this.originalEditor = this.injector.get(
|
|
635
|
+
this.originalEditor = this.injector.get(DiffEditorPart, [
|
|
503
636
|
diffEditor.monacoDiffEditor.getOriginalEditor(),
|
|
504
637
|
() => diffEditor.originalDocModel,
|
|
505
638
|
common_1.EditorType.ORIGINAL_DIFF,
|
|
506
639
|
]);
|
|
507
|
-
this.modifiedEditor = this.injector.get(
|
|
640
|
+
this.modifiedEditor = this.injector.get(DiffEditorPart, [
|
|
508
641
|
diffEditor.monacoDiffEditor.getModifiedEditor(),
|
|
509
642
|
() => diffEditor.modifiedDocModel,
|
|
510
643
|
common_1.EditorType.MODIFIED_DIFF,
|
|
@@ -538,6 +671,10 @@ tslib_1.__decorate([
|
|
|
538
671
|
(0, di_1.Autowired)(common_1.EditorCollectionService),
|
|
539
672
|
tslib_1.__metadata("design:type", EditorCollectionServiceImpl)
|
|
540
673
|
], BrowserDiffEditor.prototype, "collectionService", void 0);
|
|
674
|
+
tslib_1.__decorate([
|
|
675
|
+
(0, di_1.Autowired)(ide_core_browser_1.AppConfig),
|
|
676
|
+
tslib_1.__metadata("design:type", Object)
|
|
677
|
+
], BrowserDiffEditor.prototype, "appConfig", void 0);
|
|
541
678
|
tslib_1.__decorate([
|
|
542
679
|
(0, di_1.Autowired)(di_1.INJECTOR_TOKEN),
|
|
543
680
|
tslib_1.__metadata("design:type", di_1.Injector)
|
|
@@ -570,4 +707,18 @@ function preventNavigation(e) {
|
|
|
570
707
|
e.stopPropagation();
|
|
571
708
|
}
|
|
572
709
|
}
|
|
710
|
+
let DiffEditorPart = class DiffEditorPart extends BaseMonacoEditorWrapper {
|
|
711
|
+
get currentDocumentModel() {
|
|
712
|
+
return this.getDocumentModel();
|
|
713
|
+
}
|
|
714
|
+
constructor(monacoEditor, getDocumentModel, type) {
|
|
715
|
+
super(monacoEditor, type);
|
|
716
|
+
this.getDocumentModel = getDocumentModel;
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
exports.DiffEditorPart = DiffEditorPart;
|
|
720
|
+
exports.DiffEditorPart = DiffEditorPart = tslib_1.__decorate([
|
|
721
|
+
(0, di_1.Injectable)({ multiple: true }),
|
|
722
|
+
tslib_1.__metadata("design:paramtypes", [Object, Function, Object])
|
|
723
|
+
], DiffEditorPart);
|
|
573
724
|
//# sourceMappingURL=editor-collection.service.js.map
|