monaco-editor11 1.0.9 → 1.1.1
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/dist/index.d.ts +1 -1
- package/dist/monaco-editor11.es.js +12 -16
- package/dist/monaco-editor11.umd.js +1 -1
- package/package.json +2 -2
- package/dist/monaco.d.ts +0 -8
- package/dist/workers/common/initialize.js +0 -16
- package/dist/workers/common/workers.js +0 -141
- package/dist/workers/editor/common/abstractSyntaxTokenBackend.js +0 -128
- package/dist/workers/editor/common/abstractText.js +0 -89
- package/dist/workers/editor/common/ast.js +0 -485
- package/dist/workers/editor/common/autoIndent.js +0 -390
- package/dist/workers/editor/common/beforeEditPositionMapper.js +0 -110
- package/dist/workers/editor/common/bracketPairsImpl.js +0 -717
- package/dist/workers/editor/common/bracketPairsTree.js +0 -343
- package/dist/workers/editor/common/brackets.js +0 -108
- package/dist/workers/editor/common/characterClassifier.js +0 -59
- package/dist/workers/editor/common/characterPair.js +0 -40
- package/dist/workers/editor/common/colorizedBracketPairsDecorationProvider.js +0 -97
- package/dist/workers/editor/common/columnRange.js +0 -35
- package/dist/workers/editor/common/combineTextEditInfos.js +0 -124
- package/dist/workers/editor/common/common.js +0 -20
- package/dist/workers/editor/common/computeMovedLines.js +0 -249
- package/dist/workers/editor/common/concat23Trees.js +0 -192
- package/dist/workers/editor/common/contiguousMultilineTokens.js +0 -32
- package/dist/workers/editor/common/contiguousMultilineTokensBuilder.js +0 -23
- package/dist/workers/editor/common/contiguousTokensEditing.js +0 -128
- package/dist/workers/editor/common/contiguousTokensStore.js +0 -207
- package/dist/workers/editor/common/coordinatesConverter.js +0 -51
- package/dist/workers/editor/common/cursor.js +0 -899
- package/dist/workers/editor/common/cursorAtomicMoveOperations.js +0 -145
- package/dist/workers/editor/common/cursorCollection.js +0 -194
- package/dist/workers/editor/common/cursorColumnSelection.js +0 -93
- package/dist/workers/editor/common/cursorColumns.js +0 -112
- package/dist/workers/editor/common/cursorCommon.js +0 -250
- package/dist/workers/editor/common/cursorContext.js +0 -15
- package/dist/workers/editor/common/cursorDeleteOperations.js +0 -231
- package/dist/workers/editor/common/cursorMoveCommands.js +0 -676
- package/dist/workers/editor/common/cursorMoveOperations.js +0 -290
- package/dist/workers/editor/common/cursorTypeEditOperations.js +0 -968
- package/dist/workers/editor/common/cursorTypeOperations.js +0 -173
- package/dist/workers/editor/common/cursorUtils.js +0 -75
- package/dist/workers/editor/common/cursorWordOperations.js +0 -720
- package/dist/workers/editor/common/defaultDocumentColorsComputer.js +0 -138
- package/dist/workers/editor/common/defaultLinesDiffComputer.js +0 -188
- package/dist/workers/editor/common/diffAlgorithm.js +0 -139
- package/dist/workers/editor/common/diffEditor.js +0 -38
- package/dist/workers/editor/common/dynamicProgrammingDiffing.js +0 -101
- package/dist/workers/editor/common/edit.js +0 -183
- package/dist/workers/editor/common/editOperation.js +0 -36
- package/dist/workers/editor/common/editStack.js +0 -363
- package/dist/workers/editor/common/editorAction.js +0 -26
- package/dist/workers/editor/common/editorBaseApi.js +0 -43
- package/dist/workers/editor/common/editorColorRegistry.js +0 -102
- package/dist/workers/editor/common/editorCommon.js +0 -13
- package/dist/workers/editor/common/editorConfigurationSchema.js +0 -338
- package/dist/workers/editor/common/editorContextKeys.js +0 -84
- package/dist/workers/editor/common/editorFeatures.js +0 -17
- package/dist/workers/editor/common/editorOptions.js +0 -3440
- package/dist/workers/editor/common/editorTheme.js +0 -23
- package/dist/workers/editor/common/editorWebWorker.js +0 -299
- package/dist/workers/editor/common/editorWorker.js +0 -9
- package/dist/workers/editor/common/editorWorkerHost.js +0 -15
- package/dist/workers/editor/common/editorZoom.js +0 -26
- package/dist/workers/editor/common/electricCharacter.js +0 -55
- package/dist/workers/editor/common/encodedTokenAttributes.js +0 -79
- package/dist/workers/editor/common/enterAction.js +0 -53
- package/dist/workers/editor/common/eolCounter.js +0 -44
- package/dist/workers/editor/common/findSectionHeaders.js +0 -128
- package/dist/workers/editor/common/fixBrackets.js +0 -67
- package/dist/workers/editor/common/fixedArray.js +0 -70
- package/dist/workers/editor/common/fontInfo.js +0 -172
- package/dist/workers/editor/common/fontInfoFromSettings.js +0 -29
- package/dist/workers/editor/common/getIconClasses.js +0 -106
- package/dist/workers/editor/common/getPositionOffsetTransformerFromTextModel.js +0 -24
- package/dist/workers/editor/common/glyphLanesModel.js +0 -61
- package/dist/workers/editor/common/guidesTextModelPart.js +0 -405
- package/dist/workers/editor/common/heuristicSequenceOptimizations.js +0 -374
- package/dist/workers/editor/common/indentRules.js +0 -63
- package/dist/workers/editor/common/indentation.js +0 -39
- package/dist/workers/editor/common/indentationGuesser.js +0 -178
- package/dist/workers/editor/common/indentationLineProcessor.js +0 -193
- package/dist/workers/editor/common/inlineDecorations.js +0 -26
- package/dist/workers/editor/common/inplaceReplaceSupport.js +0 -87
- package/dist/workers/editor/common/inputMode.js +0 -22
- package/dist/workers/editor/common/intervalTree.js +0 -1002
- package/dist/workers/editor/common/language.js +0 -9
- package/dist/workers/editor/common/languageBracketsConfiguration.js +0 -133
- package/dist/workers/editor/common/languageConfiguration.js +0 -138
- package/dist/workers/editor/common/languageConfigurationRegistry.js +0 -361
- package/dist/workers/editor/common/languageFeatureDebounce.js +0 -137
- package/dist/workers/editor/common/languageFeatureRegistry.js +0 -180
- package/dist/workers/editor/common/languageFeatures.js +0 -9
- package/dist/workers/editor/common/languageFeaturesService.js +0 -47
- package/dist/workers/editor/common/languageSelector.js +0 -112
- package/dist/workers/editor/common/languageService.js +0 -92
- package/dist/workers/editor/common/languages.js +0 -522
- package/dist/workers/editor/common/languagesAssociations.js +0 -193
- package/dist/workers/editor/common/languagesRegistry.js +0 -237
- package/dist/workers/editor/common/legacyLinesDiffComputer.js +0 -468
- package/dist/workers/editor/common/length.js +0 -129
- package/dist/workers/editor/common/lineDecorations.js +0 -208
- package/dist/workers/editor/common/lineEdit.js +0 -75
- package/dist/workers/editor/common/lineHeights.js +0 -370
- package/dist/workers/editor/common/linePart.js +0 -25
- package/dist/workers/editor/common/lineRange.js +0 -312
- package/dist/workers/editor/common/lineSequence.js +0 -36
- package/dist/workers/editor/common/lineTokens.js +0 -405
- package/dist/workers/editor/common/linesDiffComputer.js +0 -29
- package/dist/workers/editor/common/linesDiffComputers.js +0 -13
- package/dist/workers/editor/common/linesLayout.js +0 -765
- package/dist/workers/editor/common/linesSliceCharSequence.js +0 -205
- package/dist/workers/editor/common/linkComputer.js +0 -269
- package/dist/workers/editor/common/markerDecorations.js +0 -9
- package/dist/workers/editor/common/markerDecorationsService.js +0 -248
- package/dist/workers/editor/common/minimapTokensColorTracker.js +0 -58
- package/dist/workers/editor/common/mirrorTextModel.js +0 -117
- package/dist/workers/editor/common/model.js +0 -9
- package/dist/workers/editor/common/modelLineProjection.js +0 -350
- package/dist/workers/editor/common/modelLineProjectionData.js +0 -297
- package/dist/workers/editor/common/modelService.js +0 -413
- package/dist/workers/editor/common/modesRegistry.js +0 -75
- package/dist/workers/editor/common/monospaceLineBreaksComputer.js +0 -473
- package/dist/workers/editor/common/myersDiffAlgorithm.js +0 -159
- package/dist/workers/editor/common/nodeReader.js +0 -127
- package/dist/workers/editor/common/nullTokenize.js +0 -29
- package/dist/workers/editor/common/offsetRange.js +0 -225
- package/dist/workers/editor/common/onEnter.js +0 -109
- package/dist/workers/editor/common/oneCursor.js +0 -117
- package/dist/workers/editor/common/overviewZoneManager.js +0 -176
- package/dist/workers/editor/common/parser.js +0 -121
- package/dist/workers/editor/common/pieceTreeBase.js +0 -1473
- package/dist/workers/editor/common/pieceTreeTextBuffer.js +0 -461
- package/dist/workers/editor/common/pieceTreeTextBufferBuilder.js +0 -140
- package/dist/workers/editor/common/point.js +0 -50
- package/dist/workers/editor/common/position.js +0 -142
- package/dist/workers/editor/common/positionToOffset.js +0 -17
- package/dist/workers/editor/common/positionToOffsetImpl.js +0 -98
- package/dist/workers/editor/common/prefixSumComputer.js +0 -226
- package/dist/workers/editor/common/range.js +0 -421
- package/dist/workers/editor/common/rangeMapping.js +0 -229
- package/dist/workers/editor/common/rangeSingleLine.js +0 -17
- package/dist/workers/editor/common/rbTreeBase.js +0 -362
- package/dist/workers/editor/common/rect.js +0 -163
- package/dist/workers/editor/common/replaceCommand.js +0 -158
- package/dist/workers/editor/common/resolverService.js +0 -5
- package/dist/workers/editor/common/rgba.js +0 -35
- package/dist/workers/editor/common/richEditBrackets.js +0 -356
- package/dist/workers/editor/common/selection.js +0 -145
- package/dist/workers/editor/common/semanticTokensDto.js +0 -82
- package/dist/workers/editor/common/semanticTokensProviderStyling.js +0 -263
- package/dist/workers/editor/common/semanticTokensStyling.js +0 -9
- package/dist/workers/editor/common/semanticTokensStylingService.js +0 -47
- package/dist/workers/editor/common/shiftCommand.js +0 -241
- package/dist/workers/editor/common/smallImmutableSet.js +0 -108
- package/dist/workers/editor/common/sparseMultilineTokens.js +0 -548
- package/dist/workers/editor/common/sparseTokensStore.js +0 -210
- package/dist/workers/editor/common/standaloneEnums.js +0 -1017
- package/dist/workers/editor/common/standaloneStrings.js +0 -42
- package/dist/workers/editor/common/stringBuilder.js +0 -122
- package/dist/workers/editor/common/stringEdit.js +0 -165
- package/dist/workers/editor/common/supports.js +0 -58
- package/dist/workers/editor/common/surroundSelectionCommand.js +0 -44
- package/dist/workers/editor/common/textChange.js +0 -248
- package/dist/workers/editor/common/textEdit.js +0 -269
- package/dist/workers/editor/common/textLength.js +0 -87
- package/dist/workers/editor/common/textModel.js +0 -2031
- package/dist/workers/editor/common/textModelBracketPairs.js +0 -45
- package/dist/workers/editor/common/textModelDefaults.js +0 -18
- package/dist/workers/editor/common/textModelEditSource.js +0 -166
- package/dist/workers/editor/common/textModelEvents.js +0 -216
- package/dist/workers/editor/common/textModelGuides.js +0 -40
- package/dist/workers/editor/common/textModelPart.js +0 -23
- package/dist/workers/editor/common/textModelSearch.js +0 -455
- package/dist/workers/editor/common/textModelStringEdit.js +0 -11
- package/dist/workers/editor/common/textModelSync.impl.js +0 -307
- package/dist/workers/editor/common/textModelText.js +0 -26
- package/dist/workers/editor/common/textModelTokens.js +0 -436
- package/dist/workers/editor/common/textResourceConfiguration.js +0 -6
- package/dist/workers/editor/common/textToHtmlTokenizer.js +0 -139
- package/dist/workers/editor/common/tokenStore.js +0 -407
- package/dist/workers/editor/common/tokenWithTextArray.js +0 -73
- package/dist/workers/editor/common/tokenization.js +0 -287
- package/dist/workers/editor/common/tokenizationRegistry.js +0 -123
- package/dist/workers/editor/common/tokenizationTextModelPart.js +0 -275
- package/dist/workers/editor/common/tokenizer.js +0 -301
- package/dist/workers/editor/common/tokenizerSyntaxTokenBackend.js +0 -261
- package/dist/workers/editor/common/treeSitterLibraryService.js +0 -9
- package/dist/workers/editor/common/treeSitterSyntaxTokenBackend.js +0 -167
- package/dist/workers/editor/common/treeSitterThemeService.js +0 -9
- package/dist/workers/editor/common/treeSitterTokenizationImpl.js +0 -713
- package/dist/workers/editor/common/treeSitterTree.js +0 -395
- package/dist/workers/editor/common/treeViewsDnd.js +0 -24
- package/dist/workers/editor/common/treeViewsDndService.js +0 -12
- package/dist/workers/editor/common/trimTrailingWhitespaceCommand.js +0 -98
- package/dist/workers/editor/common/unicodeTextModelHighlighter.js +0 -188
- package/dist/workers/editor/common/utils.js +0 -62
- package/dist/workers/editor/common/viewContext.js +0 -22
- package/dist/workers/editor/common/viewEventHandler.js +0 -186
- package/dist/workers/editor/common/viewEvents.js +0 -180
- package/dist/workers/editor/common/viewLayout.js +0 -368
- package/dist/workers/editor/common/viewLineRenderer.js +0 -948
- package/dist/workers/editor/common/viewLinesViewportData.js +0 -30
- package/dist/workers/editor/common/viewModel.js +0 -98
- package/dist/workers/editor/common/viewModelDecoration.js +0 -55
- package/dist/workers/editor/common/viewModelDecorations.js +0 -132
- package/dist/workers/editor/common/viewModelEventDispatcher.js +0 -398
- package/dist/workers/editor/common/viewModelImpl.js +0 -1163
- package/dist/workers/editor/common/viewModelLines.js +0 -938
- package/dist/workers/editor/common/wordCharacterClassifier.js +0 -87
- package/dist/workers/editor/common/wordHelper.js +0 -127
- package/dist/workers/language/cssMode.js +0 -198
- package/dist/workers/language/cssWorker.js +0 -183
- package/dist/workers/language/htmlMode.js +0 -213
- package/dist/workers/language/htmlWorker.js +0 -126
- package/dist/workers/language/jsonMode.js +0 -224
- package/dist/workers/language/jsonWorker.js +0 -187
- package/dist/workers/language/languageFeatures.js +0 -1009
- package/dist/workers/language/lib.index.js +0 -103
- package/dist/workers/language/lib.js +0 -1107
- package/dist/workers/language/lspLanguageFeatures.js +0 -716
- package/dist/workers/language/monaco.contribution.js +0 -144
- package/dist/workers/language/tokenization.js +0 -189
- package/dist/workers/language/tsMode.js +0 -212
- package/dist/workers/language/tsWorker.js +0 -352
- package/dist/workers/language/typescriptServices.js +0 -210154
- package/dist/workers/language/typescriptServicesMetadata.js +0 -3
- package/dist/workers/language/workerManager.js +0 -65
- /package/dist/workers/{language/css.worker.js → css.worker.js} +0 -0
- /package/dist/workers/{editor/editor.worker.js → editor.worker.js} +0 -0
- /package/dist/workers/{language/html.worker.js → html.worker.js} +0 -0
- /package/dist/workers/{language/json.worker.js → json.worker.js} +0 -0
- /package/dist/workers/{language/ts.worker.js → ts.worker.js} +0 -0
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
import { Emitter } from '../../base/common/event.js';
|
|
2
|
-
import { Disposable } from '../../base/common/lifecycle.js';
|
|
3
|
-
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
class ViewModelEventDispatcher extends Disposable {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
this._onEvent = this._register(new Emitter());
|
|
12
|
-
this.onEvent = this._onEvent.event;
|
|
13
|
-
this._eventHandlers = [];
|
|
14
|
-
this._viewEventQueue = null;
|
|
15
|
-
this._isConsumingViewEventQueue = false;
|
|
16
|
-
this._collector = null;
|
|
17
|
-
this._collectorCnt = 0;
|
|
18
|
-
this._outgoingEvents = [];
|
|
19
|
-
}
|
|
20
|
-
emitOutgoingEvent(e) {
|
|
21
|
-
this._addOutgoingEvent(e);
|
|
22
|
-
this._emitOutgoingEvents();
|
|
23
|
-
}
|
|
24
|
-
_addOutgoingEvent(e) {
|
|
25
|
-
for (let i = 0, len = this._outgoingEvents.length; i < len; i++) {
|
|
26
|
-
const mergeResult = (this._outgoingEvents[i].kind === e.kind ? this._outgoingEvents[i].attemptToMerge(e) : null);
|
|
27
|
-
if (mergeResult) {
|
|
28
|
-
this._outgoingEvents[i] = mergeResult;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
// not merged
|
|
33
|
-
this._outgoingEvents.push(e);
|
|
34
|
-
}
|
|
35
|
-
_emitOutgoingEvents() {
|
|
36
|
-
while (this._outgoingEvents.length > 0) {
|
|
37
|
-
if (this._collector || this._isConsumingViewEventQueue) {
|
|
38
|
-
// right now collecting or emitting view events, so let's postpone emitting
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const event = this._outgoingEvents.shift();
|
|
42
|
-
if (event.isNoOp()) {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
this._onEvent.fire(event);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
addViewEventHandler(eventHandler) {
|
|
49
|
-
for (let i = 0, len = this._eventHandlers.length; i < len; i++) {
|
|
50
|
-
if (this._eventHandlers[i] === eventHandler) {
|
|
51
|
-
console.warn('Detected duplicate listener in ViewEventDispatcher', eventHandler);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
this._eventHandlers.push(eventHandler);
|
|
55
|
-
}
|
|
56
|
-
removeViewEventHandler(eventHandler) {
|
|
57
|
-
for (let i = 0; i < this._eventHandlers.length; i++) {
|
|
58
|
-
if (this._eventHandlers[i] === eventHandler) {
|
|
59
|
-
this._eventHandlers.splice(i, 1);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
beginEmitViewEvents() {
|
|
65
|
-
this._collectorCnt++;
|
|
66
|
-
if (this._collectorCnt === 1) {
|
|
67
|
-
this._collector = new ViewModelEventsCollector();
|
|
68
|
-
}
|
|
69
|
-
return this._collector;
|
|
70
|
-
}
|
|
71
|
-
endEmitViewEvents() {
|
|
72
|
-
this._collectorCnt--;
|
|
73
|
-
if (this._collectorCnt === 0) {
|
|
74
|
-
const outgoingEvents = this._collector.outgoingEvents;
|
|
75
|
-
const viewEvents = this._collector.viewEvents;
|
|
76
|
-
this._collector = null;
|
|
77
|
-
for (const outgoingEvent of outgoingEvents) {
|
|
78
|
-
this._addOutgoingEvent(outgoingEvent);
|
|
79
|
-
}
|
|
80
|
-
if (viewEvents.length > 0) {
|
|
81
|
-
this._emitMany(viewEvents);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
this._emitOutgoingEvents();
|
|
85
|
-
}
|
|
86
|
-
emitSingleViewEvent(event) {
|
|
87
|
-
try {
|
|
88
|
-
const eventsCollector = this.beginEmitViewEvents();
|
|
89
|
-
eventsCollector.emitViewEvent(event);
|
|
90
|
-
}
|
|
91
|
-
finally {
|
|
92
|
-
this.endEmitViewEvents();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
_emitMany(events) {
|
|
96
|
-
if (this._viewEventQueue) {
|
|
97
|
-
this._viewEventQueue = this._viewEventQueue.concat(events);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
this._viewEventQueue = events;
|
|
101
|
-
}
|
|
102
|
-
if (!this._isConsumingViewEventQueue) {
|
|
103
|
-
this._consumeViewEventQueue();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
_consumeViewEventQueue() {
|
|
107
|
-
try {
|
|
108
|
-
this._isConsumingViewEventQueue = true;
|
|
109
|
-
this._doConsumeQueue();
|
|
110
|
-
}
|
|
111
|
-
finally {
|
|
112
|
-
this._isConsumingViewEventQueue = false;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
_doConsumeQueue() {
|
|
116
|
-
while (this._viewEventQueue) {
|
|
117
|
-
// Empty event queue, as events might come in while sending these off
|
|
118
|
-
const events = this._viewEventQueue;
|
|
119
|
-
this._viewEventQueue = null;
|
|
120
|
-
// Use a clone of the event handlers list, as they might remove themselves
|
|
121
|
-
const eventHandlers = this._eventHandlers.slice(0);
|
|
122
|
-
for (const eventHandler of eventHandlers) {
|
|
123
|
-
eventHandler.handleEvents(events);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
class ViewModelEventsCollector {
|
|
129
|
-
constructor() {
|
|
130
|
-
this.viewEvents = [];
|
|
131
|
-
this.outgoingEvents = [];
|
|
132
|
-
}
|
|
133
|
-
emitViewEvent(event) {
|
|
134
|
-
this.viewEvents.push(event);
|
|
135
|
-
}
|
|
136
|
-
emitOutgoingEvent(e) {
|
|
137
|
-
this.outgoingEvents.push(e);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
class ContentSizeChangedEvent {
|
|
141
|
-
constructor(oldContentWidth, oldContentHeight, contentWidth, contentHeight) {
|
|
142
|
-
this.kind = 0 /* OutgoingViewModelEventKind.ContentSizeChanged */;
|
|
143
|
-
this._oldContentWidth = oldContentWidth;
|
|
144
|
-
this._oldContentHeight = oldContentHeight;
|
|
145
|
-
this.contentWidth = contentWidth;
|
|
146
|
-
this.contentHeight = contentHeight;
|
|
147
|
-
this.contentWidthChanged = (this._oldContentWidth !== this.contentWidth);
|
|
148
|
-
this.contentHeightChanged = (this._oldContentHeight !== this.contentHeight);
|
|
149
|
-
}
|
|
150
|
-
isNoOp() {
|
|
151
|
-
return (!this.contentWidthChanged && !this.contentHeightChanged);
|
|
152
|
-
}
|
|
153
|
-
attemptToMerge(other) {
|
|
154
|
-
if (other.kind !== this.kind) {
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
return new ContentSizeChangedEvent(this._oldContentWidth, this._oldContentHeight, other.contentWidth, other.contentHeight);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
class FocusChangedEvent {
|
|
161
|
-
constructor(oldHasFocus, hasFocus) {
|
|
162
|
-
this.kind = 1 /* OutgoingViewModelEventKind.FocusChanged */;
|
|
163
|
-
this.oldHasFocus = oldHasFocus;
|
|
164
|
-
this.hasFocus = hasFocus;
|
|
165
|
-
}
|
|
166
|
-
isNoOp() {
|
|
167
|
-
return (this.oldHasFocus === this.hasFocus);
|
|
168
|
-
}
|
|
169
|
-
attemptToMerge(other) {
|
|
170
|
-
if (other.kind !== this.kind) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
return new FocusChangedEvent(this.oldHasFocus, other.hasFocus);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
class WidgetFocusChangedEvent {
|
|
177
|
-
constructor(oldHasFocus, hasFocus) {
|
|
178
|
-
this.kind = 2 /* OutgoingViewModelEventKind.WidgetFocusChanged */;
|
|
179
|
-
this.oldHasFocus = oldHasFocus;
|
|
180
|
-
this.hasFocus = hasFocus;
|
|
181
|
-
}
|
|
182
|
-
isNoOp() {
|
|
183
|
-
return (this.oldHasFocus === this.hasFocus);
|
|
184
|
-
}
|
|
185
|
-
attemptToMerge(other) {
|
|
186
|
-
if (other.kind !== this.kind) {
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
return new FocusChangedEvent(this.oldHasFocus, other.hasFocus);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
class ScrollChangedEvent {
|
|
193
|
-
constructor(oldScrollWidth, oldScrollLeft, oldScrollHeight, oldScrollTop, scrollWidth, scrollLeft, scrollHeight, scrollTop) {
|
|
194
|
-
this.kind = 3 /* OutgoingViewModelEventKind.ScrollChanged */;
|
|
195
|
-
this._oldScrollWidth = oldScrollWidth;
|
|
196
|
-
this._oldScrollLeft = oldScrollLeft;
|
|
197
|
-
this._oldScrollHeight = oldScrollHeight;
|
|
198
|
-
this._oldScrollTop = oldScrollTop;
|
|
199
|
-
this.scrollWidth = scrollWidth;
|
|
200
|
-
this.scrollLeft = scrollLeft;
|
|
201
|
-
this.scrollHeight = scrollHeight;
|
|
202
|
-
this.scrollTop = scrollTop;
|
|
203
|
-
this.scrollWidthChanged = (this._oldScrollWidth !== this.scrollWidth);
|
|
204
|
-
this.scrollLeftChanged = (this._oldScrollLeft !== this.scrollLeft);
|
|
205
|
-
this.scrollHeightChanged = (this._oldScrollHeight !== this.scrollHeight);
|
|
206
|
-
this.scrollTopChanged = (this._oldScrollTop !== this.scrollTop);
|
|
207
|
-
}
|
|
208
|
-
isNoOp() {
|
|
209
|
-
return (!this.scrollWidthChanged && !this.scrollLeftChanged && !this.scrollHeightChanged && !this.scrollTopChanged);
|
|
210
|
-
}
|
|
211
|
-
attemptToMerge(other) {
|
|
212
|
-
if (other.kind !== this.kind) {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
return new ScrollChangedEvent(this._oldScrollWidth, this._oldScrollLeft, this._oldScrollHeight, this._oldScrollTop, other.scrollWidth, other.scrollLeft, other.scrollHeight, other.scrollTop);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
class ViewZonesChangedEvent {
|
|
219
|
-
constructor() {
|
|
220
|
-
this.kind = 4 /* OutgoingViewModelEventKind.ViewZonesChanged */;
|
|
221
|
-
}
|
|
222
|
-
isNoOp() {
|
|
223
|
-
return false;
|
|
224
|
-
}
|
|
225
|
-
attemptToMerge(other) {
|
|
226
|
-
if (other.kind !== this.kind) {
|
|
227
|
-
return null;
|
|
228
|
-
}
|
|
229
|
-
return this;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
class HiddenAreasChangedEvent {
|
|
233
|
-
constructor() {
|
|
234
|
-
this.kind = 5 /* OutgoingViewModelEventKind.HiddenAreasChanged */;
|
|
235
|
-
}
|
|
236
|
-
isNoOp() {
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
attemptToMerge(other) {
|
|
240
|
-
if (other.kind !== this.kind) {
|
|
241
|
-
return null;
|
|
242
|
-
}
|
|
243
|
-
return this;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
class CursorStateChangedEvent {
|
|
247
|
-
constructor(oldSelections, selections, oldModelVersionId, modelVersionId, source, reason, reachedMaxCursorCount) {
|
|
248
|
-
this.kind = 7 /* OutgoingViewModelEventKind.CursorStateChanged */;
|
|
249
|
-
this.oldSelections = oldSelections;
|
|
250
|
-
this.selections = selections;
|
|
251
|
-
this.oldModelVersionId = oldModelVersionId;
|
|
252
|
-
this.modelVersionId = modelVersionId;
|
|
253
|
-
this.source = source;
|
|
254
|
-
this.reason = reason;
|
|
255
|
-
this.reachedMaxCursorCount = reachedMaxCursorCount;
|
|
256
|
-
}
|
|
257
|
-
static _selectionsAreEqual(a, b) {
|
|
258
|
-
if (!a && !b) {
|
|
259
|
-
return true;
|
|
260
|
-
}
|
|
261
|
-
if (!a || !b) {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
const aLen = a.length;
|
|
265
|
-
const bLen = b.length;
|
|
266
|
-
if (aLen !== bLen) {
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
269
|
-
for (let i = 0; i < aLen; i++) {
|
|
270
|
-
if (!a[i].equalsSelection(b[i])) {
|
|
271
|
-
return false;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return true;
|
|
275
|
-
}
|
|
276
|
-
isNoOp() {
|
|
277
|
-
return (CursorStateChangedEvent._selectionsAreEqual(this.oldSelections, this.selections)
|
|
278
|
-
&& this.oldModelVersionId === this.modelVersionId);
|
|
279
|
-
}
|
|
280
|
-
attemptToMerge(other) {
|
|
281
|
-
if (other.kind !== this.kind) {
|
|
282
|
-
return null;
|
|
283
|
-
}
|
|
284
|
-
return new CursorStateChangedEvent(this.oldSelections, other.selections, this.oldModelVersionId, other.modelVersionId, other.source, other.reason, this.reachedMaxCursorCount || other.reachedMaxCursorCount);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
class ReadOnlyEditAttemptEvent {
|
|
288
|
-
constructor() {
|
|
289
|
-
this.kind = 6 /* OutgoingViewModelEventKind.ReadOnlyEditAttempt */;
|
|
290
|
-
}
|
|
291
|
-
isNoOp() {
|
|
292
|
-
return false;
|
|
293
|
-
}
|
|
294
|
-
attemptToMerge(other) {
|
|
295
|
-
if (other.kind !== this.kind) {
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
298
|
-
return this;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
class ModelDecorationsChangedEvent {
|
|
302
|
-
constructor(event) {
|
|
303
|
-
this.event = event;
|
|
304
|
-
this.kind = 8 /* OutgoingViewModelEventKind.ModelDecorationsChanged */;
|
|
305
|
-
}
|
|
306
|
-
isNoOp() {
|
|
307
|
-
return false;
|
|
308
|
-
}
|
|
309
|
-
attemptToMerge(other) {
|
|
310
|
-
return null;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
class ModelLanguageChangedEvent {
|
|
314
|
-
constructor(event) {
|
|
315
|
-
this.event = event;
|
|
316
|
-
this.kind = 9 /* OutgoingViewModelEventKind.ModelLanguageChanged */;
|
|
317
|
-
}
|
|
318
|
-
isNoOp() {
|
|
319
|
-
return false;
|
|
320
|
-
}
|
|
321
|
-
attemptToMerge(other) {
|
|
322
|
-
return null;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
class ModelLanguageConfigurationChangedEvent {
|
|
326
|
-
constructor(event) {
|
|
327
|
-
this.event = event;
|
|
328
|
-
this.kind = 10 /* OutgoingViewModelEventKind.ModelLanguageConfigurationChanged */;
|
|
329
|
-
}
|
|
330
|
-
isNoOp() {
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
attemptToMerge(other) {
|
|
334
|
-
return null;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
class ModelContentChangedEvent {
|
|
338
|
-
constructor(event) {
|
|
339
|
-
this.event = event;
|
|
340
|
-
this.kind = 11 /* OutgoingViewModelEventKind.ModelContentChanged */;
|
|
341
|
-
}
|
|
342
|
-
isNoOp() {
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
attemptToMerge(other) {
|
|
346
|
-
return null;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
class ModelOptionsChangedEvent {
|
|
350
|
-
constructor(event) {
|
|
351
|
-
this.event = event;
|
|
352
|
-
this.kind = 12 /* OutgoingViewModelEventKind.ModelOptionsChanged */;
|
|
353
|
-
}
|
|
354
|
-
isNoOp() {
|
|
355
|
-
return false;
|
|
356
|
-
}
|
|
357
|
-
attemptToMerge(other) {
|
|
358
|
-
return null;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
class ModelTokensChangedEvent {
|
|
362
|
-
constructor(event) {
|
|
363
|
-
this.event = event;
|
|
364
|
-
this.kind = 13 /* OutgoingViewModelEventKind.ModelTokensChanged */;
|
|
365
|
-
}
|
|
366
|
-
isNoOp() {
|
|
367
|
-
return false;
|
|
368
|
-
}
|
|
369
|
-
attemptToMerge(other) {
|
|
370
|
-
return null;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
class ModelLineHeightChangedEvent {
|
|
374
|
-
constructor(event) {
|
|
375
|
-
this.event = event;
|
|
376
|
-
this.kind = 14 /* OutgoingViewModelEventKind.ModelLineHeightChanged */;
|
|
377
|
-
}
|
|
378
|
-
isNoOp() {
|
|
379
|
-
return false;
|
|
380
|
-
}
|
|
381
|
-
attemptToMerge(other) {
|
|
382
|
-
return null;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
class ModelFontChangedEvent {
|
|
386
|
-
constructor(event) {
|
|
387
|
-
this.event = event;
|
|
388
|
-
this.kind = 15 /* OutgoingViewModelEventKind.ModelFontChangedEvent */;
|
|
389
|
-
}
|
|
390
|
-
isNoOp() {
|
|
391
|
-
return false;
|
|
392
|
-
}
|
|
393
|
-
attemptToMerge(other) {
|
|
394
|
-
return null;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
export { ContentSizeChangedEvent, CursorStateChangedEvent, FocusChangedEvent, HiddenAreasChangedEvent, ModelContentChangedEvent, ModelDecorationsChangedEvent, ModelFontChangedEvent, ModelLanguageChangedEvent, ModelLanguageConfigurationChangedEvent, ModelLineHeightChangedEvent, ModelOptionsChangedEvent, ModelTokensChangedEvent, ReadOnlyEditAttemptEvent, ScrollChangedEvent, ViewModelEventDispatcher, ViewModelEventsCollector, ViewZonesChangedEvent, WidgetFocusChangedEvent };
|