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,188 @@
|
|
|
1
|
+
import { Range } from '../core/range.js';
|
|
2
|
+
import { Searcher } from '../model/textModelSearch.js';
|
|
3
|
+
import { isHighSurrogate, AmbiguousCharacters, InvisibleCharacters, escapeRegExpCharacters, isBasicASCII } from '../../../base/common/strings.js';
|
|
4
|
+
import { assertNever } from '../../../base/common/assert.js';
|
|
5
|
+
import { getWordAtText, DEFAULT_WORD_REGEXP } from '../core/wordHelper.js';
|
|
6
|
+
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
class UnicodeTextModelHighlighter {
|
|
12
|
+
static computeUnicodeHighlights(model, options, range) {
|
|
13
|
+
const startLine = range ? range.startLineNumber : 1;
|
|
14
|
+
const endLine = range ? range.endLineNumber : model.getLineCount();
|
|
15
|
+
const codePointHighlighter = new CodePointHighlighter(options);
|
|
16
|
+
const candidates = codePointHighlighter.getCandidateCodePoints();
|
|
17
|
+
let regex;
|
|
18
|
+
if (candidates === 'allNonBasicAscii') {
|
|
19
|
+
regex = new RegExp('[^\\t\\n\\r\\x20-\\x7E]', 'g');
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
regex = new RegExp(`${buildRegExpCharClassExpr(Array.from(candidates))}`, 'g');
|
|
23
|
+
}
|
|
24
|
+
const searcher = new Searcher(null, regex);
|
|
25
|
+
const ranges = [];
|
|
26
|
+
let hasMore = false;
|
|
27
|
+
let m;
|
|
28
|
+
let ambiguousCharacterCount = 0;
|
|
29
|
+
let invisibleCharacterCount = 0;
|
|
30
|
+
let nonBasicAsciiCharacterCount = 0;
|
|
31
|
+
forLoop: for (let lineNumber = startLine, lineCount = endLine; lineNumber <= lineCount; lineNumber++) {
|
|
32
|
+
const lineContent = model.getLineContent(lineNumber);
|
|
33
|
+
const lineLength = lineContent.length;
|
|
34
|
+
// Reset regex to search from the beginning
|
|
35
|
+
searcher.reset(0);
|
|
36
|
+
do {
|
|
37
|
+
m = searcher.next(lineContent);
|
|
38
|
+
if (m) {
|
|
39
|
+
let startIndex = m.index;
|
|
40
|
+
let endIndex = m.index + m[0].length;
|
|
41
|
+
// Extend range to entire code point
|
|
42
|
+
if (startIndex > 0) {
|
|
43
|
+
const charCodeBefore = lineContent.charCodeAt(startIndex - 1);
|
|
44
|
+
if (isHighSurrogate(charCodeBefore)) {
|
|
45
|
+
startIndex--;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (endIndex + 1 < lineLength) {
|
|
49
|
+
const charCodeBefore = lineContent.charCodeAt(endIndex - 1);
|
|
50
|
+
if (isHighSurrogate(charCodeBefore)) {
|
|
51
|
+
endIndex++;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const str = lineContent.substring(startIndex, endIndex);
|
|
55
|
+
let word = getWordAtText(startIndex + 1, DEFAULT_WORD_REGEXP, lineContent, 0);
|
|
56
|
+
if (word && word.endColumn <= startIndex + 1) {
|
|
57
|
+
// The word does not include the problematic character, ignore the word
|
|
58
|
+
word = null;
|
|
59
|
+
}
|
|
60
|
+
const highlightReason = codePointHighlighter.shouldHighlightNonBasicASCII(str, word ? word.word : null);
|
|
61
|
+
if (highlightReason !== 0 /* SimpleHighlightReason.None */) {
|
|
62
|
+
if (highlightReason === 3 /* SimpleHighlightReason.Ambiguous */) {
|
|
63
|
+
ambiguousCharacterCount++;
|
|
64
|
+
}
|
|
65
|
+
else if (highlightReason === 2 /* SimpleHighlightReason.Invisible */) {
|
|
66
|
+
invisibleCharacterCount++;
|
|
67
|
+
}
|
|
68
|
+
else if (highlightReason === 1 /* SimpleHighlightReason.NonBasicASCII */) {
|
|
69
|
+
nonBasicAsciiCharacterCount++;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
assertNever();
|
|
73
|
+
}
|
|
74
|
+
const MAX_RESULT_LENGTH = 1000;
|
|
75
|
+
if (ranges.length >= MAX_RESULT_LENGTH) {
|
|
76
|
+
hasMore = true;
|
|
77
|
+
break forLoop;
|
|
78
|
+
}
|
|
79
|
+
ranges.push(new Range(lineNumber, startIndex + 1, lineNumber, endIndex + 1));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} while (m);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
ranges,
|
|
86
|
+
hasMore,
|
|
87
|
+
ambiguousCharacterCount,
|
|
88
|
+
invisibleCharacterCount,
|
|
89
|
+
nonBasicAsciiCharacterCount
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static computeUnicodeHighlightReason(char, options) {
|
|
93
|
+
const codePointHighlighter = new CodePointHighlighter(options);
|
|
94
|
+
const reason = codePointHighlighter.shouldHighlightNonBasicASCII(char, null);
|
|
95
|
+
switch (reason) {
|
|
96
|
+
case 0 /* SimpleHighlightReason.None */:
|
|
97
|
+
return null;
|
|
98
|
+
case 2 /* SimpleHighlightReason.Invisible */:
|
|
99
|
+
return { kind: 1 /* UnicodeHighlighterReasonKind.Invisible */ };
|
|
100
|
+
case 3 /* SimpleHighlightReason.Ambiguous */: {
|
|
101
|
+
const codePoint = char.codePointAt(0);
|
|
102
|
+
const primaryConfusable = codePointHighlighter.ambiguousCharacters.getPrimaryConfusable(codePoint);
|
|
103
|
+
const notAmbiguousInLocales = AmbiguousCharacters.getLocales().filter((l) => !AmbiguousCharacters.getInstance(new Set([...options.allowedLocales, l])).isAmbiguous(codePoint));
|
|
104
|
+
return { kind: 0 /* UnicodeHighlighterReasonKind.Ambiguous */, confusableWith: String.fromCodePoint(primaryConfusable), notAmbiguousInLocales };
|
|
105
|
+
}
|
|
106
|
+
case 1 /* SimpleHighlightReason.NonBasicASCII */:
|
|
107
|
+
return { kind: 2 /* UnicodeHighlighterReasonKind.NonBasicAscii */ };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function buildRegExpCharClassExpr(codePoints, flags) {
|
|
112
|
+
const src = `[${escapeRegExpCharacters(codePoints.map((i) => String.fromCodePoint(i)).join(''))}]`;
|
|
113
|
+
return src;
|
|
114
|
+
}
|
|
115
|
+
class CodePointHighlighter {
|
|
116
|
+
constructor(options) {
|
|
117
|
+
this.options = options;
|
|
118
|
+
this.allowedCodePoints = new Set(options.allowedCodePoints);
|
|
119
|
+
this.ambiguousCharacters = AmbiguousCharacters.getInstance(new Set(options.allowedLocales));
|
|
120
|
+
}
|
|
121
|
+
getCandidateCodePoints() {
|
|
122
|
+
if (this.options.nonBasicASCII) {
|
|
123
|
+
return 'allNonBasicAscii';
|
|
124
|
+
}
|
|
125
|
+
const set = new Set();
|
|
126
|
+
if (this.options.invisibleCharacters) {
|
|
127
|
+
for (const cp of InvisibleCharacters.codePoints) {
|
|
128
|
+
if (!isAllowedInvisibleCharacter(String.fromCodePoint(cp))) {
|
|
129
|
+
set.add(cp);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (this.options.ambiguousCharacters) {
|
|
134
|
+
for (const cp of this.ambiguousCharacters.getConfusableCodePoints()) {
|
|
135
|
+
set.add(cp);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
for (const cp of this.allowedCodePoints) {
|
|
139
|
+
set.delete(cp);
|
|
140
|
+
}
|
|
141
|
+
return set;
|
|
142
|
+
}
|
|
143
|
+
shouldHighlightNonBasicASCII(character, wordContext) {
|
|
144
|
+
const codePoint = character.codePointAt(0);
|
|
145
|
+
if (this.allowedCodePoints.has(codePoint)) {
|
|
146
|
+
return 0 /* SimpleHighlightReason.None */;
|
|
147
|
+
}
|
|
148
|
+
if (this.options.nonBasicASCII) {
|
|
149
|
+
return 1 /* SimpleHighlightReason.NonBasicASCII */;
|
|
150
|
+
}
|
|
151
|
+
let hasBasicASCIICharacters = false;
|
|
152
|
+
let hasNonConfusableNonBasicAsciiCharacter = false;
|
|
153
|
+
if (wordContext) {
|
|
154
|
+
for (const char of wordContext) {
|
|
155
|
+
const codePoint = char.codePointAt(0);
|
|
156
|
+
const isBasicASCII$1 = isBasicASCII(char);
|
|
157
|
+
hasBasicASCIICharacters = hasBasicASCIICharacters || isBasicASCII$1;
|
|
158
|
+
if (!isBasicASCII$1 &&
|
|
159
|
+
!this.ambiguousCharacters.isAmbiguous(codePoint) &&
|
|
160
|
+
!InvisibleCharacters.isInvisibleCharacter(codePoint)) {
|
|
161
|
+
hasNonConfusableNonBasicAsciiCharacter = true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (
|
|
166
|
+
/* Don't allow mixing weird looking characters with ASCII */ !hasBasicASCIICharacters &&
|
|
167
|
+
/* Is there an obviously weird looking character? */ hasNonConfusableNonBasicAsciiCharacter) {
|
|
168
|
+
return 0 /* SimpleHighlightReason.None */;
|
|
169
|
+
}
|
|
170
|
+
if (this.options.invisibleCharacters) {
|
|
171
|
+
// TODO check for emojis
|
|
172
|
+
if (!isAllowedInvisibleCharacter(character) && InvisibleCharacters.isInvisibleCharacter(codePoint)) {
|
|
173
|
+
return 2 /* SimpleHighlightReason.Invisible */;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (this.options.ambiguousCharacters) {
|
|
177
|
+
if (this.ambiguousCharacters.isAmbiguous(codePoint)) {
|
|
178
|
+
return 3 /* SimpleHighlightReason.Ambiguous */;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return 0 /* SimpleHighlightReason.None */;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function isAllowedInvisibleCharacter(character) {
|
|
185
|
+
return character === ' ' || character === '\n' || character === '\t';
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { UnicodeTextModelHighlighter };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
class Array2D {
|
|
6
|
+
constructor(width, height) {
|
|
7
|
+
this.width = width;
|
|
8
|
+
this.height = height;
|
|
9
|
+
this.array = [];
|
|
10
|
+
this.array = new Array(width * height);
|
|
11
|
+
}
|
|
12
|
+
get(x, y) {
|
|
13
|
+
return this.array[x + y * this.width];
|
|
14
|
+
}
|
|
15
|
+
set(x, y, value) {
|
|
16
|
+
this.array[x + y * this.width] = value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function isSpace(charCode) {
|
|
20
|
+
return charCode === 32 /* CharCode.Space */ || charCode === 9 /* CharCode.Tab */;
|
|
21
|
+
}
|
|
22
|
+
class LineRangeFragment {
|
|
23
|
+
static { this.chrKeys = new Map(); }
|
|
24
|
+
static getKey(chr) {
|
|
25
|
+
let key = this.chrKeys.get(chr);
|
|
26
|
+
if (key === undefined) {
|
|
27
|
+
key = this.chrKeys.size;
|
|
28
|
+
this.chrKeys.set(chr, key);
|
|
29
|
+
}
|
|
30
|
+
return key;
|
|
31
|
+
}
|
|
32
|
+
constructor(range, lines, source) {
|
|
33
|
+
this.range = range;
|
|
34
|
+
this.lines = lines;
|
|
35
|
+
this.source = source;
|
|
36
|
+
this.histogram = [];
|
|
37
|
+
let counter = 0;
|
|
38
|
+
for (let i = range.startLineNumber - 1; i < range.endLineNumberExclusive - 1; i++) {
|
|
39
|
+
const line = lines[i];
|
|
40
|
+
for (let j = 0; j < line.length; j++) {
|
|
41
|
+
counter++;
|
|
42
|
+
const chr = line[j];
|
|
43
|
+
const key = LineRangeFragment.getKey(chr);
|
|
44
|
+
this.histogram[key] = (this.histogram[key] || 0) + 1;
|
|
45
|
+
}
|
|
46
|
+
counter++;
|
|
47
|
+
const key = LineRangeFragment.getKey('\n');
|
|
48
|
+
this.histogram[key] = (this.histogram[key] || 0) + 1;
|
|
49
|
+
}
|
|
50
|
+
this.totalCount = counter;
|
|
51
|
+
}
|
|
52
|
+
computeSimilarity(other) {
|
|
53
|
+
let sumDifferences = 0;
|
|
54
|
+
const maxLength = Math.max(this.histogram.length, other.histogram.length);
|
|
55
|
+
for (let i = 0; i < maxLength; i++) {
|
|
56
|
+
sumDifferences += Math.abs((this.histogram[i] ?? 0) - (other.histogram[i] ?? 0));
|
|
57
|
+
}
|
|
58
|
+
return 1 - (sumDifferences / (this.totalCount + other.totalCount));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Array2D, LineRangeFragment, isSpace };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EditorTheme } from '../editorTheme.js';
|
|
2
|
+
|
|
3
|
+
/*---------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
+
*--------------------------------------------------------------------------------------------*/
|
|
7
|
+
class ViewContext {
|
|
8
|
+
constructor(configuration, theme, model) {
|
|
9
|
+
this.configuration = configuration;
|
|
10
|
+
this.theme = new EditorTheme(theme);
|
|
11
|
+
this.viewModel = model;
|
|
12
|
+
this.viewLayout = model.viewLayout;
|
|
13
|
+
}
|
|
14
|
+
addEventHandler(eventHandler) {
|
|
15
|
+
this.viewModel.addViewEventHandler(eventHandler);
|
|
16
|
+
}
|
|
17
|
+
removeEventHandler(eventHandler) {
|
|
18
|
+
this.viewModel.removeViewEventHandler(eventHandler);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { ViewContext };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Disposable } from '../../base/common/lifecycle.js';
|
|
2
|
+
|
|
3
|
+
/*---------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
+
*--------------------------------------------------------------------------------------------*/
|
|
7
|
+
class ViewEventHandler extends Disposable {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this._shouldRender = true;
|
|
11
|
+
}
|
|
12
|
+
shouldRender() {
|
|
13
|
+
return this._shouldRender;
|
|
14
|
+
}
|
|
15
|
+
forceShouldRender() {
|
|
16
|
+
this._shouldRender = true;
|
|
17
|
+
}
|
|
18
|
+
setShouldRender() {
|
|
19
|
+
this._shouldRender = true;
|
|
20
|
+
}
|
|
21
|
+
onDidRender() {
|
|
22
|
+
this._shouldRender = false;
|
|
23
|
+
}
|
|
24
|
+
// --- begin event handlers
|
|
25
|
+
onCompositionStart(e) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
onCompositionEnd(e) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
onConfigurationChanged(e) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
onCursorStateChanged(e) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
onDecorationsChanged(e) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
onFlushed(e) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
onFocusChanged(e) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
onLanguageConfigurationChanged(e) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
onLineMappingChanged(e) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
onLinesChanged(e) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
onLinesDeleted(e) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
onLinesInserted(e) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
onRevealRangeRequest(e) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
onScrollChanged(e) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
onThemeChanged(e) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
onTokensChanged(e) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
onTokensColorsChanged(e) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
onZonesChanged(e) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
// --- end event handlers
|
|
80
|
+
handleEvents(events) {
|
|
81
|
+
let shouldRender = false;
|
|
82
|
+
for (let i = 0, len = events.length; i < len; i++) {
|
|
83
|
+
const e = events[i];
|
|
84
|
+
switch (e.type) {
|
|
85
|
+
case 0 /* viewEvents.ViewEventType.ViewCompositionStart */:
|
|
86
|
+
if (this.onCompositionStart(e)) {
|
|
87
|
+
shouldRender = true;
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
case 1 /* viewEvents.ViewEventType.ViewCompositionEnd */:
|
|
91
|
+
if (this.onCompositionEnd(e)) {
|
|
92
|
+
shouldRender = true;
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
case 2 /* viewEvents.ViewEventType.ViewConfigurationChanged */:
|
|
96
|
+
if (this.onConfigurationChanged(e)) {
|
|
97
|
+
shouldRender = true;
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case 3 /* viewEvents.ViewEventType.ViewCursorStateChanged */:
|
|
101
|
+
if (this.onCursorStateChanged(e)) {
|
|
102
|
+
shouldRender = true;
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case 4 /* viewEvents.ViewEventType.ViewDecorationsChanged */:
|
|
106
|
+
if (this.onDecorationsChanged(e)) {
|
|
107
|
+
shouldRender = true;
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case 5 /* viewEvents.ViewEventType.ViewFlushed */:
|
|
111
|
+
if (this.onFlushed(e)) {
|
|
112
|
+
shouldRender = true;
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
case 6 /* viewEvents.ViewEventType.ViewFocusChanged */:
|
|
116
|
+
if (this.onFocusChanged(e)) {
|
|
117
|
+
shouldRender = true;
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
case 7 /* viewEvents.ViewEventType.ViewLanguageConfigurationChanged */:
|
|
121
|
+
if (this.onLanguageConfigurationChanged(e)) {
|
|
122
|
+
shouldRender = true;
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
case 8 /* viewEvents.ViewEventType.ViewLineMappingChanged */:
|
|
126
|
+
if (this.onLineMappingChanged(e)) {
|
|
127
|
+
shouldRender = true;
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case 9 /* viewEvents.ViewEventType.ViewLinesChanged */:
|
|
131
|
+
if (this.onLinesChanged(e)) {
|
|
132
|
+
shouldRender = true;
|
|
133
|
+
}
|
|
134
|
+
break;
|
|
135
|
+
case 10 /* viewEvents.ViewEventType.ViewLinesDeleted */:
|
|
136
|
+
if (this.onLinesDeleted(e)) {
|
|
137
|
+
shouldRender = true;
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
case 11 /* viewEvents.ViewEventType.ViewLinesInserted */:
|
|
141
|
+
if (this.onLinesInserted(e)) {
|
|
142
|
+
shouldRender = true;
|
|
143
|
+
}
|
|
144
|
+
break;
|
|
145
|
+
case 12 /* viewEvents.ViewEventType.ViewRevealRangeRequest */:
|
|
146
|
+
if (this.onRevealRangeRequest(e)) {
|
|
147
|
+
shouldRender = true;
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
case 13 /* viewEvents.ViewEventType.ViewScrollChanged */:
|
|
151
|
+
if (this.onScrollChanged(e)) {
|
|
152
|
+
shouldRender = true;
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
case 15 /* viewEvents.ViewEventType.ViewTokensChanged */:
|
|
156
|
+
if (this.onTokensChanged(e)) {
|
|
157
|
+
shouldRender = true;
|
|
158
|
+
}
|
|
159
|
+
break;
|
|
160
|
+
case 14 /* viewEvents.ViewEventType.ViewThemeChanged */:
|
|
161
|
+
if (this.onThemeChanged(e)) {
|
|
162
|
+
shouldRender = true;
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
case 16 /* viewEvents.ViewEventType.ViewTokensColorsChanged */:
|
|
166
|
+
if (this.onTokensColorsChanged(e)) {
|
|
167
|
+
shouldRender = true;
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
170
|
+
case 17 /* viewEvents.ViewEventType.ViewZonesChanged */:
|
|
171
|
+
if (this.onZonesChanged(e)) {
|
|
172
|
+
shouldRender = true;
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
default:
|
|
176
|
+
console.info('View received unknown event: ');
|
|
177
|
+
console.info(e);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (shouldRender) {
|
|
181
|
+
this._shouldRender = true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { ViewEventHandler };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
class ViewCompositionStartEvent {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.type = 0 /* ViewEventType.ViewCompositionStart */;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
class ViewCompositionEndEvent {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.type = 1 /* ViewEventType.ViewCompositionEnd */;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class ViewConfigurationChangedEvent {
|
|
16
|
+
constructor(source) {
|
|
17
|
+
this.type = 2 /* ViewEventType.ViewConfigurationChanged */;
|
|
18
|
+
this._source = source;
|
|
19
|
+
}
|
|
20
|
+
hasChanged(id) {
|
|
21
|
+
return this._source.hasChanged(id);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class ViewCursorStateChangedEvent {
|
|
25
|
+
constructor(selections, modelSelections, reason) {
|
|
26
|
+
this.selections = selections;
|
|
27
|
+
this.modelSelections = modelSelections;
|
|
28
|
+
this.reason = reason;
|
|
29
|
+
this.type = 3 /* ViewEventType.ViewCursorStateChanged */;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class ViewDecorationsChangedEvent {
|
|
33
|
+
constructor(source) {
|
|
34
|
+
this.type = 4 /* ViewEventType.ViewDecorationsChanged */;
|
|
35
|
+
if (source) {
|
|
36
|
+
this.affectsMinimap = source.affectsMinimap;
|
|
37
|
+
this.affectsOverviewRuler = source.affectsOverviewRuler;
|
|
38
|
+
this.affectsGlyphMargin = source.affectsGlyphMargin;
|
|
39
|
+
this.affectsLineNumber = source.affectsLineNumber;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.affectsMinimap = true;
|
|
43
|
+
this.affectsOverviewRuler = true;
|
|
44
|
+
this.affectsGlyphMargin = true;
|
|
45
|
+
this.affectsLineNumber = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class ViewFlushedEvent {
|
|
50
|
+
constructor() {
|
|
51
|
+
this.type = 5 /* ViewEventType.ViewFlushed */;
|
|
52
|
+
// Nothing to do
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class ViewFocusChangedEvent {
|
|
56
|
+
constructor(isFocused) {
|
|
57
|
+
this.type = 6 /* ViewEventType.ViewFocusChanged */;
|
|
58
|
+
this.isFocused = isFocused;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
class ViewLanguageConfigurationEvent {
|
|
62
|
+
constructor() {
|
|
63
|
+
this.type = 7 /* ViewEventType.ViewLanguageConfigurationChanged */;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
class ViewLineMappingChangedEvent {
|
|
67
|
+
constructor() {
|
|
68
|
+
this.type = 8 /* ViewEventType.ViewLineMappingChanged */;
|
|
69
|
+
// Nothing to do
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
class ViewLinesChangedEvent {
|
|
73
|
+
constructor(
|
|
74
|
+
/**
|
|
75
|
+
* The first line that has changed.
|
|
76
|
+
*/
|
|
77
|
+
fromLineNumber,
|
|
78
|
+
/**
|
|
79
|
+
* The number of lines that have changed.
|
|
80
|
+
*/
|
|
81
|
+
count) {
|
|
82
|
+
this.fromLineNumber = fromLineNumber;
|
|
83
|
+
this.count = count;
|
|
84
|
+
this.type = 9 /* ViewEventType.ViewLinesChanged */;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
class ViewLinesDeletedEvent {
|
|
88
|
+
constructor(fromLineNumber, toLineNumber) {
|
|
89
|
+
this.type = 10 /* ViewEventType.ViewLinesDeleted */;
|
|
90
|
+
this.fromLineNumber = fromLineNumber;
|
|
91
|
+
this.toLineNumber = toLineNumber;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
class ViewLinesInsertedEvent {
|
|
95
|
+
constructor(fromLineNumber, toLineNumber) {
|
|
96
|
+
this.type = 11 /* ViewEventType.ViewLinesInserted */;
|
|
97
|
+
this.fromLineNumber = fromLineNumber;
|
|
98
|
+
this.toLineNumber = toLineNumber;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
class ViewRevealRangeRequestEvent {
|
|
102
|
+
constructor(
|
|
103
|
+
/**
|
|
104
|
+
* Source of the call that caused the event.
|
|
105
|
+
*/
|
|
106
|
+
source,
|
|
107
|
+
/**
|
|
108
|
+
* Reduce the revealing to a minimum (e.g. avoid scrolling if the bounding box is visible and near the viewport edge).
|
|
109
|
+
*/
|
|
110
|
+
minimalReveal,
|
|
111
|
+
/**
|
|
112
|
+
* Range to be reavealed.
|
|
113
|
+
*/
|
|
114
|
+
range,
|
|
115
|
+
/**
|
|
116
|
+
* Selections to be revealed.
|
|
117
|
+
*/
|
|
118
|
+
selections,
|
|
119
|
+
/**
|
|
120
|
+
* The vertical reveal strategy.
|
|
121
|
+
*/
|
|
122
|
+
verticalType,
|
|
123
|
+
/**
|
|
124
|
+
* If true: there should be a horizontal & vertical revealing.
|
|
125
|
+
* If false: there should be just a vertical revealing.
|
|
126
|
+
*/
|
|
127
|
+
revealHorizontal,
|
|
128
|
+
/**
|
|
129
|
+
* The scroll type.
|
|
130
|
+
*/
|
|
131
|
+
scrollType) {
|
|
132
|
+
this.source = source;
|
|
133
|
+
this.minimalReveal = minimalReveal;
|
|
134
|
+
this.range = range;
|
|
135
|
+
this.selections = selections;
|
|
136
|
+
this.verticalType = verticalType;
|
|
137
|
+
this.revealHorizontal = revealHorizontal;
|
|
138
|
+
this.scrollType = scrollType;
|
|
139
|
+
this.type = 12 /* ViewEventType.ViewRevealRangeRequest */;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
class ViewScrollChangedEvent {
|
|
143
|
+
constructor(source) {
|
|
144
|
+
this.type = 13 /* ViewEventType.ViewScrollChanged */;
|
|
145
|
+
this.scrollWidth = source.scrollWidth;
|
|
146
|
+
this.scrollLeft = source.scrollLeft;
|
|
147
|
+
this.scrollHeight = source.scrollHeight;
|
|
148
|
+
this.scrollTop = source.scrollTop;
|
|
149
|
+
this.scrollWidthChanged = source.scrollWidthChanged;
|
|
150
|
+
this.scrollLeftChanged = source.scrollLeftChanged;
|
|
151
|
+
this.scrollHeightChanged = source.scrollHeightChanged;
|
|
152
|
+
this.scrollTopChanged = source.scrollTopChanged;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
class ViewThemeChangedEvent {
|
|
156
|
+
constructor(theme) {
|
|
157
|
+
this.theme = theme;
|
|
158
|
+
this.type = 14 /* ViewEventType.ViewThemeChanged */;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
class ViewTokensChangedEvent {
|
|
162
|
+
constructor(ranges) {
|
|
163
|
+
this.type = 15 /* ViewEventType.ViewTokensChanged */;
|
|
164
|
+
this.ranges = ranges;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
class ViewTokensColorsChangedEvent {
|
|
168
|
+
constructor() {
|
|
169
|
+
this.type = 16 /* ViewEventType.ViewTokensColorsChanged */;
|
|
170
|
+
// Nothing to do
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
class ViewZonesChangedEvent {
|
|
174
|
+
constructor() {
|
|
175
|
+
this.type = 17 /* ViewEventType.ViewZonesChanged */;
|
|
176
|
+
// Nothing to do
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export { ViewCompositionEndEvent, ViewCompositionStartEvent, ViewConfigurationChangedEvent, ViewCursorStateChangedEvent, ViewDecorationsChangedEvent, ViewFlushedEvent, ViewFocusChangedEvent, ViewLanguageConfigurationEvent, ViewLineMappingChangedEvent, ViewLinesChangedEvent, ViewLinesDeletedEvent, ViewLinesInsertedEvent, ViewRevealRangeRequestEvent, ViewScrollChangedEvent, ViewThemeChangedEvent, ViewTokensChangedEvent, ViewTokensColorsChangedEvent, ViewZonesChangedEvent };
|