monaco-editor11 1.0.7 → 1.0.9
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/assets/css.worker-C7FogG4G.js +93 -0
- package/dist/assets/editor.worker-iXcRX1Tq.js +26 -0
- package/dist/assets/html.worker-C8VxctEJ.js +470 -0
- package/dist/assets/json.worker-CMC9kgPL.js +58 -0
- package/dist/assets/ts.worker-CtTJ3hNN.js +67731 -0
- package/dist/index.d.ts +0 -6
- package/dist/monaco-editor11.es.js +49 -78
- package/dist/monaco-editor11.umd.js +1 -50
- package/dist/monaco.d.ts +8 -0
- package/dist/workers/common/initialize.js +16 -0
- package/dist/workers/common/workers.js +141 -0
- package/dist/workers/editor/common/abstractSyntaxTokenBackend.js +128 -0
- package/dist/workers/editor/common/abstractText.js +89 -0
- package/dist/workers/editor/common/ast.js +485 -0
- package/dist/workers/editor/common/autoIndent.js +390 -0
- package/dist/workers/editor/common/beforeEditPositionMapper.js +110 -0
- package/dist/workers/editor/common/bracketPairsImpl.js +717 -0
- package/dist/workers/editor/common/bracketPairsTree.js +343 -0
- package/dist/workers/editor/common/brackets.js +108 -0
- package/dist/workers/editor/common/characterClassifier.js +59 -0
- package/dist/workers/editor/common/characterPair.js +40 -0
- package/dist/workers/editor/common/colorizedBracketPairsDecorationProvider.js +97 -0
- package/dist/workers/editor/common/columnRange.js +35 -0
- package/dist/workers/editor/common/combineTextEditInfos.js +124 -0
- package/dist/workers/editor/common/common.js +20 -0
- package/dist/workers/editor/common/computeMovedLines.js +249 -0
- package/dist/workers/editor/common/concat23Trees.js +192 -0
- package/dist/workers/editor/common/contiguousMultilineTokens.js +32 -0
- package/dist/workers/editor/common/contiguousMultilineTokensBuilder.js +23 -0
- package/dist/workers/editor/common/contiguousTokensEditing.js +128 -0
- package/dist/workers/editor/common/contiguousTokensStore.js +207 -0
- package/dist/workers/editor/common/coordinatesConverter.js +51 -0
- package/dist/workers/editor/common/cursor.js +899 -0
- package/dist/workers/editor/common/cursorAtomicMoveOperations.js +145 -0
- package/dist/workers/editor/common/cursorCollection.js +194 -0
- package/dist/workers/editor/common/cursorColumnSelection.js +93 -0
- package/dist/workers/editor/common/cursorColumns.js +112 -0
- package/dist/workers/editor/common/cursorCommon.js +250 -0
- package/dist/workers/editor/common/cursorContext.js +15 -0
- package/dist/workers/editor/common/cursorDeleteOperations.js +231 -0
- package/dist/workers/editor/common/cursorMoveCommands.js +676 -0
- package/dist/workers/editor/common/cursorMoveOperations.js +290 -0
- package/dist/workers/editor/common/cursorTypeEditOperations.js +968 -0
- package/dist/workers/editor/common/cursorTypeOperations.js +173 -0
- package/dist/workers/editor/common/cursorUtils.js +75 -0
- package/dist/workers/editor/common/cursorWordOperations.js +720 -0
- package/dist/workers/editor/common/defaultDocumentColorsComputer.js +138 -0
- package/dist/workers/editor/common/defaultLinesDiffComputer.js +188 -0
- package/dist/workers/editor/common/diffAlgorithm.js +139 -0
- package/dist/workers/editor/common/diffEditor.js +38 -0
- package/dist/workers/editor/common/dynamicProgrammingDiffing.js +101 -0
- package/dist/workers/editor/common/edit.js +183 -0
- package/dist/workers/editor/common/editOperation.js +36 -0
- package/dist/workers/editor/common/editStack.js +363 -0
- package/dist/workers/editor/common/editorAction.js +26 -0
- package/dist/workers/editor/common/editorBaseApi.js +43 -0
- package/dist/workers/editor/common/editorColorRegistry.js +102 -0
- package/dist/workers/editor/common/editorCommon.js +13 -0
- package/dist/workers/editor/common/editorConfigurationSchema.js +338 -0
- package/dist/workers/editor/common/editorContextKeys.js +84 -0
- package/dist/workers/editor/common/editorFeatures.js +17 -0
- package/dist/workers/editor/common/editorOptions.js +3440 -0
- package/dist/workers/editor/common/editorTheme.js +23 -0
- package/dist/workers/editor/common/editorWebWorker.js +299 -0
- package/dist/workers/editor/common/editorWorker.js +9 -0
- package/dist/workers/editor/common/editorWorkerHost.js +15 -0
- package/dist/workers/editor/common/editorZoom.js +26 -0
- package/dist/workers/editor/common/electricCharacter.js +55 -0
- package/dist/workers/editor/common/encodedTokenAttributes.js +79 -0
- package/dist/workers/editor/common/enterAction.js +53 -0
- package/dist/workers/editor/common/eolCounter.js +44 -0
- package/dist/workers/editor/common/findSectionHeaders.js +128 -0
- package/dist/workers/editor/common/fixBrackets.js +67 -0
- package/dist/workers/editor/common/fixedArray.js +70 -0
- package/dist/workers/editor/common/fontInfo.js +172 -0
- package/dist/workers/editor/common/fontInfoFromSettings.js +29 -0
- package/dist/workers/editor/common/getIconClasses.js +106 -0
- package/dist/workers/editor/common/getPositionOffsetTransformerFromTextModel.js +24 -0
- package/dist/workers/editor/common/glyphLanesModel.js +61 -0
- package/dist/workers/editor/common/guidesTextModelPart.js +405 -0
- package/dist/workers/editor/common/heuristicSequenceOptimizations.js +374 -0
- package/dist/workers/editor/common/indentRules.js +63 -0
- package/dist/workers/editor/common/indentation.js +39 -0
- package/dist/workers/editor/common/indentationGuesser.js +178 -0
- package/dist/workers/editor/common/indentationLineProcessor.js +193 -0
- package/dist/workers/editor/common/inlineDecorations.js +26 -0
- package/dist/workers/editor/common/inplaceReplaceSupport.js +87 -0
- package/dist/workers/editor/common/inputMode.js +22 -0
- package/dist/workers/editor/common/intervalTree.js +1002 -0
- package/dist/workers/editor/common/language.js +9 -0
- package/dist/workers/editor/common/languageBracketsConfiguration.js +133 -0
- package/dist/workers/editor/common/languageConfiguration.js +138 -0
- package/dist/workers/editor/common/languageConfigurationRegistry.js +361 -0
- package/dist/workers/editor/common/languageFeatureDebounce.js +137 -0
- package/dist/workers/editor/common/languageFeatureRegistry.js +180 -0
- package/dist/workers/editor/common/languageFeatures.js +9 -0
- package/dist/workers/editor/common/languageFeaturesService.js +47 -0
- package/dist/workers/editor/common/languageSelector.js +112 -0
- package/dist/workers/editor/common/languageService.js +92 -0
- package/dist/workers/editor/common/languages.js +522 -0
- package/dist/workers/editor/common/languagesAssociations.js +193 -0
- package/dist/workers/editor/common/languagesRegistry.js +237 -0
- package/dist/workers/editor/common/legacyLinesDiffComputer.js +468 -0
- package/dist/workers/editor/common/length.js +129 -0
- package/dist/workers/editor/common/lineDecorations.js +208 -0
- package/dist/workers/editor/common/lineEdit.js +75 -0
- package/dist/workers/editor/common/lineHeights.js +370 -0
- package/dist/workers/editor/common/linePart.js +25 -0
- package/dist/workers/editor/common/lineRange.js +312 -0
- package/dist/workers/editor/common/lineSequence.js +36 -0
- package/dist/workers/editor/common/lineTokens.js +405 -0
- package/dist/workers/editor/common/linesDiffComputer.js +29 -0
- package/dist/workers/editor/common/linesDiffComputers.js +13 -0
- package/dist/workers/editor/common/linesLayout.js +765 -0
- package/dist/workers/editor/common/linesSliceCharSequence.js +205 -0
- package/dist/workers/editor/common/linkComputer.js +269 -0
- package/dist/workers/editor/common/markerDecorations.js +9 -0
- package/dist/workers/editor/common/markerDecorationsService.js +248 -0
- package/dist/workers/editor/common/minimapTokensColorTracker.js +58 -0
- package/dist/workers/editor/common/mirrorTextModel.js +117 -0
- package/dist/workers/editor/common/model.js +9 -0
- package/dist/workers/editor/common/modelLineProjection.js +350 -0
- package/dist/workers/editor/common/modelLineProjectionData.js +297 -0
- package/dist/workers/editor/common/modelService.js +413 -0
- package/dist/workers/editor/common/modesRegistry.js +75 -0
- package/dist/workers/editor/common/monospaceLineBreaksComputer.js +473 -0
- package/dist/workers/editor/common/myersDiffAlgorithm.js +159 -0
- package/dist/workers/editor/common/nodeReader.js +127 -0
- package/dist/workers/editor/common/nullTokenize.js +29 -0
- package/dist/workers/editor/common/offsetRange.js +225 -0
- package/dist/workers/editor/common/onEnter.js +109 -0
- package/dist/workers/editor/common/oneCursor.js +117 -0
- package/dist/workers/editor/common/overviewZoneManager.js +176 -0
- package/dist/workers/editor/common/parser.js +121 -0
- package/dist/workers/editor/common/pieceTreeBase.js +1473 -0
- package/dist/workers/editor/common/pieceTreeTextBuffer.js +461 -0
- package/dist/workers/editor/common/pieceTreeTextBufferBuilder.js +140 -0
- package/dist/workers/editor/common/point.js +50 -0
- package/dist/workers/editor/common/position.js +142 -0
- package/dist/workers/editor/common/positionToOffset.js +17 -0
- package/dist/workers/editor/common/positionToOffsetImpl.js +98 -0
- package/dist/workers/editor/common/prefixSumComputer.js +226 -0
- package/dist/workers/editor/common/range.js +421 -0
- package/dist/workers/editor/common/rangeMapping.js +229 -0
- package/dist/workers/editor/common/rangeSingleLine.js +17 -0
- package/dist/workers/editor/common/rbTreeBase.js +362 -0
- package/dist/workers/editor/common/rect.js +163 -0
- package/dist/workers/editor/common/replaceCommand.js +158 -0
- package/dist/workers/editor/common/resolverService.js +5 -0
- package/dist/workers/editor/common/rgba.js +35 -0
- package/dist/workers/editor/common/richEditBrackets.js +356 -0
- package/dist/workers/editor/common/selection.js +145 -0
- package/dist/workers/editor/common/semanticTokensDto.js +82 -0
- package/dist/workers/editor/common/semanticTokensProviderStyling.js +263 -0
- package/dist/workers/editor/common/semanticTokensStyling.js +9 -0
- package/dist/workers/editor/common/semanticTokensStylingService.js +47 -0
- package/dist/workers/editor/common/shiftCommand.js +241 -0
- package/dist/workers/editor/common/smallImmutableSet.js +108 -0
- package/dist/workers/editor/common/sparseMultilineTokens.js +548 -0
- package/dist/workers/editor/common/sparseTokensStore.js +210 -0
- package/dist/workers/editor/common/standaloneEnums.js +1017 -0
- package/dist/workers/editor/common/standaloneStrings.js +42 -0
- package/dist/workers/editor/common/stringBuilder.js +122 -0
- package/dist/workers/editor/common/stringEdit.js +165 -0
- package/dist/workers/editor/common/supports.js +58 -0
- package/dist/workers/editor/common/surroundSelectionCommand.js +44 -0
- package/dist/workers/editor/common/textChange.js +248 -0
- package/dist/workers/editor/common/textEdit.js +269 -0
- package/dist/workers/editor/common/textLength.js +87 -0
- package/dist/workers/editor/common/textModel.js +2031 -0
- package/dist/workers/editor/common/textModelBracketPairs.js +45 -0
- package/dist/workers/editor/common/textModelDefaults.js +18 -0
- package/dist/workers/editor/common/textModelEditSource.js +166 -0
- package/dist/workers/editor/common/textModelEvents.js +216 -0
- package/dist/workers/editor/common/textModelGuides.js +40 -0
- package/dist/workers/editor/common/textModelPart.js +23 -0
- package/dist/workers/editor/common/textModelSearch.js +455 -0
- package/dist/workers/editor/common/textModelStringEdit.js +11 -0
- package/dist/workers/editor/common/textModelSync.impl.js +307 -0
- package/dist/workers/editor/common/textModelText.js +26 -0
- package/dist/workers/editor/common/textModelTokens.js +436 -0
- package/dist/workers/editor/common/textResourceConfiguration.js +6 -0
- package/dist/workers/editor/common/textToHtmlTokenizer.js +139 -0
- package/dist/workers/editor/common/tokenStore.js +407 -0
- package/dist/workers/editor/common/tokenWithTextArray.js +73 -0
- package/dist/workers/editor/common/tokenization.js +287 -0
- package/dist/workers/editor/common/tokenizationRegistry.js +123 -0
- package/dist/workers/editor/common/tokenizationTextModelPart.js +275 -0
- package/dist/workers/editor/common/tokenizer.js +301 -0
- package/dist/workers/editor/common/tokenizerSyntaxTokenBackend.js +261 -0
- package/dist/workers/editor/common/treeSitterLibraryService.js +9 -0
- package/dist/workers/editor/common/treeSitterSyntaxTokenBackend.js +167 -0
- package/dist/workers/editor/common/treeSitterThemeService.js +9 -0
- package/dist/workers/editor/common/treeSitterTokenizationImpl.js +713 -0
- package/dist/workers/editor/common/treeSitterTree.js +395 -0
- package/dist/workers/editor/common/treeViewsDnd.js +24 -0
- package/dist/workers/editor/common/treeViewsDndService.js +12 -0
- package/dist/workers/editor/common/trimTrailingWhitespaceCommand.js +98 -0
- package/dist/workers/editor/common/unicodeTextModelHighlighter.js +188 -0
- package/dist/workers/editor/common/utils.js +62 -0
- package/dist/workers/editor/common/viewContext.js +22 -0
- package/dist/workers/editor/common/viewEventHandler.js +186 -0
- package/dist/workers/editor/common/viewEvents.js +180 -0
- package/dist/workers/editor/common/viewLayout.js +368 -0
- package/dist/workers/editor/common/viewLineRenderer.js +948 -0
- package/dist/workers/editor/common/viewLinesViewportData.js +30 -0
- package/dist/workers/editor/common/viewModel.js +98 -0
- package/dist/workers/editor/common/viewModelDecoration.js +55 -0
- package/dist/workers/editor/common/viewModelDecorations.js +132 -0
- package/dist/workers/editor/common/viewModelEventDispatcher.js +398 -0
- package/dist/workers/editor/common/viewModelImpl.js +1163 -0
- package/dist/workers/editor/common/viewModelLines.js +938 -0
- package/dist/workers/editor/common/wordCharacterClassifier.js +87 -0
- package/dist/workers/editor/common/wordHelper.js +127 -0
- package/dist/workers/editor/editor.worker.js +11 -0
- package/dist/workers/language/css.worker.js +8 -0
- package/dist/workers/language/cssMode.js +198 -0
- package/dist/workers/language/cssWorker.js +183 -0
- package/dist/workers/language/html.worker.js +8 -0
- package/dist/workers/language/htmlMode.js +213 -0
- package/dist/workers/language/htmlWorker.js +126 -0
- package/dist/workers/language/json.worker.js +8 -0
- package/dist/workers/language/jsonMode.js +224 -0
- package/dist/workers/language/jsonWorker.js +187 -0
- package/dist/workers/language/languageFeatures.js +1009 -0
- package/dist/workers/language/lib.index.js +103 -0
- package/dist/workers/language/lib.js +1107 -0
- package/dist/workers/language/lspLanguageFeatures.js +716 -0
- package/dist/workers/language/monaco.contribution.js +144 -0
- package/dist/workers/language/tokenization.js +189 -0
- package/dist/workers/language/ts.worker.js +14 -0
- package/dist/workers/language/tsMode.js +212 -0
- package/dist/workers/language/tsWorker.js +352 -0
- package/dist/workers/language/typescriptServices.js +210154 -0
- package/dist/workers/language/typescriptServicesMetadata.js +3 -0
- package/dist/workers/language/workerManager.js +65 -0
- package/package.json +3 -2
|
@@ -0,0 +1,398 @@
|
|
|
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 };
|