monaco-editor11 1.0.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/monaco-editor11.es.js +11 -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
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ function a(r) {
|
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function k(r) {
|
|
18
18
|
return new Worker(
|
|
19
19
|
"/assets/css.worker-C7FogG4G.js",
|
|
20
20
|
{
|
|
@@ -22,7 +22,7 @@ function c(r) {
|
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function c(r) {
|
|
26
26
|
return new Worker(
|
|
27
27
|
"/assets/json.worker-CMC9kgPL.js",
|
|
28
28
|
{
|
|
@@ -38,17 +38,12 @@ function s(r) {
|
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
W as initMonacoWorker
|
|
54
|
-
};
|
|
41
|
+
try {
|
|
42
|
+
self.MonacoEnvironment = {
|
|
43
|
+
getWorker(r, e) {
|
|
44
|
+
return e == "json" ? new c() : e == "css" || e == "scss" || e == "less" ? new k() : e == "html" || e == "handlebars" || e == "razor" ? new a() : e == "typescript" || e == "javascript" ? new s() : new n();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
} catch (r) {
|
|
48
|
+
console.log("initMonacoWorker资源加载失败", r);
|
|
49
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n
|
|
1
|
+
(function(n){typeof define=="function"&&define.amd?define(n):n()})((function(){"use strict";function n(r){return new Worker("/assets/editor.worker-iXcRX1Tq.js",{name:r==null?void 0:r.name})}function a(r){return new Worker("/assets/html.worker-C8VxctEJ.js",{name:r==null?void 0:r.name})}function c(r){return new Worker("/assets/css.worker-C7FogG4G.js",{name:r==null?void 0:r.name})}function s(r){return new Worker("/assets/json.worker-CMC9kgPL.js",{name:r==null?void 0:r.name})}function t(r){return new Worker("/assets/ts.worker-CtTJ3hNN.js",{name:r==null?void 0:r.name})}try{self.MonacoEnvironment={getWorker(r,e){return e=="json"?new s:e=="css"||e=="scss"||e=="less"?new c:e=="html"||e=="handlebars"||e=="razor"?new a:e=="typescript"||e=="javascript"?new t:new n}}}catch(r){console.log("initMonacoWorker资源加载失败",r)}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monaco-editor11",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/monaco-editor11.umd.js",
|
|
6
6
|
"module": "dist/monaco-editor11.es.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"element-plus": "^2.10.7",
|
|
18
18
|
"monaco-editor": "^0.55.1",
|
|
19
|
-
"monaco-editor11": "^1.0.
|
|
19
|
+
"monaco-editor11": "^1.0.9",
|
|
20
20
|
"pinia": "^2.1.36",
|
|
21
21
|
"vue": "^3.5.13",
|
|
22
22
|
"vue-virtual-scroller": "^2.0.0-beta.8",
|
package/dist/monaco.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { start } from '../editor/editor.worker.start.js';
|
|
2
|
-
|
|
3
|
-
let initialized = false;
|
|
4
|
-
function isWorkerInitialized() {
|
|
5
|
-
return initialized;
|
|
6
|
-
}
|
|
7
|
-
function initialize(callback) {
|
|
8
|
-
initialized = true;
|
|
9
|
-
self.onmessage = (m) => {
|
|
10
|
-
start((ctx) => {
|
|
11
|
-
return callback(ctx, m.data);
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { initialize, isWorkerInitialized };
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import '../editor/browser/coreCommands.js';
|
|
2
|
-
import '../editor/browser/widget/codeEditor/codeEditorWidget.js';
|
|
3
|
-
import '../editor/browser/widget/diffEditor/diffEditor.contribution.js';
|
|
4
|
-
import '../editor/contrib/anchorSelect/browser/anchorSelect.js';
|
|
5
|
-
import '../editor/contrib/bracketMatching/browser/bracketMatching.js';
|
|
6
|
-
import '../editor/contrib/caretOperations/browser/caretOperations.js';
|
|
7
|
-
import '../editor/contrib/caretOperations/browser/transpose.js';
|
|
8
|
-
import '../editor/contrib/clipboard/browser/clipboard.js';
|
|
9
|
-
import '../editor/contrib/codeAction/browser/codeActionContributions.js';
|
|
10
|
-
import '../editor/contrib/codelens/browser/codelensController.js';
|
|
11
|
-
import '../editor/contrib/colorPicker/browser/colorPickerContribution.js';
|
|
12
|
-
import '../editor/contrib/comment/browser/comment.js';
|
|
13
|
-
import '../editor/contrib/contextmenu/browser/contextmenu.js';
|
|
14
|
-
import '../editor/contrib/cursorUndo/browser/cursorUndo.js';
|
|
15
|
-
import '../editor/contrib/dnd/browser/dnd.js';
|
|
16
|
-
import '../editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js';
|
|
17
|
-
import '../editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js';
|
|
18
|
-
import '../editor/contrib/find/browser/findController.js';
|
|
19
|
-
import '../editor/contrib/folding/browser/folding.js';
|
|
20
|
-
import '../editor/contrib/fontZoom/browser/fontZoom.js';
|
|
21
|
-
import '../editor/contrib/format/browser/formatActions.js';
|
|
22
|
-
import '../editor/contrib/documentSymbols/browser/documentSymbols.js';
|
|
23
|
-
import '../editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js';
|
|
24
|
-
import '../editor/contrib/inlineProgress/browser/inlineProgress.js';
|
|
25
|
-
import '../editor/contrib/gotoSymbol/browser/goToCommands.js';
|
|
26
|
-
import '../editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js';
|
|
27
|
-
import '../editor/contrib/gotoError/browser/gotoError.js';
|
|
28
|
-
import '../editor/contrib/gpu/browser/gpuActions.js';
|
|
29
|
-
import '../editor/contrib/hover/browser/hoverContribution.js';
|
|
30
|
-
import '../editor/contrib/indentation/browser/indentation.js';
|
|
31
|
-
import '../editor/contrib/inlayHints/browser/inlayHintsContribution.js';
|
|
32
|
-
import '../editor/contrib/inPlaceReplace/browser/inPlaceReplace.js';
|
|
33
|
-
import '../editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js';
|
|
34
|
-
import '../editor/contrib/lineSelection/browser/lineSelection.js';
|
|
35
|
-
import '../editor/contrib/linesOperations/browser/linesOperations.js';
|
|
36
|
-
import '../editor/contrib/linkedEditing/browser/linkedEditing.js';
|
|
37
|
-
import '../editor/contrib/links/browser/links.js';
|
|
38
|
-
import '../editor/contrib/longLinesHelper/browser/longLinesHelper.js';
|
|
39
|
-
import '../editor/contrib/middleScroll/browser/middleScroll.contribution.js';
|
|
40
|
-
import '../editor/contrib/multicursor/browser/multicursor.js';
|
|
41
|
-
import '../editor/contrib/parameterHints/browser/parameterHints.js';
|
|
42
|
-
import '../editor/contrib/placeholderText/browser/placeholderText.contribution.js';
|
|
43
|
-
import '../editor/contrib/rename/browser/rename.js';
|
|
44
|
-
import '../editor/contrib/sectionHeaders/browser/sectionHeaders.js';
|
|
45
|
-
import '../editor/contrib/semanticTokens/browser/documentSemanticTokens.js';
|
|
46
|
-
import '../editor/contrib/semanticTokens/browser/viewportSemanticTokens.js';
|
|
47
|
-
import '../editor/contrib/smartSelect/browser/smartSelect.js';
|
|
48
|
-
import '../editor/contrib/snippet/browser/snippetController2.js';
|
|
49
|
-
import '../editor/contrib/stickyScroll/browser/stickyScrollContribution.js';
|
|
50
|
-
import '../editor/contrib/suggest/browser/suggestController.js';
|
|
51
|
-
import '../editor/contrib/suggest/browser/suggestInlineCompletions.js';
|
|
52
|
-
import '../editor/contrib/tokenization/browser/tokenization.js';
|
|
53
|
-
import '../editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js';
|
|
54
|
-
import '../editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js';
|
|
55
|
-
import '../editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js';
|
|
56
|
-
import '../editor/contrib/wordHighlighter/browser/wordHighlighter.js';
|
|
57
|
-
import '../editor/contrib/wordOperations/browser/wordOperations.js';
|
|
58
|
-
import '../editor/contrib/wordPartOperations/browser/wordPartOperations.js';
|
|
59
|
-
import '../editor/contrib/readOnlyMessage/browser/contribution.js';
|
|
60
|
-
import '../editor/contrib/diffEditorBreadcrumbs/browser/contribution.js';
|
|
61
|
-
import '../editor/contrib/floatingMenu/browser/floatingMenu.contribution.js';
|
|
62
|
-
import '../editor/common/standaloneStrings.js';
|
|
63
|
-
import '../base/browser/ui/codicons/codicon/codicon.css';
|
|
64
|
-
import '../base/browser/ui/codicons/codicon/codicon-modifiers.css';
|
|
65
|
-
import '../editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js';
|
|
66
|
-
import '../editor/standalone/browser/inspectTokens/inspectTokens.js';
|
|
67
|
-
import '../editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js';
|
|
68
|
-
import '../editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js';
|
|
69
|
-
import '../editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js';
|
|
70
|
-
import '../editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js';
|
|
71
|
-
import '../editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js';
|
|
72
|
-
import '../editor/standalone/browser/toggleHighContrast/toggleHighContrast.js';
|
|
73
|
-
import { editor } from '../editor/editor.api2.js';
|
|
74
|
-
|
|
75
|
-
function createTrustedTypesPolicy(policyName, policyOptions) {
|
|
76
|
-
const monacoEnvironment = globalThis.MonacoEnvironment;
|
|
77
|
-
if (monacoEnvironment?.createTrustedTypesPolicy) {
|
|
78
|
-
try {
|
|
79
|
-
return monacoEnvironment.createTrustedTypesPolicy(policyName, policyOptions);
|
|
80
|
-
} catch (err) {
|
|
81
|
-
console.error(err);
|
|
82
|
-
return void 0;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
return globalThis.trustedTypes?.createPolicy(policyName, policyOptions);
|
|
87
|
-
} catch (err) {
|
|
88
|
-
console.error(err);
|
|
89
|
-
return void 0;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
let ttPolicy;
|
|
93
|
-
if (typeof self === "object" && self.constructor && self.constructor.name === "DedicatedWorkerGlobalScope" && globalThis.workerttPolicy !== void 0) {
|
|
94
|
-
ttPolicy = globalThis.workerttPolicy;
|
|
95
|
-
} else {
|
|
96
|
-
ttPolicy = createTrustedTypesPolicy("defaultWorkerFactory", {
|
|
97
|
-
createScriptURL: (value) => value
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function getWorker(descriptor) {
|
|
101
|
-
const label = descriptor.label;
|
|
102
|
-
const monacoEnvironment = globalThis.MonacoEnvironment;
|
|
103
|
-
if (monacoEnvironment) {
|
|
104
|
-
if (typeof monacoEnvironment.getWorker === "function") {
|
|
105
|
-
return monacoEnvironment.getWorker("workerMain.js", label);
|
|
106
|
-
}
|
|
107
|
-
if (typeof monacoEnvironment.getWorkerUrl === "function") {
|
|
108
|
-
const workerUrl = monacoEnvironment.getWorkerUrl("workerMain.js", label);
|
|
109
|
-
return new Worker(
|
|
110
|
-
ttPolicy ? ttPolicy.createScriptURL(workerUrl) : workerUrl,
|
|
111
|
-
{ name: label, type: "module" }
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
if (descriptor.createWorker) {
|
|
116
|
-
return descriptor.createWorker();
|
|
117
|
-
}
|
|
118
|
-
throw new Error(
|
|
119
|
-
`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
function createWebWorker(opts) {
|
|
123
|
-
const worker = Promise.resolve(
|
|
124
|
-
getWorker({
|
|
125
|
-
label: opts.label ?? "monaco-editor-worker",
|
|
126
|
-
moduleId: opts.moduleId,
|
|
127
|
-
createWorker: opts.createWorker
|
|
128
|
-
})
|
|
129
|
-
).then((w) => {
|
|
130
|
-
w.postMessage("ignore");
|
|
131
|
-
w.postMessage(opts.createData);
|
|
132
|
-
return w;
|
|
133
|
-
});
|
|
134
|
-
return editor.createWebWorker({
|
|
135
|
-
worker,
|
|
136
|
-
host: opts.host,
|
|
137
|
-
keepIdleModels: opts.keepIdleModels
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export { createWebWorker };
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { equals } from '../../../../base/common/arrays.js';
|
|
2
|
-
import { RunOnceScheduler } from '../../../../base/common/async.js';
|
|
3
|
-
import { Emitter } from '../../../../base/common/event.js';
|
|
4
|
-
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
5
|
-
import { LineRange } from '../../core/ranges/lineRange.js';
|
|
6
|
-
import '../../../../base/common/observableInternal/index.js';
|
|
7
|
-
import { itemsEquals, itemEquals, equalsIfDefined } from '../../../../base/common/equals.js';
|
|
8
|
-
import { observableSignal } from '../../../../base/common/observableInternal/observables/observableSignal.js';
|
|
9
|
-
import { observableValueOpts } from '../../../../base/common/observableInternal/observables/observableValueOpts.js';
|
|
10
|
-
import { derivedOpts } from '../../../../base/common/observableInternal/observables/derived.js';
|
|
11
|
-
|
|
12
|
-
/*---------------------------------------------------------------------------------------------
|
|
13
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
14
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
15
|
-
*--------------------------------------------------------------------------------------------*/
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
class AttachedViews {
|
|
20
|
-
constructor() {
|
|
21
|
-
this._onDidChangeVisibleRanges = new Emitter();
|
|
22
|
-
this.onDidChangeVisibleRanges = this._onDidChangeVisibleRanges.event;
|
|
23
|
-
this._views = new Set();
|
|
24
|
-
this._viewsChanged = observableSignal(this);
|
|
25
|
-
this.visibleLineRanges = derivedOpts({
|
|
26
|
-
owner: this,
|
|
27
|
-
equalsFn: itemsEquals(itemEquals())
|
|
28
|
-
}, reader => {
|
|
29
|
-
this._viewsChanged.read(reader);
|
|
30
|
-
const ranges = LineRange.joinMany([...this._views].map(view => view.state.read(reader)?.visibleLineRanges ?? []));
|
|
31
|
-
return ranges;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
attachView() {
|
|
35
|
-
const view = new AttachedViewImpl((state) => {
|
|
36
|
-
this._onDidChangeVisibleRanges.fire({ view, state });
|
|
37
|
-
});
|
|
38
|
-
this._views.add(view);
|
|
39
|
-
this._viewsChanged.trigger(undefined);
|
|
40
|
-
return view;
|
|
41
|
-
}
|
|
42
|
-
detachView(view) {
|
|
43
|
-
this._views.delete(view);
|
|
44
|
-
this._onDidChangeVisibleRanges.fire({ view, state: undefined });
|
|
45
|
-
this._viewsChanged.trigger(undefined);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @internal
|
|
50
|
-
*/
|
|
51
|
-
class AttachedViewState {
|
|
52
|
-
constructor(visibleLineRanges, stabilized) {
|
|
53
|
-
this.visibleLineRanges = visibleLineRanges;
|
|
54
|
-
this.stabilized = stabilized;
|
|
55
|
-
}
|
|
56
|
-
equals(other) {
|
|
57
|
-
if (this === other) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
if (!equals(this.visibleLineRanges, other.visibleLineRanges, (a, b) => a.equals(b))) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
if (this.stabilized !== other.stabilized) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
class AttachedViewImpl {
|
|
70
|
-
get state() { return this._state; }
|
|
71
|
-
constructor(handleStateChange) {
|
|
72
|
-
this.handleStateChange = handleStateChange;
|
|
73
|
-
this._state = observableValueOpts({ owner: this, equalsFn: equalsIfDefined((a, b) => a.equals(b)) }, undefined);
|
|
74
|
-
}
|
|
75
|
-
setVisibleLines(visibleLines, stabilized) {
|
|
76
|
-
const visibleLineRanges = visibleLines.map((line) => new LineRange(line.startLineNumber, line.endLineNumber + 1));
|
|
77
|
-
const state = new AttachedViewState(visibleLineRanges, stabilized);
|
|
78
|
-
this._state.set(state, undefined, undefined);
|
|
79
|
-
this.handleStateChange(state);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
class AttachedViewHandler extends Disposable {
|
|
83
|
-
get lineRanges() { return this._lineRanges; }
|
|
84
|
-
constructor(_refreshTokens) {
|
|
85
|
-
super();
|
|
86
|
-
this._refreshTokens = _refreshTokens;
|
|
87
|
-
this.runner = this._register(new RunOnceScheduler(() => this.update(), 50));
|
|
88
|
-
this._computedLineRanges = [];
|
|
89
|
-
this._lineRanges = [];
|
|
90
|
-
}
|
|
91
|
-
update() {
|
|
92
|
-
if (equals(this._computedLineRanges, this._lineRanges, (a, b) => a.equals(b))) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
this._computedLineRanges = this._lineRanges;
|
|
96
|
-
this._refreshTokens();
|
|
97
|
-
}
|
|
98
|
-
handleStateChange(state) {
|
|
99
|
-
this._lineRanges = state.visibleLineRanges;
|
|
100
|
-
if (state.stabilized) {
|
|
101
|
-
this.runner.cancel();
|
|
102
|
-
this.update();
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
this.runner.schedule();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
class AbstractSyntaxTokenBackend extends Disposable {
|
|
110
|
-
get backgroundTokenizationState() {
|
|
111
|
-
return this._backgroundTokenizationState;
|
|
112
|
-
}
|
|
113
|
-
constructor(_languageIdCodec, _textModel) {
|
|
114
|
-
super();
|
|
115
|
-
this._languageIdCodec = _languageIdCodec;
|
|
116
|
-
this._textModel = _textModel;
|
|
117
|
-
this._onDidChangeTokens = this._register(new Emitter());
|
|
118
|
-
/** @internal, should not be exposed by the text model! */
|
|
119
|
-
this.onDidChangeTokens = this._onDidChangeTokens.event;
|
|
120
|
-
}
|
|
121
|
-
tokenizeIfCheap(lineNumber) {
|
|
122
|
-
if (this.isCheapToTokenize(lineNumber)) {
|
|
123
|
-
this.forceTokenization(lineNumber);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export { AbstractSyntaxTokenBackend, AttachedViewHandler, AttachedViewState, AttachedViews };
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { assert } from '../../../../base/common/assert.js';
|
|
2
|
-
import { Position } from '../position.js';
|
|
3
|
-
import { Range } from '../range.js';
|
|
4
|
-
import { TextLength } from './textLength.js';
|
|
5
|
-
import { PositionOffsetTransformer } from './positionToOffsetImpl.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 AbstractText {
|
|
12
|
-
constructor() {
|
|
13
|
-
this._transformer = undefined;
|
|
14
|
-
}
|
|
15
|
-
get endPositionExclusive() {
|
|
16
|
-
return this.length.addToPosition(new Position(1, 1));
|
|
17
|
-
}
|
|
18
|
-
get lineRange() {
|
|
19
|
-
return this.length.toLineRange();
|
|
20
|
-
}
|
|
21
|
-
getValue() {
|
|
22
|
-
return this.getValueOfRange(this.length.toRange());
|
|
23
|
-
}
|
|
24
|
-
getValueOfOffsetRange(range) {
|
|
25
|
-
return this.getValueOfRange(this.getTransformer().getRange(range));
|
|
26
|
-
}
|
|
27
|
-
getLineLength(lineNumber) {
|
|
28
|
-
return this.getValueOfRange(new Range(lineNumber, 1, lineNumber, Number.MAX_SAFE_INTEGER)).length;
|
|
29
|
-
}
|
|
30
|
-
getTransformer() {
|
|
31
|
-
if (!this._transformer) {
|
|
32
|
-
this._transformer = new PositionOffsetTransformer(this.getValue());
|
|
33
|
-
}
|
|
34
|
-
return this._transformer;
|
|
35
|
-
}
|
|
36
|
-
getLineAt(lineNumber) {
|
|
37
|
-
return this.getValueOfRange(new Range(lineNumber, 1, lineNumber, Number.MAX_SAFE_INTEGER));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
class LineBasedText extends AbstractText {
|
|
41
|
-
constructor(_getLineContent, _lineCount) {
|
|
42
|
-
assert(_lineCount >= 1);
|
|
43
|
-
super();
|
|
44
|
-
this._getLineContent = _getLineContent;
|
|
45
|
-
this._lineCount = _lineCount;
|
|
46
|
-
}
|
|
47
|
-
getValueOfRange(range) {
|
|
48
|
-
if (range.startLineNumber === range.endLineNumber) {
|
|
49
|
-
return this._getLineContent(range.startLineNumber).substring(range.startColumn - 1, range.endColumn - 1);
|
|
50
|
-
}
|
|
51
|
-
let result = this._getLineContent(range.startLineNumber).substring(range.startColumn - 1);
|
|
52
|
-
for (let i = range.startLineNumber + 1; i < range.endLineNumber; i++) {
|
|
53
|
-
result += '\n' + this._getLineContent(i);
|
|
54
|
-
}
|
|
55
|
-
result += '\n' + this._getLineContent(range.endLineNumber).substring(0, range.endColumn - 1);
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
getLineLength(lineNumber) {
|
|
59
|
-
return this._getLineContent(lineNumber).length;
|
|
60
|
-
}
|
|
61
|
-
get length() {
|
|
62
|
-
const lastLine = this._getLineContent(this._lineCount);
|
|
63
|
-
return new TextLength(this._lineCount - 1, lastLine.length);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
class ArrayText extends LineBasedText {
|
|
67
|
-
constructor(lines) {
|
|
68
|
-
super(lineNumber => lines[lineNumber - 1], lines.length);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
class StringText extends AbstractText {
|
|
72
|
-
constructor(value) {
|
|
73
|
-
super();
|
|
74
|
-
this.value = value;
|
|
75
|
-
this._t = new PositionOffsetTransformer(this.value);
|
|
76
|
-
}
|
|
77
|
-
getValueOfRange(range) {
|
|
78
|
-
return this._t.getOffsetRange(range).substring(this.value);
|
|
79
|
-
}
|
|
80
|
-
get length() {
|
|
81
|
-
return this._t.textLength;
|
|
82
|
-
}
|
|
83
|
-
// Override the getTransformer method to return the cached transformer
|
|
84
|
-
getTransformer() {
|
|
85
|
-
return this._t;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export { AbstractText, ArrayText, LineBasedText, StringText };
|