monaco-editor11 1.1.0 → 1.1.2
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 -8
- package/dist/monaco-editor11.es.js +1 -49
- package/dist/monaco-editor11.umd.js +1 -1
- package/dist/workers/_.contribution.js +120 -0
- package/dist/workers/abap.contribution.js +8 -0
- package/dist/workers/abap.js +1397 -0
- package/dist/workers/abstractCodeEditorService.js +129 -0
- package/dist/workers/abstractKeybindingService.js +286 -0
- package/dist/workers/abstractScrollbar.js +214 -0
- package/dist/workers/abstractSyntaxTokenBackend.js +128 -0
- package/dist/workers/abstractText.js +89 -0
- package/dist/workers/abstractTree.js +2027 -0
- package/dist/workers/accessibility.js +11 -0
- package/dist/workers/accessibilityService.js +111 -0
- package/dist/workers/accessibilitySignalService.js +331 -0
- package/dist/workers/accessibleDiffViewer.js +588 -0
- package/dist/workers/accessibleViewRegistry.js +25 -0
- package/dist/workers/action.js +15 -0
- package/dist/workers/actionCommonCategories.js +16 -0
- package/dist/workers/actionList.js +344 -0
- package/dist/workers/actionViewItemService.js +29 -0
- package/dist/workers/actionViewItems.js +376 -0
- package/dist/workers/actionWidget.js +236 -0
- package/dist/workers/actionbar.js +462 -0
- package/dist/workers/actions.js +483 -0
- package/dist/workers/anchorSelect.js +160 -0
- package/dist/workers/animation.js +74 -0
- package/dist/workers/apex.contribution.js +9 -0
- package/dist/workers/apex.js +329 -0
- package/dist/workers/aria.js +84 -0
- package/dist/workers/arrays.js +529 -0
- package/dist/workers/arraysFind.js +177 -0
- package/dist/workers/assert.js +79 -0
- package/dist/workers/ast.js +485 -0
- package/dist/workers/async.js +938 -0
- package/dist/workers/asyncDataTree.js +946 -0
- package/dist/workers/autoIndent.js +390 -0
- package/dist/workers/autorun.js +89 -0
- package/dist/workers/autorunImpl.js +215 -0
- package/dist/workers/azcli.contribution.js +8 -0
- package/dist/workers/azcli.js +67 -0
- package/dist/workers/bannerController.js +118 -0
- package/dist/workers/base.js +19 -0
- package/dist/workers/baseColors.js +31 -0
- package/dist/workers/baseObservable.js +106 -0
- package/dist/workers/baseRenderStrategy.js +19 -0
- package/dist/workers/baseResolvedKeybinding.js +56 -0
- package/dist/workers/bat.contribution.js +8 -0
- package/dist/workers/bat.js +99 -0
- package/dist/workers/beforeEditPositionMapper.js +110 -0
- package/dist/workers/bicep.contribution.js +8 -0
- package/dist/workers/bicep.js +108 -0
- package/dist/workers/blockCommentCommand.js +149 -0
- package/dist/workers/blockDecorations.js +97 -0
- package/dist/workers/bracketMatching.js +359 -0
- package/dist/workers/bracketPairsImpl.js +717 -0
- package/dist/workers/bracketPairsTree.js +343 -0
- package/dist/workers/bracketSelections.js +149 -0
- package/dist/workers/brackets.js +108 -0
- package/dist/workers/browser.js +57 -0
- package/dist/workers/buffer.js +81 -0
- package/dist/workers/bufferDirtyTracker.js +45 -0
- package/dist/workers/bulkEditService.js +76 -0
- package/dist/workers/button.js +226 -0
- package/dist/workers/cache.js +61 -0
- package/dist/workers/cameligo.contribution.js +8 -0
- package/dist/workers/cameligo.js +173 -0
- package/dist/workers/canIUse.js +23 -0
- package/dist/workers/cancellation.js +116 -0
- package/dist/workers/caretOperations.js +48 -0
- package/dist/workers/changeRecorder.js +78 -0
- package/dist/workers/changeTracker.js +80 -0
- package/dist/workers/charWidthReader.js +104 -0
- package/dist/workers/characterClassifier.js +59 -0
- package/dist/workers/characterPair.js +40 -0
- package/dist/workers/chartsColors.js +18 -0
- package/dist/workers/clickLinkGesture.js +161 -0
- package/dist/workers/clipboard.js +308 -0
- package/dist/workers/clipboardService.js +9 -0
- package/dist/workers/clipboardUtils.js +85 -0
- package/dist/workers/clojure.contribution.js +8 -0
- package/dist/workers/clojure.js +760 -0
- package/dist/workers/codeAction.js +306 -0
- package/dist/workers/codeActionCommands.js +230 -0
- package/dist/workers/codeActionContributions.js +55 -0
- package/dist/workers/codeActionController.js +372 -0
- package/dist/workers/codeActionKeybindingResolver.js +90 -0
- package/dist/workers/codeActionMenu.js +68 -0
- package/dist/workers/codeActionModel.js +334 -0
- package/dist/workers/codeEditorContributions.js +132 -0
- package/dist/workers/codeEditorService.js +9 -0
- package/dist/workers/codeEditorWidget.js +1856 -0
- package/dist/workers/codeLensCache.js +112 -0
- package/dist/workers/codelens.js +114 -0
- package/dist/workers/codelensController.js +469 -0
- package/dist/workers/codelensWidget.js +265 -0
- package/dist/workers/codicons.js +50 -0
- package/dist/workers/codiconsLibrary.js +642 -0
- package/dist/workers/codiconsUtil.js +22 -0
- package/dist/workers/coffee.contribution.js +9 -0
- package/dist/workers/coffee.js +231 -0
- package/dist/workers/collections.js +98 -0
- package/dist/workers/color.js +94 -0
- package/dist/workers/colorDetector.js +245 -0
- package/dist/workers/colorPickerBody.js +71 -0
- package/dist/workers/colorPickerCloseButton.js +34 -0
- package/dist/workers/colorPickerContribution.js +50 -0
- package/dist/workers/colorPickerHeader.js +79 -0
- package/dist/workers/colorPickerInsertButton.js +27 -0
- package/dist/workers/colorPickerModel.js +74 -0
- package/dist/workers/colorPickerParticipantUtils.js +52 -0
- package/dist/workers/colorPickerSaturationBox.js +106 -0
- package/dist/workers/colorPickerStrip.js +98 -0
- package/dist/workers/colorPickerWidget.js +32 -0
- package/dist/workers/colorUtils.js +199 -0
- package/dist/workers/colorizedBracketPairsDecorationProvider.js +97 -0
- package/dist/workers/colorizer.js +120 -0
- package/dist/workers/colors.js +20 -0
- package/dist/workers/columnRange.js +35 -0
- package/dist/workers/combineTextEditInfos.js +124 -0
- package/dist/workers/commandIds.js +12 -0
- package/dist/workers/commands.js +329 -0
- package/dist/workers/commandsQuickAccess.js +40 -0
- package/dist/workers/comment.js +147 -0
- package/dist/workers/common.js +20 -0
- package/dist/workers/comparers.js +87 -0
- package/dist/workers/completionModel.js +227 -0
- package/dist/workers/compressedObjectTreeModel.js +385 -0
- package/dist/workers/computeGhostText.js +182 -0
- package/dist/workers/computeMovedLines.js +249 -0
- package/dist/workers/concat23Trees.js +192 -0
- package/dist/workers/configuration.js +92 -0
- package/dist/workers/configurationModels.js +614 -0
- package/dist/workers/configurationRegistry.js +400 -0
- package/dist/workers/configurations.js +46 -0
- package/dist/workers/consoleObservableLogger.js +83 -0
- package/dist/workers/constObservable.js +35 -0
- package/dist/workers/contentHoverComputer.js +71 -0
- package/dist/workers/contentHoverController.js +320 -0
- package/dist/workers/contentHoverRendered.js +336 -0
- package/dist/workers/contentHoverStatusBar.js +52 -0
- package/dist/workers/contentHoverTypes.js +29 -0
- package/dist/workers/contentHoverWidget.js +394 -0
- package/dist/workers/contentHoverWidgetWrapper.js +362 -0
- package/dist/workers/contentSegmenter.js +52 -0
- package/dist/workers/contentWidgets.js +495 -0
- package/dist/workers/contextKeyService.js +468 -0
- package/dist/workers/contextMenuHandler.js +126 -0
- package/dist/workers/contextMenuService.js +103 -0
- package/dist/workers/contextScopedHistoryWidget.js +106 -0
- package/dist/workers/contextViewService.js +73 -0
- package/dist/workers/contextkey.js +1551 -0
- package/dist/workers/contextkeys.js +21 -0
- package/dist/workers/contextmenu.js +334 -0
- package/dist/workers/contextview.js +298 -0
- package/dist/workers/contiguousMultilineTokens.js +32 -0
- package/dist/workers/contiguousMultilineTokensBuilder.js +23 -0
- package/dist/workers/contiguousTokensEditing.js +128 -0
- package/dist/workers/contiguousTokensStore.js +207 -0
- package/dist/workers/contribution.js +36 -0
- package/dist/workers/coordinatesConverter.js +51 -0
- package/dist/workers/copyLinesCommand.js +73 -0
- package/dist/workers/copyPasteContribution.js +114 -0
- package/dist/workers/copyPasteController.js +585 -0
- package/dist/workers/copySelection.js +47 -0
- package/dist/workers/coreCommands.js +1731 -0
- package/dist/workers/countBadge.js +52 -0
- package/dist/workers/cpp.contribution.js +14 -0
- package/dist/workers/cpp.js +388 -0
- package/dist/workers/csharp.contribution.js +8 -0
- package/dist/workers/csharp.js +325 -0
- package/dist/workers/csp.contribution.js +8 -0
- package/dist/workers/csp.js +52 -0
- package/dist/workers/css.contribution.js +9 -0
- package/dist/workers/css.js +184 -0
- package/dist/workers/cssMode.js +198 -0
- package/dist/workers/cssValue.js +69 -0
- package/dist/workers/cssWorker.js +183 -0
- package/dist/workers/currentLineHighlight.js +205 -0
- package/dist/workers/cursor.js +899 -0
- package/dist/workers/cursorAtomicMoveOperations.js +145 -0
- package/dist/workers/cursorCollection.js +194 -0
- package/dist/workers/cursorColumnSelection.js +93 -0
- package/dist/workers/cursorColumns.js +112 -0
- package/dist/workers/cursorCommon.js +250 -0
- package/dist/workers/cursorContext.js +15 -0
- package/dist/workers/cursorDeleteOperations.js +231 -0
- package/dist/workers/cursorMoveCommands.js +676 -0
- package/dist/workers/cursorMoveOperations.js +290 -0
- package/dist/workers/cursorTypeEditOperations.js +968 -0
- package/dist/workers/cursorTypeOperations.js +173 -0
- package/dist/workers/cursorUndo.js +133 -0
- package/dist/workers/cursorUtils.js +75 -0
- package/dist/workers/cursorWordOperations.js +720 -0
- package/dist/workers/cypher.contribution.js +8 -0
- package/dist/workers/cypher.js +262 -0
- package/dist/workers/dart.contribution.js +9 -0
- package/dist/workers/dart.js +280 -0
- package/dist/workers/dataChannel.js +12 -0
- package/dist/workers/dataTransfer.js +80 -0
- package/dist/workers/dataTree.js +20 -0
- package/dist/workers/date.js +57 -0
- package/dist/workers/debugLocation.js +66 -0
- package/dist/workers/debugName.js +110 -0
- package/dist/workers/debuggerRpc.js +67 -0
- package/dist/workers/decorationCssRuleExtractor.js +73 -0
- package/dist/workers/decorationStyleCache.js +40 -0
- package/dist/workers/decorations.js +196 -0
- package/dist/workers/decorationsOverviewRuler.js +416 -0
- package/dist/workers/decorators.js +33 -0
- package/dist/workers/defaultDocumentColorProvider.js +55 -0
- package/dist/workers/defaultDocumentColorsComputer.js +138 -0
- package/dist/workers/defaultLinesDiffComputer.js +188 -0
- package/dist/workers/defaultProviders.js +230 -0
- package/dist/workers/defaultStyles.js +194 -0
- package/dist/workers/delegatingEditorImpl.js +111 -0
- package/dist/workers/derived.js +80 -0
- package/dist/workers/derivedImpl.js +353 -0
- package/dist/workers/descriptors.js +13 -0
- package/dist/workers/devToolsLogger.js +442 -0
- package/dist/workers/dialogs.js +5 -0
- package/dist/workers/diff.js +902 -0
- package/dist/workers/diffAlgorithm.js +139 -0
- package/dist/workers/diffChange.js +34 -0
- package/dist/workers/diffEditor.contribution.js +83 -0
- package/dist/workers/diffEditor.js +38 -0
- package/dist/workers/diffEditorDecorations.js +115 -0
- package/dist/workers/diffEditorEditors.js +190 -0
- package/dist/workers/diffEditorItemTemplate.js +272 -0
- package/dist/workers/diffEditorOptions.js +152 -0
- package/dist/workers/diffEditorSash.js +86 -0
- package/dist/workers/diffEditorViewModel.js +608 -0
- package/dist/workers/diffEditorViewZones.js +525 -0
- package/dist/workers/diffEditorWidget.js +590 -0
- package/dist/workers/diffProviderFactoryService.js +142 -0
- package/dist/workers/dnd.js +198 -0
- package/dist/workers/dockerfile.contribution.js +9 -0
- package/dist/workers/dockerfile.js +129 -0
- package/dist/workers/documentSemanticTokens.js +362 -0
- package/dist/workers/documentSymbols.js +24 -0
- package/dist/workers/dom.js +1454 -0
- package/dist/workers/domFontInfo.js +28 -0
- package/dist/workers/domLineBreaksComputer.js +301 -0
- package/dist/workers/domReadingContext.js +43 -0
- package/dist/workers/domSanitize.js +312 -0
- package/dist/workers/domStylesheets.js +145 -0
- package/dist/workers/dompurify.js +1347 -0
- package/dist/workers/dragAndDropCommand.js +65 -0
- package/dist/workers/dragScrolling.js +174 -0
- package/dist/workers/dropIntoEditorContribution.js +41 -0
- package/dist/workers/dropIntoEditorController.js +173 -0
- package/dist/workers/dropdown.js +141 -0
- package/dist/workers/dropdownActionViewItem.js +109 -0
- package/dist/workers/dynamicProgrammingDiffing.js +101 -0
- package/dist/workers/dynamicViewOverlay.js +10 -0
- package/dist/workers/ecl.contribution.js +8 -0
- package/dist/workers/ecl.js +455 -0
- package/dist/workers/edcore.main.js +74 -0
- package/dist/workers/edit.js +83 -0
- package/dist/workers/editContext.js +10 -0
- package/dist/workers/editContextFactory.js +16 -0
- package/dist/workers/editOperation.js +36 -0
- package/dist/workers/editStack.js +363 -0
- package/dist/workers/editor.all.js +65 -0
- package/dist/workers/editor.api.js +2 -0
- package/dist/workers/editor.api2.js +60 -0
- package/dist/workers/editor.js +15 -0
- package/dist/workers/editor.main.js +170 -0
- package/dist/workers/editor.worker.start.js +44 -0
- package/dist/workers/editorAction.js +26 -0
- package/dist/workers/editorBaseApi.js +43 -0
- package/dist/workers/editorBrowser.js +53 -0
- package/dist/workers/editorColorRegistry.js +102 -0
- package/dist/workers/editorColors.js +128 -0
- package/dist/workers/editorCommon.js +13 -0
- package/dist/workers/editorConfiguration.js +292 -0
- package/dist/workers/editorConfigurationSchema.js +338 -0
- package/dist/workers/editorContextKeys.js +84 -0
- package/dist/workers/editorDom.js +299 -0
- package/dist/workers/editorExtensions.js +489 -0
- package/dist/workers/editorFeatures.js +17 -0
- package/dist/workers/editorGutter.js +117 -0
- package/dist/workers/editorMarkdownCodeBlockRenderer.js +85 -0
- package/dist/workers/editorNavigationQuickAccess.js +152 -0
- package/dist/workers/editorOptions.js +3440 -0
- package/dist/workers/editorScrollbar.js +151 -0
- package/dist/workers/editorState.js +115 -0
- package/dist/workers/editorTheme.js +23 -0
- package/dist/workers/editorWebWorker.js +299 -0
- package/dist/workers/editorWorker.js +9 -0
- package/dist/workers/editorWorkerHost.js +15 -0
- package/dist/workers/editorWorkerService.js +366 -0
- package/dist/workers/editorZoom.js +26 -0
- package/dist/workers/electricCharacter.js +55 -0
- package/dist/workers/elementSizeObserver.js +107 -0
- package/dist/workers/elixir.contribution.js +8 -0
- package/dist/workers/elixir.js +568 -0
- package/dist/workers/embeddedCodeEditorWidget.js +66 -0
- package/dist/workers/encodedTokenAttributes.js +79 -0
- package/dist/workers/enterAction.js +53 -0
- package/dist/workers/environment.js +5 -0
- package/dist/workers/eolCounter.js +44 -0
- package/dist/workers/equals.js +84 -0
- package/dist/workers/errorMessage.js +71 -0
- package/dist/workers/errors.js +163 -0
- package/dist/workers/event.js +1197 -0
- package/dist/workers/extensions.js +18 -0
- package/dist/workers/extpath.js +147 -0
- package/dist/workers/fastDomNode.js +255 -0
- package/dist/workers/files.js +19 -0
- package/dist/workers/filters.js +742 -0
- package/dist/workers/findController.js +970 -0
- package/dist/workers/findDecorations.js +311 -0
- package/dist/workers/findInput.js +294 -0
- package/dist/workers/findInputToggles.js +52 -0
- package/dist/workers/findModel.js +497 -0
- package/dist/workers/findOptionsWidget.js +155 -0
- package/dist/workers/findSectionHeaders.js +128 -0
- package/dist/workers/findState.js +244 -0
- package/dist/workers/findWidget.js +1168 -0
- package/dist/workers/findWidgetSearchHistory.js +85 -0
- package/dist/workers/fixBrackets.js +67 -0
- package/dist/workers/fixedArray.js +70 -0
- package/dist/workers/floatingMenu.contribution.js +9 -0
- package/dist/workers/floatingMenu.js +94 -0
- package/dist/workers/flow9.contribution.js +8 -0
- package/dist/workers/flow9.js +141 -0
- package/dist/workers/folding.js +1136 -0
- package/dist/workers/foldingDecorations.js +158 -0
- package/dist/workers/foldingModel.js +532 -0
- package/dist/workers/foldingRanges.js +354 -0
- package/dist/workers/fontInfo.js +172 -0
- package/dist/workers/fontInfoFromSettings.js +29 -0
- package/dist/workers/fontMeasurements.js +206 -0
- package/dist/workers/fontZoom.js +47 -0
- package/dist/workers/fonts.js +17 -0
- package/dist/workers/format.js +367 -0
- package/dist/workers/formatActions.js +263 -0
- package/dist/workers/formattedTextRenderer.js +160 -0
- package/dist/workers/formattingEdit.js +57 -0
- package/dist/workers/forwardingTelemetryService.js +60 -0
- package/dist/workers/freemarker2.contribution.js +52 -0
- package/dist/workers/freemarker2.js +1062 -0
- package/dist/workers/fsharp.contribution.js +8 -0
- package/dist/workers/fsharp.js +216 -0
- package/dist/workers/fullFileRenderStrategy.js +414 -0
- package/dist/workers/fullFileRenderStrategy.wgsl.js +93 -0
- package/dist/workers/functional.js +24 -0
- package/dist/workers/fuzzyScorer.js +143 -0
- package/dist/workers/getHover.js +56 -0
- package/dist/workers/getIconClasses.js +106 -0
- package/dist/workers/getLinks.js +157 -0
- package/dist/workers/getPositionOffsetTransformerFromTextModel.js +24 -0
- package/dist/workers/getSemanticTokens.js +211 -0
- package/dist/workers/ghostText.js +111 -0
- package/dist/workers/ghostTextView.js +449 -0
- package/dist/workers/glob.js +581 -0
- package/dist/workers/globalPointerMoveMonitor.js +83 -0
- package/dist/workers/glyphHoverComputer.js +40 -0
- package/dist/workers/glyphHoverController.js +171 -0
- package/dist/workers/glyphHoverWidget.js +184 -0
- package/dist/workers/glyphLanesModel.js +61 -0
- package/dist/workers/glyphMargin.js +403 -0
- package/dist/workers/glyphRasterizer.js +276 -0
- package/dist/workers/go.contribution.js +8 -0
- package/dist/workers/go.js +217 -0
- package/dist/workers/goToCommands.js +694 -0
- package/dist/workers/goToDefinitionAtPosition.js +267 -0
- package/dist/workers/goToSymbol.js +128 -0
- package/dist/workers/gotoError.js +272 -0
- package/dist/workers/gotoErrorWidget.js +352 -0
- package/dist/workers/gotoLineQuickAccess.js +183 -0
- package/dist/workers/gotoSymbolQuickAccess.js +395 -0
- package/dist/workers/gpuActions.js +126 -0
- package/dist/workers/gpuDisposable.js +48 -0
- package/dist/workers/gpuMark.js +80 -0
- package/dist/workers/gpuUtils.js +58 -0
- package/dist/workers/graph.js +74 -0
- package/dist/workers/graphql.contribution.js +9 -0
- package/dist/workers/graphql.js +150 -0
- package/dist/workers/guidesTextModelPart.js +405 -0
- package/dist/workers/gutterFeature.js +238 -0
- package/dist/workers/gutterIndicatorMenu.js +252 -0
- package/dist/workers/gutterIndicatorView.js +456 -0
- package/dist/workers/handlebars.contribution.js +9 -0
- package/dist/workers/handlebars.js +485 -0
- package/dist/workers/hash.js +256 -0
- package/dist/workers/hcl.contribution.js +8 -0
- package/dist/workers/hcl.js +182 -0
- package/dist/workers/helpQuickAccess.js +77 -0
- package/dist/workers/heuristicSequenceOptimizations.js +374 -0
- package/dist/workers/hiddenRangeModel.js +126 -0
- package/dist/workers/hideUnchangedRegionsFeature.js +433 -0
- package/dist/workers/hierarchicalKind.js +26 -0
- package/dist/workers/highlightDecorations.js +111 -0
- package/dist/workers/highlightedLabel.js +129 -0
- package/dist/workers/history.js +85 -0
- package/dist/workers/historyWidgetKeybindingHint.js +9 -0
- package/dist/workers/horizontalScrollbar.js +91 -0
- package/dist/workers/hotReloadHelpers.js +17 -0
- package/dist/workers/hover.js +11 -0
- package/dist/workers/hoverAccessibleViews.js +8 -0
- package/dist/workers/hoverActionIds.js +23 -0
- package/dist/workers/hoverActions.js +424 -0
- package/dist/workers/hoverColorPicker.js +14 -0
- package/dist/workers/hoverColorPickerContribution.js +44 -0
- package/dist/workers/hoverColorPickerParticipant.js +151 -0
- package/dist/workers/hoverContribution.js +56 -0
- package/dist/workers/hoverCopyButton.js +54 -0
- package/dist/workers/hoverDelegate2.js +39 -0
- package/dist/workers/hoverDelegateFactory.js +34 -0
- package/dist/workers/hoverOperation.js +168 -0
- package/dist/workers/hoverParticipant.js +161 -0
- package/dist/workers/hoverService.js +542 -0
- package/dist/workers/hoverTypes.js +64 -0
- package/dist/workers/hoverUtils.js +18 -0
- package/dist/workers/hoverWidget.js +93 -0
- package/dist/workers/html.contribution.js +9 -0
- package/dist/workers/html.js +374 -0
- package/dist/workers/htmlContent.js +164 -0
- package/dist/workers/htmlMode.js +213 -0
- package/dist/workers/htmlWorker.js +126 -0
- package/dist/workers/iPadShowKeyboard.js +74 -0
- package/dist/workers/iconLabel.js +291 -0
- package/dist/workers/iconLabels.js +33 -0
- package/dist/workers/iconRegistry.js +183 -0
- package/dist/workers/iconsStyleSheet.js +75 -0
- package/dist/workers/idGenerator.js +16 -0
- package/dist/workers/iframe.js +87 -0
- package/dist/workers/ime.js +33 -0
- package/dist/workers/inPlaceReplace.js +151 -0
- package/dist/workers/inPlaceReplaceCommand.js +27 -0
- package/dist/workers/indentGuides.js +254 -0
- package/dist/workers/indentRangeProvider.js +166 -0
- package/dist/workers/indentRules.js +63 -0
- package/dist/workers/indentUtils.js +33 -0
- package/dist/workers/indentation.js +100 -0
- package/dist/workers/indentationGuesser.js +178 -0
- package/dist/workers/indentationLineProcessor.js +193 -0
- package/dist/workers/index.js +21 -0
- package/dist/workers/indexTreeModel.js +538 -0
- package/dist/workers/ini.contribution.js +9 -0
- package/dist/workers/ini.js +70 -0
- package/dist/workers/initialize.js +11 -0
- package/dist/workers/inlayHints.js +147 -0
- package/dist/workers/inlayHintsContribution.js +11 -0
- package/dist/workers/inlayHintsController.js +686 -0
- package/dist/workers/inlayHintsHover.js +162 -0
- package/dist/workers/inlayHintsLocations.js +96 -0
- package/dist/workers/inlineCompletionContextKeys.js +23 -0
- package/dist/workers/inlineCompletions.contribution.js +31 -0
- package/dist/workers/inlineCompletionsAccessibleView.js +4 -0
- package/dist/workers/inlineCompletionsController.js +427 -0
- package/dist/workers/inlineCompletionsHintsWidget.js +356 -0
- package/dist/workers/inlineCompletionsModel.js +1048 -0
- package/dist/workers/inlineCompletionsService.js +170 -0
- package/dist/workers/inlineCompletionsSource.js +548 -0
- package/dist/workers/inlineCompletionsView.js +86 -0
- package/dist/workers/inlineDecorations.js +26 -0
- package/dist/workers/inlineDiffDeletedCodeMargin.js +138 -0
- package/dist/workers/inlineEdit.js +17 -0
- package/dist/workers/inlineEditWithChanges.js +30 -0
- package/dist/workers/inlineEditsCollapsedView.js +132 -0
- package/dist/workers/inlineEditsCustomView.js +256 -0
- package/dist/workers/inlineEditsDeletionView.js +178 -0
- package/dist/workers/inlineEditsInsertionView.js +267 -0
- package/dist/workers/inlineEditsLineReplacementView.js +329 -0
- package/dist/workers/inlineEditsModel.js +59 -0
- package/dist/workers/inlineEditsNewUsers.js +174 -0
- package/dist/workers/inlineEditsSideBySideView.js +517 -0
- package/dist/workers/inlineEditsView.js +561 -0
- package/dist/workers/inlineEditsViewInterface.js +21 -0
- package/dist/workers/inlineEditsViewProducer.js +119 -0
- package/dist/workers/inlineEditsWordReplacementView.js +211 -0
- package/dist/workers/inlineProgress.js +139 -0
- package/dist/workers/inlineSuggestionItem.js +497 -0
- package/dist/workers/inplaceReplaceSupport.js +87 -0
- package/dist/workers/inputBox.js +510 -0
- package/dist/workers/inputColors.js +66 -0
- package/dist/workers/inputMode.js +22 -0
- package/dist/workers/insertFinalNewLine.js +32 -0
- package/dist/workers/insertFinalNewLineCommand.js +39 -0
- package/dist/workers/inspectTokens.js +240 -0
- package/dist/workers/instantiation.js +44 -0
- package/dist/workers/instantiationService.js +403 -0
- package/dist/workers/intervalTree.js +1002 -0
- package/dist/workers/iterator.js +186 -0
- package/dist/workers/java.contribution.js +9 -0
- package/dist/workers/java.js +231 -0
- package/dist/workers/javascript.contribution.js +11 -0
- package/dist/workers/javascript.js +70 -0
- package/dist/workers/jsonContributionRegistry.js +42 -0
- package/dist/workers/jsonMode.js +224 -0
- package/dist/workers/jsonWorker.js +187 -0
- package/dist/workers/julia.contribution.js +8 -0
- package/dist/workers/julia.js +510 -0
- package/dist/workers/keyCodes.js +351 -0
- package/dist/workers/keybinding.js +9 -0
- package/dist/workers/keybindingCancellation.js +81 -0
- package/dist/workers/keybindingLabel.js +122 -0
- package/dist/workers/keybindingLabels.js +139 -0
- package/dist/workers/keybindingResolver.js +304 -0
- package/dist/workers/keybindings.js +104 -0
- package/dist/workers/keybindingsRegistry.js +111 -0
- package/dist/workers/keyboardEvent.js +125 -0
- package/dist/workers/korean.js +321 -0
- package/dist/workers/kotlin.contribution.js +9 -0
- package/dist/workers/kotlin.js +251 -0
- package/dist/workers/label.js +5 -0
- package/dist/workers/labels.js +15 -0
- package/dist/workers/language.js +9 -0
- package/dist/workers/languageBracketsConfiguration.js +133 -0
- package/dist/workers/languageConfiguration.js +138 -0
- package/dist/workers/languageConfigurationRegistry.js +361 -0
- package/dist/workers/languageFeatureDebounce.js +137 -0
- package/dist/workers/languageFeatureRegistry.js +180 -0
- package/dist/workers/languageFeatures.js +9 -0
- package/dist/workers/languageFeaturesService.js +47 -0
- package/dist/workers/languageSelector.js +112 -0
- package/dist/workers/languageService.js +92 -0
- package/dist/workers/languages.js +522 -0
- package/dist/workers/languagesAssociations.js +193 -0
- package/dist/workers/languagesRegistry.js +237 -0
- package/dist/workers/layoutService.js +9 -0
- package/dist/workers/lazy.js +49 -0
- package/dist/workers/lazyObservableValue.js +125 -0
- package/dist/workers/legacyLinesDiffComputer.js +468 -0
- package/dist/workers/length.js +129 -0
- package/dist/workers/less.contribution.js +9 -0
- package/dist/workers/less.js +160 -0
- package/dist/workers/lexon.contribution.js +8 -0
- package/dist/workers/lexon.js +156 -0
- package/dist/workers/lib.index.js +103 -0
- package/dist/workers/lib.js +1107 -0
- package/dist/workers/lifecycle.js +311 -0
- package/dist/workers/lightBulbWidget.js +427 -0
- package/dist/workers/lineCommentCommand.js +328 -0
- package/dist/workers/lineDecorations.js +208 -0
- package/dist/workers/lineEdit.js +75 -0
- package/dist/workers/lineHeights.js +370 -0
- package/dist/workers/lineNumbers.js +184 -0
- package/dist/workers/linePart.js +25 -0
- package/dist/workers/lineRange.js +312 -0
- package/dist/workers/lineSelection.js +36 -0
- package/dist/workers/lineSequence.js +36 -0
- package/dist/workers/lineTokens.js +405 -0
- package/dist/workers/linesDecorations.js +104 -0
- package/dist/workers/linesDiffComputer.js +29 -0
- package/dist/workers/linesDiffComputers.js +13 -0
- package/dist/workers/linesLayout.js +765 -0
- package/dist/workers/linesOperations.js +1187 -0
- package/dist/workers/linesSliceCharSequence.js +205 -0
- package/dist/workers/link.js +95 -0
- package/dist/workers/linkComputer.js +269 -0
- package/dist/workers/linkedEditing.js +381 -0
- package/dist/workers/linkedList.js +126 -0
- package/dist/workers/linkedText.js +48 -0
- package/dist/workers/links.js +376 -0
- package/dist/workers/liquid.contribution.js +9 -0
- package/dist/workers/liquid.js +306 -0
- package/dist/workers/list.js +11 -0
- package/dist/workers/listColors.js +51 -0
- package/dist/workers/listPaging.js +128 -0
- package/dist/workers/listService.js +1025 -0
- package/dist/workers/listView.js +1173 -0
- package/dist/workers/listWidget.js +1535 -0
- package/dist/workers/log.js +271 -0
- package/dist/workers/logService.js +40 -0
- package/dist/workers/logging.js +86 -0
- package/dist/workers/longLinesHelper.js +23 -0
- package/dist/workers/lspLanguageFeatures.js +716 -0
- package/dist/workers/lua.contribution.js +8 -0
- package/dist/workers/lua.js +161 -0
- package/dist/workers/m3.contribution.js +8 -0
- package/dist/workers/m3.js +209 -0
- package/dist/workers/map.js +670 -0
- package/dist/workers/margin.js +71 -0
- package/dist/workers/marginDecorations.js +84 -0
- package/dist/workers/markdown.contribution.js +8 -0
- package/dist/workers/markdown.js +228 -0
- package/dist/workers/markdownHoverParticipant.js +419 -0
- package/dist/workers/markdownRenderer.js +73 -0
- package/dist/workers/marked.js +2478 -0
- package/dist/workers/markerDecorations.js +9 -0
- package/dist/workers/markerDecorationsService.js +248 -0
- package/dist/workers/markerHoverParticipant.js +270 -0
- package/dist/workers/markerNavigationService.js +223 -0
- package/dist/workers/markerService.js +330 -0
- package/dist/workers/markers.js +127 -0
- package/dist/workers/marshalling.js +62 -0
- package/dist/workers/mdx.contribution.js +8 -0
- package/dist/workers/mdx.js +230 -0
- package/dist/workers/menu.js +1147 -0
- package/dist/workers/menuColors.js +19 -0
- package/dist/workers/menuEntryActionViewItem.js +519 -0
- package/dist/workers/menuService.js +436 -0
- package/dist/workers/messageController.js +186 -0
- package/dist/workers/middleScroll.contribution.js +8 -0
- package/dist/workers/middleScrollController.js +128 -0
- package/dist/workers/migrateOptions.js +220 -0
- package/dist/workers/mime.js +11 -0
- package/dist/workers/minimap.js +1662 -0
- package/dist/workers/minimapCharRenderer.js +90 -0
- package/dist/workers/minimapCharRendererFactory.js +136 -0
- package/dist/workers/minimapCharSheet.js +25 -0
- package/dist/workers/minimapColors.js +23 -0
- package/dist/workers/minimapPreBaked.js +52 -0
- package/dist/workers/minimapTokensColorTracker.js +58 -0
- package/dist/workers/mips.contribution.js +9 -0
- package/dist/workers/mips.js +197 -0
- package/dist/workers/mirrorTextModel.js +117 -0
- package/dist/workers/miscColors.js +32 -0
- package/dist/workers/model.js +9 -0
- package/dist/workers/modelLineProjection.js +350 -0
- package/dist/workers/modelLineProjectionData.js +297 -0
- package/dist/workers/modelService.js +413 -0
- package/dist/workers/modesRegistry.js +75 -0
- package/dist/workers/monaco.contribution.js +302 -0
- package/dist/workers/monarchCommon.js +147 -0
- package/dist/workers/monarchCompile.js +546 -0
- package/dist/workers/monarchLexer.js +764 -0
- package/dist/workers/monospaceLineBreaksComputer.js +473 -0
- package/dist/workers/mouseCursor.js +9 -0
- package/dist/workers/mouseEvent.js +153 -0
- package/dist/workers/mouseHandler.js +539 -0
- package/dist/workers/mouseTarget.js +978 -0
- package/dist/workers/moveCaretCommand.js +49 -0
- package/dist/workers/moveLinesCommand.js +394 -0
- package/dist/workers/movedBlocksLinesFeature.js +277 -0
- package/dist/workers/msdax.contribution.js +8 -0
- package/dist/workers/msdax.js +374 -0
- package/dist/workers/multiDiffEditorWidget.js +43 -0
- package/dist/workers/multiDiffEditorWidgetImpl.js +427 -0
- package/dist/workers/multicursor.js +1004 -0
- package/dist/workers/myersDiffAlgorithm.js +159 -0
- package/dist/workers/mysql.contribution.js +8 -0
- package/dist/workers/mysql.js +877 -0
- package/dist/workers/nativeEditContext.js +518 -0
- package/dist/workers/nativeEditContextRegistry.js +23 -0
- package/dist/workers/nativeEditContextUtils.js +85 -0
- package/dist/workers/navigator.js +36 -0
- package/dist/workers/network.js +267 -0
- package/dist/workers/nls.js +76 -0
- package/dist/workers/nls.messages.js +18 -0
- package/dist/workers/nodeReader.js +127 -0
- package/dist/workers/normalization.js +41 -0
- package/dist/workers/notification.js +9 -0
- package/dist/workers/nullTokenize.js +29 -0
- package/dist/workers/numbers.js +45 -0
- package/dist/workers/objectCollectionBuffer.js +102 -0
- package/dist/workers/objectPool.js +47 -0
- package/dist/workers/objectTree.js +204 -0
- package/dist/workers/objectTreeModel.js +220 -0
- package/dist/workers/objective-c.contribution.js +8 -0
- package/dist/workers/objective-c.js +182 -0
- package/dist/workers/objects.js +152 -0
- package/dist/workers/observableCodeEditor.js +373 -0
- package/dist/workers/observableFromEvent.js +123 -0
- package/dist/workers/observableSignal.js +47 -0
- package/dist/workers/observableSignalFromEvent.js +41 -0
- package/dist/workers/observableValue.js +105 -0
- package/dist/workers/observableValueOpts.js +20 -0
- package/dist/workers/offsetRange.js +225 -0
- package/dist/workers/onEnter.js +109 -0
- package/dist/workers/oneCursor.js +117 -0
- package/dist/workers/opener.js +43 -0
- package/dist/workers/openerService.js +222 -0
- package/dist/workers/originalEditorInlineDiffView.js +215 -0
- package/dist/workers/outlineModel.js +265 -0
- package/dist/workers/overlayWidgets.js +181 -0
- package/dist/workers/overviewRuler.js +134 -0
- package/dist/workers/overviewRulerFeature.js +168 -0
- package/dist/workers/overviewZoneManager.js +176 -0
- package/dist/workers/parameterHints.js +126 -0
- package/dist/workers/parameterHintsModel.js +258 -0
- package/dist/workers/parameterHintsWidget.js +318 -0
- package/dist/workers/parser.js +121 -0
- package/dist/workers/pascal.contribution.js +9 -0
- package/dist/workers/pascal.js +250 -0
- package/dist/workers/pascaligo.contribution.js +8 -0
- package/dist/workers/pascaligo.js +163 -0
- package/dist/workers/path.js +1451 -0
- package/dist/workers/peekView.js +246 -0
- package/dist/workers/performance.js +222 -0
- package/dist/workers/perl.contribution.js +8 -0
- package/dist/workers/perl.js +625 -0
- package/dist/workers/pgsql.contribution.js +8 -0
- package/dist/workers/pgsql.js +850 -0
- package/dist/workers/php.contribution.js +9 -0
- package/dist/workers/php.js +499 -0
- package/dist/workers/pickerQuickAccess.js +271 -0
- package/dist/workers/pieceTreeBase.js +1473 -0
- package/dist/workers/pieceTreeTextBuffer.js +461 -0
- package/dist/workers/pieceTreeTextBufferBuilder.js +140 -0
- package/dist/workers/pixelRatio.js +88 -0
- package/dist/workers/pla.contribution.js +7 -0
- package/dist/workers/pla.js +136 -0
- package/dist/workers/placeholderText.contribution.js +14 -0
- package/dist/workers/placeholderTextContribution.js +77 -0
- package/dist/workers/platform.js +32 -0
- package/dist/workers/platformObservableUtils.js +31 -0
- package/dist/workers/point.js +50 -0
- package/dist/workers/pointerHandler.js +132 -0
- package/dist/workers/position.js +142 -0
- package/dist/workers/positionToOffset.js +17 -0
- package/dist/workers/positionToOffsetImpl.js +98 -0
- package/dist/workers/postEditWidget.js +220 -0
- package/dist/workers/postiats.contribution.js +8 -0
- package/dist/workers/postiats.js +906 -0
- package/dist/workers/powerquery.contribution.js +8 -0
- package/dist/workers/powerquery.js +889 -0
- package/dist/workers/powershell.contribution.js +8 -0
- package/dist/workers/powershell.js +238 -0
- package/dist/workers/prefixSumComputer.js +226 -0
- package/dist/workers/process.js +61 -0
- package/dist/workers/product.js +70 -0
- package/dist/workers/productService.js +9 -0
- package/dist/workers/progress.js +16 -0
- package/dist/workers/progressbar.js +105 -0
- package/dist/workers/promise.js +56 -0
- package/dist/workers/protobuf.contribution.js +8 -0
- package/dist/workers/protobuf.js +419 -0
- package/dist/workers/provideInlineCompletions.js +372 -0
- package/dist/workers/provideSignatureHelp.js +59 -0
- package/dist/workers/pug.contribution.js +8 -0
- package/dist/workers/pug.js +401 -0
- package/dist/workers/python.contribution.js +9 -0
- package/dist/workers/python.js +366 -0
- package/dist/workers/qsharp.contribution.js +8 -0
- package/dist/workers/qsharp.js +300 -0
- package/dist/workers/quickAccess.js +56 -0
- package/dist/workers/quickInput.js +108 -0
- package/dist/workers/quickInputActions.js +189 -0
- package/dist/workers/quickInputBox.js +104 -0
- package/dist/workers/quickInputController.js +901 -0
- package/dist/workers/quickInputDelegate.js +19 -0
- package/dist/workers/quickInputList.js +1391 -0
- package/dist/workers/quickInputService.js +197 -0
- package/dist/workers/quickInputTree.js +37 -0
- package/dist/workers/quickInputTreeAccessibilityProvider.js +39 -0
- package/dist/workers/quickInputTreeController.js +181 -0
- package/dist/workers/quickInputTreeFilter.js +42 -0
- package/dist/workers/quickInputTreeRenderer.js +141 -0
- package/dist/workers/quickInputTreeSorter.js +48 -0
- package/dist/workers/quickInputUtils.js +89 -0
- package/dist/workers/quickpickColors.js +21 -0
- package/dist/workers/r.contribution.js +8 -0
- package/dist/workers/r.js +242 -0
- package/dist/workers/range.js +421 -0
- package/dist/workers/rangeMap.js +161 -0
- package/dist/workers/rangeMapping.js +229 -0
- package/dist/workers/rangeSingleLine.js +17 -0
- package/dist/workers/rangeUtil.js +117 -0
- package/dist/workers/razor.contribution.js +9 -0
- package/dist/workers/razor.js +616 -0
- package/dist/workers/rbTreeBase.js +362 -0
- package/dist/workers/rect.js +163 -0
- package/dist/workers/rectangleRenderer.js +214 -0
- package/dist/workers/rectangleRenderer.wgsl.js +68 -0
- package/dist/workers/redis.contribution.js +8 -0
- package/dist/workers/redis.js +301 -0
- package/dist/workers/redshift.contribution.js +8 -0
- package/dist/workers/redshift.js +808 -0
- package/dist/workers/reducer.js +46 -0
- package/dist/workers/referencesController.js +382 -0
- package/dist/workers/referencesModel.js +241 -0
- package/dist/workers/referencesTree.js +200 -0
- package/dist/workers/referencesWidget.js +525 -0
- package/dist/workers/registrations.contribution.js +82 -0
- package/dist/workers/rename.js +458 -0
- package/dist/workers/renameWidget.js +741 -0
- package/dist/workers/renderLines.js +185 -0
- package/dist/workers/renderingContext.js +118 -0
- package/dist/workers/replaceAllCommand.js +54 -0
- package/dist/workers/replaceCommand.js +158 -0
- package/dist/workers/replaceInput.js +176 -0
- package/dist/workers/replacePattern.js +289 -0
- package/dist/workers/replaceWidgetHistory.js +85 -0
- package/dist/workers/resizable.js +150 -0
- package/dist/workers/resizableContentWidget.js +92 -0
- package/dist/workers/resolvedKeybindingItem.js +35 -0
- package/dist/workers/resolverService.js +5 -0
- package/dist/workers/resources.js +231 -0
- package/dist/workers/restructuredtext.contribution.js +8 -0
- package/dist/workers/restructuredtext.js +173 -0
- package/dist/workers/revertButtonsFeature.js +149 -0
- package/dist/workers/rgba.js +35 -0
- package/dist/workers/richEditBrackets.js +356 -0
- package/dist/workers/rowCache.js +110 -0
- package/dist/workers/rpc.js +57 -0
- package/dist/workers/ruby.contribution.js +9 -0
- package/dist/workers/ruby.js +510 -0
- package/dist/workers/rulers.js +82 -0
- package/dist/workers/rulersGpu.js +66 -0
- package/dist/workers/runOnChange.js +61 -0
- package/dist/workers/rust.contribution.js +8 -0
- package/dist/workers/rust.js +342 -0
- package/dist/workers/sash.js +451 -0
- package/dist/workers/sb.contribution.js +8 -0
- package/dist/workers/sb.js +114 -0
- package/dist/workers/scala.contribution.js +9 -0
- package/dist/workers/scala.js +369 -0
- package/dist/workers/scanner.js +287 -0
- package/dist/workers/scheme.contribution.js +8 -0
- package/dist/workers/scheme.js +107 -0
- package/dist/workers/screenReaderContentRich.js +337 -0
- package/dist/workers/screenReaderContentSimple.js +194 -0
- package/dist/workers/screenReaderSupport.js +175 -0
- package/dist/workers/screenReaderUtils.js +111 -0
- package/dist/workers/scrollDecoration.js +70 -0
- package/dist/workers/scrollable.js +323 -0
- package/dist/workers/scrollableElement.js +603 -0
- package/dist/workers/scrollbarArrow.js +78 -0
- package/dist/workers/scrollbarState.js +163 -0
- package/dist/workers/scrollbarVisibilityController.js +93 -0
- package/dist/workers/scss.contribution.js +9 -0
- package/dist/workers/scss.js +259 -0
- package/dist/workers/search.js +52 -0
- package/dist/workers/searchColors.js +13 -0
- package/dist/workers/sectionHeaders.js +179 -0
- package/dist/workers/selectBox.js +47 -0
- package/dist/workers/selectBoxCustom.js +858 -0
- package/dist/workers/selectBoxNative.js +142 -0
- package/dist/workers/selection.js +145 -0
- package/dist/workers/selections.js +338 -0
- package/dist/workers/semanticTokensConfig.js +14 -0
- package/dist/workers/semanticTokensDto.js +82 -0
- package/dist/workers/semanticTokensProviderStyling.js +263 -0
- package/dist/workers/semanticTokensStyling.js +9 -0
- package/dist/workers/semanticTokensStylingService.js +47 -0
- package/dist/workers/serviceCollection.js +22 -0
- package/dist/workers/severity.js +52 -0
- package/dist/workers/severityIcon.js +29 -0
- package/dist/workers/shell.contribution.js +8 -0
- package/dist/workers/shell.js +220 -0
- package/dist/workers/shiftCommand.js +241 -0
- package/dist/workers/singleTextEditHelpers.js +32 -0
- package/dist/workers/smallImmutableSet.js +108 -0
- package/dist/workers/smartSelect.js +281 -0
- package/dist/workers/snippetController2.js +297 -0
- package/dist/workers/snippetParser.js +890 -0
- package/dist/workers/snippetSession.js +650 -0
- package/dist/workers/snippetVariables.js +323 -0
- package/dist/workers/solidity.contribution.js +8 -0
- package/dist/workers/solidity.js +1366 -0
- package/dist/workers/sophia.contribution.js +8 -0
- package/dist/workers/sophia.js +198 -0
- package/dist/workers/sortLinesCommand.js +81 -0
- package/dist/workers/sparql.contribution.js +8 -0
- package/dist/workers/sparql.js +200 -0
- package/dist/workers/sparseMultilineTokens.js +548 -0
- package/dist/workers/sparseTokensStore.js +210 -0
- package/dist/workers/splice.js +14 -0
- package/dist/workers/splitview.js +829 -0
- package/dist/workers/sql.contribution.js +8 -0
- package/dist/workers/sql.js +852 -0
- package/dist/workers/st.contribution.js +8 -0
- package/dist/workers/st.js +415 -0
- package/dist/workers/stableEditorScroll.js +52 -0
- package/dist/workers/standaloneCodeEditor.js +335 -0
- package/dist/workers/standaloneCodeEditorService.js +96 -0
- package/dist/workers/standaloneColorPickerActions.js +81 -0
- package/dist/workers/standaloneColorPickerController.js +62 -0
- package/dist/workers/standaloneColorPickerParticipant.js +117 -0
- package/dist/workers/standaloneColorPickerWidget.js +215 -0
- package/dist/workers/standaloneCommandsQuickAccess.js +82 -0
- package/dist/workers/standaloneEditor.js +519 -0
- package/dist/workers/standaloneEnums.js +1017 -0
- package/dist/workers/standaloneGotoLineQuickAccess.js +67 -0
- package/dist/workers/standaloneGotoSymbolQuickAccess.js +77 -0
- package/dist/workers/standaloneHelpQuickAccess.js +14 -0
- package/dist/workers/standaloneLanguages.js +621 -0
- package/dist/workers/standaloneLayoutService.js +74 -0
- package/dist/workers/standaloneQuickInputService.js +150 -0
- package/dist/workers/standaloneReferenceSearch.js +38 -0
- package/dist/workers/standaloneServices.js +787 -0
- package/dist/workers/standaloneStrings.js +42 -0
- package/dist/workers/standaloneTheme.js +9 -0
- package/dist/workers/standaloneThemeService.js +367 -0
- package/dist/workers/standaloneTreeSitterLibraryService.js +23 -0
- package/dist/workers/standaloneWebWorker.js +55 -0
- package/dist/workers/stickyScrollActions.js +132 -0
- package/dist/workers/stickyScrollContribution.js +16 -0
- package/dist/workers/stickyScrollController.js +566 -0
- package/dist/workers/stickyScrollElement.js +39 -0
- package/dist/workers/stickyScrollModelProvider.js +338 -0
- package/dist/workers/stickyScrollProvider.js +197 -0
- package/dist/workers/stickyScrollWidget.js +474 -0
- package/dist/workers/stopwatch.js +30 -0
- package/dist/workers/storage.js +200 -0
- package/dist/workers/stringBuilder.js +122 -0
- package/dist/workers/stringEdit.js +165 -0
- package/dist/workers/strings.js +834 -0
- package/dist/workers/structuredLogger.js +56 -0
- package/dist/workers/suggest.js +322 -0
- package/dist/workers/suggestAlternatives.js +95 -0
- package/dist/workers/suggestCommitCharacters.js +59 -0
- package/dist/workers/suggestController.js +941 -0
- package/dist/workers/suggestInlineCompletions.js +193 -0
- package/dist/workers/suggestMemory.js +254 -0
- package/dist/workers/suggestModel.js +667 -0
- package/dist/workers/suggestOvertypingCapturer.js +62 -0
- package/dist/workers/suggestWidget.js +890 -0
- package/dist/workers/suggestWidgetAdapter.js +210 -0
- package/dist/workers/suggestWidgetDetails.js +393 -0
- package/dist/workers/suggestWidgetRenderer.js +208 -0
- package/dist/workers/suggestWidgetStatus.js +74 -0
- package/dist/workers/supports.js +58 -0
- package/dist/workers/surroundSelectionCommand.js +44 -0
- package/dist/workers/swift.contribution.js +9 -0
- package/dist/workers/swift.js +311 -0
- package/dist/workers/symbolIcons.js +101 -0
- package/dist/workers/symbolNavigation.js +178 -0
- package/dist/workers/symbols.js +10 -0
- package/dist/workers/syntaxRangeProvider.js +177 -0
- package/dist/workers/systemverilog.contribution.js +14 -0
- package/dist/workers/systemverilog.js +575 -0
- package/dist/workers/tabFocus.js +29 -0
- package/dist/workers/tableWidget.js +181 -0
- package/dist/workers/taskQueue.js +116 -0
- package/dist/workers/tcl.contribution.js +8 -0
- package/dist/workers/tcl.js +231 -0
- package/dist/workers/telemetry.js +9 -0
- package/dist/workers/ternarySearchTree.js +674 -0
- package/dist/workers/textAreaEditContext.js +720 -0
- package/dist/workers/textAreaEditContextInput.js +588 -0
- package/dist/workers/textAreaEditContextState.js +160 -0
- package/dist/workers/textChange.js +248 -0
- package/dist/workers/textEdit.js +269 -0
- package/dist/workers/textLength.js +87 -0
- package/dist/workers/textModel.js +2031 -0
- package/dist/workers/textModelBracketPairs.js +45 -0
- package/dist/workers/textModelDefaults.js +18 -0
- package/dist/workers/textModelEditSource.js +166 -0
- package/dist/workers/textModelEvents.js +216 -0
- package/dist/workers/textModelGuides.js +40 -0
- package/dist/workers/textModelPart.js +23 -0
- package/dist/workers/textModelSearch.js +455 -0
- package/dist/workers/textModelStringEdit.js +11 -0
- package/dist/workers/textModelSync.impl.js +307 -0
- package/dist/workers/textModelText.js +26 -0
- package/dist/workers/textModelTokens.js +436 -0
- package/dist/workers/textResourceConfiguration.js +6 -0
- package/dist/workers/textToHtmlTokenizer.js +139 -0
- package/dist/workers/textualHighlightProvider.js +78 -0
- package/dist/workers/textureAtlas.js +179 -0
- package/dist/workers/textureAtlasPage.js +110 -0
- package/dist/workers/textureAtlasShelfAllocator.js +129 -0
- package/dist/workers/textureAtlasSlabAllocator.js +346 -0
- package/dist/workers/tfIdf.js +179 -0
- package/dist/workers/themables.js +100 -0
- package/dist/workers/theme.js +110 -0
- package/dist/workers/themeService.js +67 -0
- package/dist/workers/themes.js +242 -0
- package/dist/workers/toggle.js +242 -0
- package/dist/workers/toggleHighContrast.js +35 -0
- package/dist/workers/toggleTabFocusMode.js +42 -0
- package/dist/workers/tokenStore.js +407 -0
- package/dist/workers/tokenWithTextArray.js +73 -0
- package/dist/workers/tokenization.js +29 -0
- package/dist/workers/tokenizationRegistry.js +123 -0
- package/dist/workers/tokenizationTextModelPart.js +275 -0
- package/dist/workers/tokenizer.js +301 -0
- package/dist/workers/tokenizerSyntaxTokenBackend.js +261 -0
- package/dist/workers/toolbar.js +244 -0
- package/dist/workers/touch.js +270 -0
- package/dist/workers/transaction.js +109 -0
- package/dist/workers/transpose.js +65 -0
- package/dist/workers/tree.js +45 -0
- package/dist/workers/treeSitterLibraryService.js +9 -0
- package/dist/workers/treeSitterSyntaxTokenBackend.js +167 -0
- package/dist/workers/treeSitterThemeService.js +9 -0
- package/dist/workers/treeSitterTokenizationImpl.js +713 -0
- package/dist/workers/treeSitterTree.js +395 -0
- package/dist/workers/treeViewsDnd.js +24 -0
- package/dist/workers/treeViewsDndService.js +12 -0
- package/dist/workers/triggerInlineEditCommandsRegistry.js +18 -0
- package/dist/workers/trimTrailingWhitespaceCommand.js +98 -0
- package/dist/workers/trustedTypes.js +29 -0
- package/dist/workers/tsMode.js +212 -0
- package/dist/workers/tsWorker.js +352 -0
- package/dist/workers/twig.contribution.js +9 -0
- package/dist/workers/twig.js +391 -0
- package/dist/workers/types.js +144 -0
- package/dist/workers/typescript.contribution.js +11 -0
- package/dist/workers/typescript.js +408 -0
- package/dist/workers/typescriptServices.js +210154 -0
- package/dist/workers/typescriptServicesMetadata.js +3 -0
- package/dist/workers/typespec.contribution.js +8 -0
- package/dist/workers/typespec.js +126 -0
- package/dist/workers/typingSpeed.js +165 -0
- package/dist/workers/uint.js +24 -0
- package/dist/workers/undoRedo.js +43 -0
- package/dist/workers/undoRedoService.js +1076 -0
- package/dist/workers/unicodeHighlighter.js +673 -0
- package/dist/workers/unicodeTextModelHighlighter.js +188 -0
- package/dist/workers/unusualLineTerminators.js +113 -0
- package/dist/workers/updatableHoverWidget.js +107 -0
- package/dist/workers/uri.js +606 -0
- package/dist/workers/usLayoutResolvedKeybinding.js +175 -0
- package/dist/workers/utils.js +209 -0
- package/dist/workers/utilsCancellation.js +63 -0
- package/dist/workers/uuid.js +53 -0
- package/dist/workers/validation.js +159 -0
- package/dist/workers/vb.contribution.js +8 -0
- package/dist/workers/vb.js +371 -0
- package/dist/workers/verticalScrollbar.js +94 -0
- package/dist/workers/view.js +720 -0
- package/dist/workers/viewContext.js +22 -0
- package/dist/workers/viewController.js +274 -0
- package/dist/workers/viewCursor.js +218 -0
- package/dist/workers/viewCursors.js +339 -0
- package/dist/workers/viewEventHandler.js +186 -0
- package/dist/workers/viewEvents.js +180 -0
- package/dist/workers/viewGpuContext.js +241 -0
- package/dist/workers/viewLayer.js +478 -0
- package/dist/workers/viewLayout.js +368 -0
- package/dist/workers/viewLine.js +544 -0
- package/dist/workers/viewLineOptions.js +43 -0
- package/dist/workers/viewLineRenderer.js +948 -0
- package/dist/workers/viewLines.js +721 -0
- package/dist/workers/viewLinesGpu.js +571 -0
- package/dist/workers/viewLinesViewportData.js +30 -0
- package/dist/workers/viewModel.js +98 -0
- package/dist/workers/viewModelDecoration.js +55 -0
- package/dist/workers/viewModelDecorations.js +132 -0
- package/dist/workers/viewModelEventDispatcher.js +398 -0
- package/dist/workers/viewModelImpl.js +1163 -0
- package/dist/workers/viewModelLines.js +938 -0
- package/dist/workers/viewOverlays.js +204 -0
- package/dist/workers/viewPart.js +49 -0
- package/dist/workers/viewUserInputEvents.js +91 -0
- package/dist/workers/viewZones.js +335 -0
- package/dist/workers/viewportRenderStrategy.js +316 -0
- package/dist/workers/viewportSemanticTokens.js +166 -0
- package/dist/workers/webWorker.js +396 -0
- package/dist/workers/webWorkerBootstrap.js +20 -0
- package/dist/workers/webWorkerFactory.js +171 -0
- package/dist/workers/wgsl.contribution.js +8 -0
- package/dist/workers/wgsl.js +452 -0
- package/dist/workers/whitespace.js +277 -0
- package/dist/workers/widget.js +44 -0
- package/dist/workers/window.js +60 -0
- package/dist/workers/wordCharacterClassifier.js +87 -0
- package/dist/workers/wordContextKey.js +69 -0
- package/dist/workers/wordDistance.js +64 -0
- package/dist/workers/wordHelper.js +127 -0
- package/dist/workers/wordHighlighter.js +796 -0
- package/dist/workers/wordOperations.js +442 -0
- package/dist/workers/wordPartOperations.js +145 -0
- package/dist/workers/wordSelections.js +82 -0
- package/dist/workers/workerManager.js +147 -0
- package/dist/workers/workers.js +141 -0
- package/dist/workers/workspace.js +84 -0
- package/dist/workers/workspaceTrust.js +9 -0
- package/dist/workers/wrapInHotClass.js +41 -0
- package/dist/workers/wrapInReloadableClass.js +35 -0
- package/dist/workers/xml.contribution.js +28 -0
- package/dist/workers/xml.js +160 -0
- package/dist/workers/yaml.contribution.js +9 -0
- package/dist/workers/yaml.js +271 -0
- package/dist/workers/zoneWidget.js +406 -0
- package/package.json +2 -2
- package/dist/assets/css.worker-C7FogG4G.js +0 -93
- package/dist/assets/editor.worker-iXcRX1Tq.js +0 -26
- package/dist/assets/html.worker-C8VxctEJ.js +0 -470
- package/dist/assets/json.worker-CMC9kgPL.js +0 -58
- package/dist/assets/ts.worker-CtTJ3hNN.js +0 -67731
|
@@ -0,0 +1,978 @@
|
|
|
1
|
+
import { PageCoordinates } from '../editorDom.js';
|
|
2
|
+
import { PartFingerprints } from '../view/viewPart.js';
|
|
3
|
+
import { ViewLine } from '../viewParts/viewLines/viewLine.js';
|
|
4
|
+
import { Position } from '../../common/core/position.js';
|
|
5
|
+
import { Range } from '../../common/core/range.js';
|
|
6
|
+
import { CursorColumns } from '../../common/core/cursorColumns.js';
|
|
7
|
+
import { getWindow, getShadowRoot } from '../../../base/browser/dom.js';
|
|
8
|
+
import { AtomicTabMoveOperations } from '../../common/cursor/cursorAtomicMoveOperations.js';
|
|
9
|
+
import { TextDirection } from '../../common/model.js';
|
|
10
|
+
import { Lazy } from '../../../base/common/lazy.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
|
+
class UnknownHitTestResult {
|
|
17
|
+
constructor(hitTarget = null) {
|
|
18
|
+
this.hitTarget = hitTarget;
|
|
19
|
+
this.type = 0 /* HitTestResultType.Unknown */;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class ContentHitTestResult {
|
|
23
|
+
get hitTarget() { return this.spanNode; }
|
|
24
|
+
constructor(position, spanNode, injectedText) {
|
|
25
|
+
this.position = position;
|
|
26
|
+
this.spanNode = spanNode;
|
|
27
|
+
this.injectedText = injectedText;
|
|
28
|
+
this.type = 1 /* HitTestResultType.Content */;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var HitTestResult;
|
|
32
|
+
(function (HitTestResult) {
|
|
33
|
+
function createFromDOMInfo(ctx, spanNode, offset) {
|
|
34
|
+
const position = ctx.getPositionFromDOMInfo(spanNode, offset);
|
|
35
|
+
if (position) {
|
|
36
|
+
return new ContentHitTestResult(position, spanNode, null);
|
|
37
|
+
}
|
|
38
|
+
return new UnknownHitTestResult(spanNode);
|
|
39
|
+
}
|
|
40
|
+
HitTestResult.createFromDOMInfo = createFromDOMInfo;
|
|
41
|
+
})(HitTestResult || (HitTestResult = {}));
|
|
42
|
+
class PointerHandlerLastRenderData {
|
|
43
|
+
constructor(lastViewCursorsRenderData, lastTextareaPosition) {
|
|
44
|
+
this.lastViewCursorsRenderData = lastViewCursorsRenderData;
|
|
45
|
+
this.lastTextareaPosition = lastTextareaPosition;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
class MouseTarget {
|
|
49
|
+
static _deduceRage(position, range = null) {
|
|
50
|
+
if (!range && position) {
|
|
51
|
+
return new Range(position.lineNumber, position.column, position.lineNumber, position.column);
|
|
52
|
+
}
|
|
53
|
+
return range ?? null;
|
|
54
|
+
}
|
|
55
|
+
static createUnknown(element, mouseColumn, position) {
|
|
56
|
+
return { type: 0 /* MouseTargetType.UNKNOWN */, element, mouseColumn, position, range: this._deduceRage(position) };
|
|
57
|
+
}
|
|
58
|
+
static createTextarea(element, mouseColumn) {
|
|
59
|
+
return { type: 1 /* MouseTargetType.TEXTAREA */, element, mouseColumn, position: null, range: null };
|
|
60
|
+
}
|
|
61
|
+
static createMargin(type, element, mouseColumn, position, range, detail) {
|
|
62
|
+
return { type, element, mouseColumn, position, range, detail };
|
|
63
|
+
}
|
|
64
|
+
static createViewZone(type, element, mouseColumn, position, detail) {
|
|
65
|
+
return { type, element, mouseColumn, position, range: this._deduceRage(position), detail };
|
|
66
|
+
}
|
|
67
|
+
static createContentText(element, mouseColumn, position, range, detail) {
|
|
68
|
+
return { type: 6 /* MouseTargetType.CONTENT_TEXT */, element, mouseColumn, position, range: this._deduceRage(position, range), detail };
|
|
69
|
+
}
|
|
70
|
+
static createContentEmpty(element, mouseColumn, position, detail) {
|
|
71
|
+
return { type: 7 /* MouseTargetType.CONTENT_EMPTY */, element, mouseColumn, position, range: this._deduceRage(position), detail };
|
|
72
|
+
}
|
|
73
|
+
static createContentWidget(element, mouseColumn, detail) {
|
|
74
|
+
return { type: 9 /* MouseTargetType.CONTENT_WIDGET */, element, mouseColumn, position: null, range: null, detail };
|
|
75
|
+
}
|
|
76
|
+
static createScrollbar(element, mouseColumn, position) {
|
|
77
|
+
return { type: 11 /* MouseTargetType.SCROLLBAR */, element, mouseColumn, position, range: this._deduceRage(position) };
|
|
78
|
+
}
|
|
79
|
+
static createOverlayWidget(element, mouseColumn, detail) {
|
|
80
|
+
return { type: 12 /* MouseTargetType.OVERLAY_WIDGET */, element, mouseColumn, position: null, range: null, detail };
|
|
81
|
+
}
|
|
82
|
+
static createOutsideEditor(mouseColumn, position, outsidePosition, outsideDistance) {
|
|
83
|
+
return { type: 13 /* MouseTargetType.OUTSIDE_EDITOR */, element: null, mouseColumn, position, range: this._deduceRage(position), outsidePosition, outsideDistance };
|
|
84
|
+
}
|
|
85
|
+
static _typeToString(type) {
|
|
86
|
+
if (type === 1 /* MouseTargetType.TEXTAREA */) {
|
|
87
|
+
return 'TEXTAREA';
|
|
88
|
+
}
|
|
89
|
+
if (type === 2 /* MouseTargetType.GUTTER_GLYPH_MARGIN */) {
|
|
90
|
+
return 'GUTTER_GLYPH_MARGIN';
|
|
91
|
+
}
|
|
92
|
+
if (type === 3 /* MouseTargetType.GUTTER_LINE_NUMBERS */) {
|
|
93
|
+
return 'GUTTER_LINE_NUMBERS';
|
|
94
|
+
}
|
|
95
|
+
if (type === 4 /* MouseTargetType.GUTTER_LINE_DECORATIONS */) {
|
|
96
|
+
return 'GUTTER_LINE_DECORATIONS';
|
|
97
|
+
}
|
|
98
|
+
if (type === 5 /* MouseTargetType.GUTTER_VIEW_ZONE */) {
|
|
99
|
+
return 'GUTTER_VIEW_ZONE';
|
|
100
|
+
}
|
|
101
|
+
if (type === 6 /* MouseTargetType.CONTENT_TEXT */) {
|
|
102
|
+
return 'CONTENT_TEXT';
|
|
103
|
+
}
|
|
104
|
+
if (type === 7 /* MouseTargetType.CONTENT_EMPTY */) {
|
|
105
|
+
return 'CONTENT_EMPTY';
|
|
106
|
+
}
|
|
107
|
+
if (type === 8 /* MouseTargetType.CONTENT_VIEW_ZONE */) {
|
|
108
|
+
return 'CONTENT_VIEW_ZONE';
|
|
109
|
+
}
|
|
110
|
+
if (type === 9 /* MouseTargetType.CONTENT_WIDGET */) {
|
|
111
|
+
return 'CONTENT_WIDGET';
|
|
112
|
+
}
|
|
113
|
+
if (type === 10 /* MouseTargetType.OVERVIEW_RULER */) {
|
|
114
|
+
return 'OVERVIEW_RULER';
|
|
115
|
+
}
|
|
116
|
+
if (type === 11 /* MouseTargetType.SCROLLBAR */) {
|
|
117
|
+
return 'SCROLLBAR';
|
|
118
|
+
}
|
|
119
|
+
if (type === 12 /* MouseTargetType.OVERLAY_WIDGET */) {
|
|
120
|
+
return 'OVERLAY_WIDGET';
|
|
121
|
+
}
|
|
122
|
+
return 'UNKNOWN';
|
|
123
|
+
}
|
|
124
|
+
static toString(target) {
|
|
125
|
+
return this._typeToString(target.type) + ': ' + target.position + ' - ' + target.range + ' - ' + JSON.stringify(target.detail);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
class ElementPath {
|
|
129
|
+
static isTextArea(path) {
|
|
130
|
+
return (path.length === 2
|
|
131
|
+
&& path[0] === 3 /* PartFingerprint.OverflowGuard */
|
|
132
|
+
&& path[1] === 7 /* PartFingerprint.TextArea */);
|
|
133
|
+
}
|
|
134
|
+
static isChildOfViewLines(path) {
|
|
135
|
+
return (path.length >= 4
|
|
136
|
+
&& path[0] === 3 /* PartFingerprint.OverflowGuard */
|
|
137
|
+
&& path[3] === 8 /* PartFingerprint.ViewLines */);
|
|
138
|
+
}
|
|
139
|
+
static isStrictChildOfViewLines(path) {
|
|
140
|
+
return (path.length > 4
|
|
141
|
+
&& path[0] === 3 /* PartFingerprint.OverflowGuard */
|
|
142
|
+
&& path[3] === 8 /* PartFingerprint.ViewLines */);
|
|
143
|
+
}
|
|
144
|
+
static isChildOfScrollableElement(path) {
|
|
145
|
+
return (path.length >= 2
|
|
146
|
+
&& path[0] === 3 /* PartFingerprint.OverflowGuard */
|
|
147
|
+
&& path[1] === 6 /* PartFingerprint.ScrollableElement */);
|
|
148
|
+
}
|
|
149
|
+
static isChildOfMinimap(path) {
|
|
150
|
+
return (path.length >= 2
|
|
151
|
+
&& path[0] === 3 /* PartFingerprint.OverflowGuard */
|
|
152
|
+
&& path[1] === 9 /* PartFingerprint.Minimap */);
|
|
153
|
+
}
|
|
154
|
+
static isChildOfContentWidgets(path) {
|
|
155
|
+
return (path.length >= 4
|
|
156
|
+
&& path[0] === 3 /* PartFingerprint.OverflowGuard */
|
|
157
|
+
&& path[3] === 1 /* PartFingerprint.ContentWidgets */);
|
|
158
|
+
}
|
|
159
|
+
static isChildOfOverflowGuard(path) {
|
|
160
|
+
return (path.length >= 1
|
|
161
|
+
&& path[0] === 3 /* PartFingerprint.OverflowGuard */);
|
|
162
|
+
}
|
|
163
|
+
static isChildOfOverflowingContentWidgets(path) {
|
|
164
|
+
return (path.length >= 1
|
|
165
|
+
&& path[0] === 2 /* PartFingerprint.OverflowingContentWidgets */);
|
|
166
|
+
}
|
|
167
|
+
static isChildOfOverlayWidgets(path) {
|
|
168
|
+
return (path.length >= 2
|
|
169
|
+
&& path[0] === 3 /* PartFingerprint.OverflowGuard */
|
|
170
|
+
&& path[1] === 4 /* PartFingerprint.OverlayWidgets */);
|
|
171
|
+
}
|
|
172
|
+
static isChildOfOverflowingOverlayWidgets(path) {
|
|
173
|
+
return (path.length >= 1
|
|
174
|
+
&& path[0] === 5 /* PartFingerprint.OverflowingOverlayWidgets */);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
class HitTestContext {
|
|
178
|
+
constructor(context, viewHelper, lastRenderData) {
|
|
179
|
+
this.viewModel = context.viewModel;
|
|
180
|
+
const options = context.configuration.options;
|
|
181
|
+
this.layoutInfo = options.get(165 /* EditorOption.layoutInfo */);
|
|
182
|
+
this.viewDomNode = viewHelper.viewDomNode;
|
|
183
|
+
this.viewLinesGpu = viewHelper.viewLinesGpu;
|
|
184
|
+
this.lineHeight = options.get(75 /* EditorOption.lineHeight */);
|
|
185
|
+
this.stickyTabStops = options.get(132 /* EditorOption.stickyTabStops */);
|
|
186
|
+
this.typicalHalfwidthCharacterWidth = options.get(59 /* EditorOption.fontInfo */).typicalHalfwidthCharacterWidth;
|
|
187
|
+
this.lastRenderData = lastRenderData;
|
|
188
|
+
this._context = context;
|
|
189
|
+
this._viewHelper = viewHelper;
|
|
190
|
+
}
|
|
191
|
+
getZoneAtCoord(mouseVerticalOffset) {
|
|
192
|
+
return HitTestContext.getZoneAtCoord(this._context, mouseVerticalOffset);
|
|
193
|
+
}
|
|
194
|
+
static getZoneAtCoord(context, mouseVerticalOffset) {
|
|
195
|
+
// The target is either a view zone or the empty space after the last view-line
|
|
196
|
+
const viewZoneWhitespace = context.viewLayout.getWhitespaceAtVerticalOffset(mouseVerticalOffset);
|
|
197
|
+
if (viewZoneWhitespace) {
|
|
198
|
+
const viewZoneMiddle = viewZoneWhitespace.verticalOffset + viewZoneWhitespace.height / 2;
|
|
199
|
+
const lineCount = context.viewModel.getLineCount();
|
|
200
|
+
let positionBefore = null;
|
|
201
|
+
let position;
|
|
202
|
+
let positionAfter = null;
|
|
203
|
+
if (viewZoneWhitespace.afterLineNumber !== lineCount) {
|
|
204
|
+
// There are more lines after this view zone
|
|
205
|
+
positionAfter = new Position(viewZoneWhitespace.afterLineNumber + 1, 1);
|
|
206
|
+
}
|
|
207
|
+
if (viewZoneWhitespace.afterLineNumber > 0) {
|
|
208
|
+
// There are more lines above this view zone
|
|
209
|
+
positionBefore = new Position(viewZoneWhitespace.afterLineNumber, context.viewModel.getLineMaxColumn(viewZoneWhitespace.afterLineNumber));
|
|
210
|
+
}
|
|
211
|
+
if (positionAfter === null) {
|
|
212
|
+
position = positionBefore;
|
|
213
|
+
}
|
|
214
|
+
else if (positionBefore === null) {
|
|
215
|
+
position = positionAfter;
|
|
216
|
+
}
|
|
217
|
+
else if (mouseVerticalOffset < viewZoneMiddle) {
|
|
218
|
+
position = positionBefore;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
position = positionAfter;
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
viewZoneId: viewZoneWhitespace.id,
|
|
225
|
+
afterLineNumber: viewZoneWhitespace.afterLineNumber,
|
|
226
|
+
positionBefore: positionBefore,
|
|
227
|
+
positionAfter: positionAfter,
|
|
228
|
+
position: position
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
getFullLineRangeAtCoord(mouseVerticalOffset) {
|
|
234
|
+
if (this._context.viewLayout.isAfterLines(mouseVerticalOffset)) {
|
|
235
|
+
// Below the last line
|
|
236
|
+
const lineNumber = this._context.viewModel.getLineCount();
|
|
237
|
+
const maxLineColumn = this._context.viewModel.getLineMaxColumn(lineNumber);
|
|
238
|
+
return {
|
|
239
|
+
range: new Range(lineNumber, maxLineColumn, lineNumber, maxLineColumn),
|
|
240
|
+
isAfterLines: true
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const lineNumber = this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset);
|
|
244
|
+
const maxLineColumn = this._context.viewModel.getLineMaxColumn(lineNumber);
|
|
245
|
+
return {
|
|
246
|
+
range: new Range(lineNumber, 1, lineNumber, maxLineColumn),
|
|
247
|
+
isAfterLines: false
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
getLineNumberAtVerticalOffset(mouseVerticalOffset) {
|
|
251
|
+
return this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset);
|
|
252
|
+
}
|
|
253
|
+
isAfterLines(mouseVerticalOffset) {
|
|
254
|
+
return this._context.viewLayout.isAfterLines(mouseVerticalOffset);
|
|
255
|
+
}
|
|
256
|
+
isInTopPadding(mouseVerticalOffset) {
|
|
257
|
+
return this._context.viewLayout.isInTopPadding(mouseVerticalOffset);
|
|
258
|
+
}
|
|
259
|
+
isInBottomPadding(mouseVerticalOffset) {
|
|
260
|
+
return this._context.viewLayout.isInBottomPadding(mouseVerticalOffset);
|
|
261
|
+
}
|
|
262
|
+
getVerticalOffsetForLineNumber(lineNumber) {
|
|
263
|
+
return this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber);
|
|
264
|
+
}
|
|
265
|
+
findAttribute(element, attr) {
|
|
266
|
+
return HitTestContext._findAttribute(element, attr, this._viewHelper.viewDomNode);
|
|
267
|
+
}
|
|
268
|
+
static _findAttribute(element, attr, stopAt) {
|
|
269
|
+
while (element && element !== element.ownerDocument.body) {
|
|
270
|
+
if (element.hasAttribute && element.hasAttribute(attr)) {
|
|
271
|
+
return element.getAttribute(attr);
|
|
272
|
+
}
|
|
273
|
+
if (element === stopAt) {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
element = element.parentNode;
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
getLineWidth(lineNumber) {
|
|
281
|
+
return this._viewHelper.getLineWidth(lineNumber);
|
|
282
|
+
}
|
|
283
|
+
isRtl(lineNumber) {
|
|
284
|
+
return this.viewModel.getTextDirection(lineNumber) === TextDirection.RTL;
|
|
285
|
+
}
|
|
286
|
+
visibleRangeForPosition(lineNumber, column) {
|
|
287
|
+
return this._viewHelper.visibleRangeForPosition(lineNumber, column);
|
|
288
|
+
}
|
|
289
|
+
getPositionFromDOMInfo(spanNode, offset) {
|
|
290
|
+
return this._viewHelper.getPositionFromDOMInfo(spanNode, offset);
|
|
291
|
+
}
|
|
292
|
+
getCurrentScrollTop() {
|
|
293
|
+
return this._context.viewLayout.getCurrentScrollTop();
|
|
294
|
+
}
|
|
295
|
+
getCurrentScrollLeft() {
|
|
296
|
+
return this._context.viewLayout.getCurrentScrollLeft();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
class BareHitTestRequest {
|
|
300
|
+
constructor(ctx, editorPos, pos, relativePos) {
|
|
301
|
+
this.editorPos = editorPos;
|
|
302
|
+
this.pos = pos;
|
|
303
|
+
this.relativePos = relativePos;
|
|
304
|
+
this.mouseVerticalOffset = Math.max(0, ctx.getCurrentScrollTop() + this.relativePos.y);
|
|
305
|
+
this.mouseContentHorizontalOffset = ctx.getCurrentScrollLeft() + this.relativePos.x - ctx.layoutInfo.contentLeft;
|
|
306
|
+
this.isInMarginArea = (this.relativePos.x < ctx.layoutInfo.contentLeft && this.relativePos.x >= ctx.layoutInfo.glyphMarginLeft);
|
|
307
|
+
this.isInContentArea = !this.isInMarginArea;
|
|
308
|
+
this.mouseColumn = Math.max(0, MouseTargetFactory._getMouseColumn(this.mouseContentHorizontalOffset, ctx.typicalHalfwidthCharacterWidth));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
class HitTestRequest extends BareHitTestRequest {
|
|
312
|
+
get target() {
|
|
313
|
+
if (this._useHitTestTarget) {
|
|
314
|
+
return this.hitTestResult.value.hitTarget;
|
|
315
|
+
}
|
|
316
|
+
return this._eventTarget;
|
|
317
|
+
}
|
|
318
|
+
get targetPath() {
|
|
319
|
+
if (this._targetPathCacheElement !== this.target) {
|
|
320
|
+
this._targetPathCacheElement = this.target;
|
|
321
|
+
this._targetPathCacheValue = PartFingerprints.collect(this.target, this._ctx.viewDomNode);
|
|
322
|
+
}
|
|
323
|
+
return this._targetPathCacheValue;
|
|
324
|
+
}
|
|
325
|
+
constructor(ctx, editorPos, pos, relativePos, eventTarget) {
|
|
326
|
+
super(ctx, editorPos, pos, relativePos);
|
|
327
|
+
this.hitTestResult = new Lazy(() => MouseTargetFactory.doHitTest(this._ctx, this));
|
|
328
|
+
this._targetPathCacheElement = null;
|
|
329
|
+
this._targetPathCacheValue = new Uint8Array(0);
|
|
330
|
+
this._ctx = ctx;
|
|
331
|
+
this._eventTarget = eventTarget;
|
|
332
|
+
// If no event target is passed in, we will use the hit test target
|
|
333
|
+
const hasEventTarget = Boolean(this._eventTarget);
|
|
334
|
+
this._useHitTestTarget = !hasEventTarget;
|
|
335
|
+
}
|
|
336
|
+
toString() {
|
|
337
|
+
return `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target ? this.target.outerHTML : null}`;
|
|
338
|
+
}
|
|
339
|
+
get wouldBenefitFromHitTestTargetSwitch() {
|
|
340
|
+
return (!this._useHitTestTarget
|
|
341
|
+
&& this.hitTestResult.value.hitTarget !== null
|
|
342
|
+
&& this.target !== this.hitTestResult.value.hitTarget);
|
|
343
|
+
}
|
|
344
|
+
switchToHitTestTarget() {
|
|
345
|
+
this._useHitTestTarget = true;
|
|
346
|
+
}
|
|
347
|
+
_getMouseColumn(position = null) {
|
|
348
|
+
if (position && position.column < this._ctx.viewModel.getLineMaxColumn(position.lineNumber)) {
|
|
349
|
+
// Most likely, the line contains foreign decorations...
|
|
350
|
+
return CursorColumns.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(position.lineNumber), position.column, this._ctx.viewModel.model.getOptions().tabSize) + 1;
|
|
351
|
+
}
|
|
352
|
+
return this.mouseColumn;
|
|
353
|
+
}
|
|
354
|
+
fulfillUnknown(position = null) {
|
|
355
|
+
return MouseTarget.createUnknown(this.target, this._getMouseColumn(position), position);
|
|
356
|
+
}
|
|
357
|
+
fulfillTextarea() {
|
|
358
|
+
return MouseTarget.createTextarea(this.target, this._getMouseColumn());
|
|
359
|
+
}
|
|
360
|
+
fulfillMargin(type, position, range, detail) {
|
|
361
|
+
return MouseTarget.createMargin(type, this.target, this._getMouseColumn(position), position, range, detail);
|
|
362
|
+
}
|
|
363
|
+
fulfillViewZone(type, position, detail) {
|
|
364
|
+
// Always return the usual mouse column for a view zone.
|
|
365
|
+
return MouseTarget.createViewZone(type, this.target, this._getMouseColumn(), position, detail);
|
|
366
|
+
}
|
|
367
|
+
fulfillContentText(position, range, detail) {
|
|
368
|
+
return MouseTarget.createContentText(this.target, this._getMouseColumn(position), position, range, detail);
|
|
369
|
+
}
|
|
370
|
+
fulfillContentEmpty(position, detail) {
|
|
371
|
+
return MouseTarget.createContentEmpty(this.target, this._getMouseColumn(position), position, detail);
|
|
372
|
+
}
|
|
373
|
+
fulfillContentWidget(detail) {
|
|
374
|
+
return MouseTarget.createContentWidget(this.target, this._getMouseColumn(), detail);
|
|
375
|
+
}
|
|
376
|
+
fulfillScrollbar(position) {
|
|
377
|
+
return MouseTarget.createScrollbar(this.target, this._getMouseColumn(position), position);
|
|
378
|
+
}
|
|
379
|
+
fulfillOverlayWidget(detail) {
|
|
380
|
+
return MouseTarget.createOverlayWidget(this.target, this._getMouseColumn(), detail);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
const EMPTY_CONTENT_AFTER_LINES = { isAfterLines: true };
|
|
384
|
+
function createEmptyContentDataInLines(horizontalDistanceToText) {
|
|
385
|
+
return {
|
|
386
|
+
isAfterLines: false,
|
|
387
|
+
horizontalDistanceToText: horizontalDistanceToText
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
class MouseTargetFactory {
|
|
391
|
+
constructor(context, viewHelper) {
|
|
392
|
+
this._context = context;
|
|
393
|
+
this._viewHelper = viewHelper;
|
|
394
|
+
}
|
|
395
|
+
mouseTargetIsWidget(e) {
|
|
396
|
+
const t = e.target;
|
|
397
|
+
const path = PartFingerprints.collect(t, this._viewHelper.viewDomNode);
|
|
398
|
+
// Is it a content widget?
|
|
399
|
+
if (ElementPath.isChildOfContentWidgets(path) || ElementPath.isChildOfOverflowingContentWidgets(path)) {
|
|
400
|
+
return true;
|
|
401
|
+
}
|
|
402
|
+
// Is it an overlay widget?
|
|
403
|
+
if (ElementPath.isChildOfOverlayWidgets(path) || ElementPath.isChildOfOverflowingOverlayWidgets(path)) {
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
createMouseTarget(lastRenderData, editorPos, pos, relativePos, target) {
|
|
409
|
+
const ctx = new HitTestContext(this._context, this._viewHelper, lastRenderData);
|
|
410
|
+
const request = new HitTestRequest(ctx, editorPos, pos, relativePos, target);
|
|
411
|
+
try {
|
|
412
|
+
const r = MouseTargetFactory._createMouseTarget(ctx, request);
|
|
413
|
+
if (r.type === 6 /* MouseTargetType.CONTENT_TEXT */) {
|
|
414
|
+
// Snap to the nearest soft tab boundary if atomic soft tabs are enabled.
|
|
415
|
+
if (ctx.stickyTabStops && r.position !== null) {
|
|
416
|
+
const position = MouseTargetFactory._snapToSoftTabBoundary(r.position, ctx.viewModel);
|
|
417
|
+
const range = Range.fromPositions(position, position).plusRange(r.range);
|
|
418
|
+
return request.fulfillContentText(position, range, r.detail);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
// console.log(MouseTarget.toString(r));
|
|
422
|
+
return r;
|
|
423
|
+
}
|
|
424
|
+
catch (err) {
|
|
425
|
+
// console.log(err);
|
|
426
|
+
return request.fulfillUnknown();
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
static _createMouseTarget(ctx, request) {
|
|
430
|
+
// console.log(`${domHitTestExecuted ? '=>' : ''}CAME IN REQUEST: ${request}`);
|
|
431
|
+
if (request.target === null) {
|
|
432
|
+
// No target
|
|
433
|
+
return request.fulfillUnknown();
|
|
434
|
+
}
|
|
435
|
+
// we know for a fact that request.target is not null
|
|
436
|
+
const resolvedRequest = request;
|
|
437
|
+
let result = null;
|
|
438
|
+
if (!ElementPath.isChildOfOverflowGuard(request.targetPath) && !ElementPath.isChildOfOverflowingContentWidgets(request.targetPath) && !ElementPath.isChildOfOverflowingOverlayWidgets(request.targetPath)) {
|
|
439
|
+
// We only render dom nodes inside the overflow guard or in the overflowing content widgets
|
|
440
|
+
result = result || request.fulfillUnknown();
|
|
441
|
+
}
|
|
442
|
+
result = result || MouseTargetFactory._hitTestContentWidget(ctx, resolvedRequest);
|
|
443
|
+
result = result || MouseTargetFactory._hitTestOverlayWidget(ctx, resolvedRequest);
|
|
444
|
+
result = result || MouseTargetFactory._hitTestMinimap(ctx, resolvedRequest);
|
|
445
|
+
result = result || MouseTargetFactory._hitTestScrollbarSlider(ctx, resolvedRequest);
|
|
446
|
+
result = result || MouseTargetFactory._hitTestViewZone(ctx, resolvedRequest);
|
|
447
|
+
result = result || MouseTargetFactory._hitTestMargin(ctx, resolvedRequest);
|
|
448
|
+
result = result || MouseTargetFactory._hitTestViewCursor(ctx, resolvedRequest);
|
|
449
|
+
result = result || MouseTargetFactory._hitTestTextArea(ctx, resolvedRequest);
|
|
450
|
+
result = result || MouseTargetFactory._hitTestViewLines(ctx, resolvedRequest);
|
|
451
|
+
result = result || MouseTargetFactory._hitTestScrollbar(ctx, resolvedRequest);
|
|
452
|
+
return (result || request.fulfillUnknown());
|
|
453
|
+
}
|
|
454
|
+
static _hitTestContentWidget(ctx, request) {
|
|
455
|
+
// Is it a content widget?
|
|
456
|
+
if (ElementPath.isChildOfContentWidgets(request.targetPath) || ElementPath.isChildOfOverflowingContentWidgets(request.targetPath)) {
|
|
457
|
+
const widgetId = ctx.findAttribute(request.target, 'widgetId');
|
|
458
|
+
if (widgetId) {
|
|
459
|
+
return request.fulfillContentWidget(widgetId);
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
return request.fulfillUnknown();
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return null;
|
|
466
|
+
}
|
|
467
|
+
static _hitTestOverlayWidget(ctx, request) {
|
|
468
|
+
// Is it an overlay widget?
|
|
469
|
+
if (ElementPath.isChildOfOverlayWidgets(request.targetPath) || ElementPath.isChildOfOverflowingOverlayWidgets(request.targetPath)) {
|
|
470
|
+
const widgetId = ctx.findAttribute(request.target, 'widgetId');
|
|
471
|
+
if (widgetId) {
|
|
472
|
+
return request.fulfillOverlayWidget(widgetId);
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
return request.fulfillUnknown();
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return null;
|
|
479
|
+
}
|
|
480
|
+
static _hitTestViewCursor(ctx, request) {
|
|
481
|
+
if (request.target) {
|
|
482
|
+
// Check if we've hit a painted cursor
|
|
483
|
+
const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData;
|
|
484
|
+
for (const d of lastViewCursorsRenderData) {
|
|
485
|
+
if (request.target === d.domNode) {
|
|
486
|
+
return request.fulfillContentText(d.position, null, { mightBeForeignElement: false, injectedText: null });
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
if (request.isInContentArea) {
|
|
491
|
+
// Edge has a bug when hit-testing the exact position of a cursor,
|
|
492
|
+
// instead of returning the correct dom node, it returns the
|
|
493
|
+
// first or last rendered view line dom node, therefore help it out
|
|
494
|
+
// and first check if we are on top of a cursor
|
|
495
|
+
const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData;
|
|
496
|
+
const mouseContentHorizontalOffset = request.mouseContentHorizontalOffset;
|
|
497
|
+
const mouseVerticalOffset = request.mouseVerticalOffset;
|
|
498
|
+
for (const d of lastViewCursorsRenderData) {
|
|
499
|
+
if (mouseContentHorizontalOffset < d.contentLeft) {
|
|
500
|
+
// mouse position is to the left of the cursor
|
|
501
|
+
continue;
|
|
502
|
+
}
|
|
503
|
+
if (mouseContentHorizontalOffset > d.contentLeft + d.width) {
|
|
504
|
+
// mouse position is to the right of the cursor
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
507
|
+
const cursorVerticalOffset = ctx.getVerticalOffsetForLineNumber(d.position.lineNumber);
|
|
508
|
+
if (cursorVerticalOffset <= mouseVerticalOffset
|
|
509
|
+
&& mouseVerticalOffset <= cursorVerticalOffset + d.height) {
|
|
510
|
+
return request.fulfillContentText(d.position, null, { mightBeForeignElement: false, injectedText: null });
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
return null;
|
|
515
|
+
}
|
|
516
|
+
static _hitTestViewZone(ctx, request) {
|
|
517
|
+
const viewZoneData = ctx.getZoneAtCoord(request.mouseVerticalOffset);
|
|
518
|
+
if (viewZoneData) {
|
|
519
|
+
const mouseTargetType = (request.isInContentArea ? 8 /* MouseTargetType.CONTENT_VIEW_ZONE */ : 5 /* MouseTargetType.GUTTER_VIEW_ZONE */);
|
|
520
|
+
return request.fulfillViewZone(mouseTargetType, viewZoneData.position, viewZoneData);
|
|
521
|
+
}
|
|
522
|
+
return null;
|
|
523
|
+
}
|
|
524
|
+
static _hitTestTextArea(ctx, request) {
|
|
525
|
+
// Is it the textarea?
|
|
526
|
+
if (ElementPath.isTextArea(request.targetPath)) {
|
|
527
|
+
if (ctx.lastRenderData.lastTextareaPosition) {
|
|
528
|
+
return request.fulfillContentText(ctx.lastRenderData.lastTextareaPosition, null, { mightBeForeignElement: false, injectedText: null });
|
|
529
|
+
}
|
|
530
|
+
return request.fulfillTextarea();
|
|
531
|
+
}
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
534
|
+
static _hitTestMargin(ctx, request) {
|
|
535
|
+
if (request.isInMarginArea) {
|
|
536
|
+
const res = ctx.getFullLineRangeAtCoord(request.mouseVerticalOffset);
|
|
537
|
+
const pos = res.range.getStartPosition();
|
|
538
|
+
let offset = Math.abs(request.relativePos.x);
|
|
539
|
+
const detail = {
|
|
540
|
+
isAfterLines: res.isAfterLines,
|
|
541
|
+
glyphMarginLeft: ctx.layoutInfo.glyphMarginLeft,
|
|
542
|
+
glyphMarginWidth: ctx.layoutInfo.glyphMarginWidth,
|
|
543
|
+
lineNumbersWidth: ctx.layoutInfo.lineNumbersWidth,
|
|
544
|
+
offsetX: offset
|
|
545
|
+
};
|
|
546
|
+
offset -= ctx.layoutInfo.glyphMarginLeft;
|
|
547
|
+
if (offset <= ctx.layoutInfo.glyphMarginWidth) {
|
|
548
|
+
// On the glyph margin
|
|
549
|
+
const modelCoordinate = ctx.viewModel.coordinatesConverter.convertViewPositionToModelPosition(res.range.getStartPosition());
|
|
550
|
+
const lanes = ctx.viewModel.glyphLanes.getLanesAtLine(modelCoordinate.lineNumber);
|
|
551
|
+
detail.glyphMarginLane = lanes[Math.floor(offset / ctx.lineHeight)];
|
|
552
|
+
return request.fulfillMargin(2 /* MouseTargetType.GUTTER_GLYPH_MARGIN */, pos, res.range, detail);
|
|
553
|
+
}
|
|
554
|
+
offset -= ctx.layoutInfo.glyphMarginWidth;
|
|
555
|
+
if (offset <= ctx.layoutInfo.lineNumbersWidth) {
|
|
556
|
+
// On the line numbers
|
|
557
|
+
return request.fulfillMargin(3 /* MouseTargetType.GUTTER_LINE_NUMBERS */, pos, res.range, detail);
|
|
558
|
+
}
|
|
559
|
+
offset -= ctx.layoutInfo.lineNumbersWidth;
|
|
560
|
+
// On the line decorations
|
|
561
|
+
return request.fulfillMargin(4 /* MouseTargetType.GUTTER_LINE_DECORATIONS */, pos, res.range, detail);
|
|
562
|
+
}
|
|
563
|
+
return null;
|
|
564
|
+
}
|
|
565
|
+
static _hitTestViewLines(ctx, request) {
|
|
566
|
+
if (!ElementPath.isChildOfViewLines(request.targetPath)) {
|
|
567
|
+
return null;
|
|
568
|
+
}
|
|
569
|
+
if (ctx.isInTopPadding(request.mouseVerticalOffset)) {
|
|
570
|
+
return request.fulfillContentEmpty(new Position(1, 1), EMPTY_CONTENT_AFTER_LINES);
|
|
571
|
+
}
|
|
572
|
+
// Check if it is below any lines and any view zones
|
|
573
|
+
if (ctx.isAfterLines(request.mouseVerticalOffset) || ctx.isInBottomPadding(request.mouseVerticalOffset)) {
|
|
574
|
+
// This most likely indicates it happened after the last view-line
|
|
575
|
+
const lineCount = ctx.viewModel.getLineCount();
|
|
576
|
+
const maxLineColumn = ctx.viewModel.getLineMaxColumn(lineCount);
|
|
577
|
+
return request.fulfillContentEmpty(new Position(lineCount, maxLineColumn), EMPTY_CONTENT_AFTER_LINES);
|
|
578
|
+
}
|
|
579
|
+
// Check if we are hitting a view-line (can happen in the case of inline decorations on empty lines)
|
|
580
|
+
// See https://github.com/microsoft/vscode/issues/46942
|
|
581
|
+
if (ElementPath.isStrictChildOfViewLines(request.targetPath)) {
|
|
582
|
+
const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
|
|
583
|
+
const lineLength = ctx.viewModel.getLineLength(lineNumber);
|
|
584
|
+
const lineWidth = ctx.getLineWidth(lineNumber);
|
|
585
|
+
if (lineLength === 0) {
|
|
586
|
+
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
|
587
|
+
return request.fulfillContentEmpty(new Position(lineNumber, 1), detail);
|
|
588
|
+
}
|
|
589
|
+
const isRtl = ctx.isRtl(lineNumber);
|
|
590
|
+
if (isRtl) {
|
|
591
|
+
if (request.mouseContentHorizontalOffset + lineWidth <= ctx.layoutInfo.contentWidth - ctx.layoutInfo.verticalScrollbarWidth) {
|
|
592
|
+
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
|
593
|
+
const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));
|
|
594
|
+
return request.fulfillContentEmpty(pos, detail);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
else if (request.mouseContentHorizontalOffset >= lineWidth) {
|
|
598
|
+
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
|
599
|
+
const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));
|
|
600
|
+
return request.fulfillContentEmpty(pos, detail);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
else {
|
|
604
|
+
if (ctx.viewLinesGpu) {
|
|
605
|
+
const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
|
|
606
|
+
if (ctx.viewModel.getLineLength(lineNumber) === 0) {
|
|
607
|
+
const lineWidth = ctx.getLineWidth(lineNumber);
|
|
608
|
+
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
|
609
|
+
return request.fulfillContentEmpty(new Position(lineNumber, 1), detail);
|
|
610
|
+
}
|
|
611
|
+
const lineWidth = ctx.getLineWidth(lineNumber);
|
|
612
|
+
const isRtl = ctx.isRtl(lineNumber);
|
|
613
|
+
if (isRtl) {
|
|
614
|
+
if (request.mouseContentHorizontalOffset + lineWidth <= ctx.layoutInfo.contentWidth - ctx.layoutInfo.verticalScrollbarWidth) {
|
|
615
|
+
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
|
616
|
+
const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));
|
|
617
|
+
return request.fulfillContentEmpty(pos, detail);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
else if (request.mouseContentHorizontalOffset >= lineWidth) {
|
|
621
|
+
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
|
622
|
+
const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));
|
|
623
|
+
return request.fulfillContentEmpty(pos, detail);
|
|
624
|
+
}
|
|
625
|
+
const position = ctx.viewLinesGpu.getPositionAtCoordinate(lineNumber, request.mouseContentHorizontalOffset);
|
|
626
|
+
if (position) {
|
|
627
|
+
const detail = {
|
|
628
|
+
injectedText: null,
|
|
629
|
+
mightBeForeignElement: false
|
|
630
|
+
};
|
|
631
|
+
return request.fulfillContentText(position, Range.fromPositions(position, position), detail);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
// Do the hit test (if not already done)
|
|
636
|
+
const hitTestResult = request.hitTestResult.value;
|
|
637
|
+
if (hitTestResult.type === 1 /* HitTestResultType.Content */) {
|
|
638
|
+
return MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.spanNode, hitTestResult.position, hitTestResult.injectedText);
|
|
639
|
+
}
|
|
640
|
+
// We didn't hit content...
|
|
641
|
+
if (request.wouldBenefitFromHitTestTargetSwitch) {
|
|
642
|
+
// We actually hit something different... Give it one last change by trying again with this new target
|
|
643
|
+
request.switchToHitTestTarget();
|
|
644
|
+
return this._createMouseTarget(ctx, request);
|
|
645
|
+
}
|
|
646
|
+
// We have tried everything...
|
|
647
|
+
return request.fulfillUnknown();
|
|
648
|
+
}
|
|
649
|
+
static _hitTestMinimap(ctx, request) {
|
|
650
|
+
if (ElementPath.isChildOfMinimap(request.targetPath)) {
|
|
651
|
+
const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
|
|
652
|
+
const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);
|
|
653
|
+
return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));
|
|
654
|
+
}
|
|
655
|
+
return null;
|
|
656
|
+
}
|
|
657
|
+
static _hitTestScrollbarSlider(ctx, request) {
|
|
658
|
+
if (ElementPath.isChildOfScrollableElement(request.targetPath)) {
|
|
659
|
+
if (request.target && request.target.nodeType === 1) {
|
|
660
|
+
const className = request.target.className;
|
|
661
|
+
if (className && /\b(slider|scrollbar)\b/.test(className)) {
|
|
662
|
+
const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
|
|
663
|
+
const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);
|
|
664
|
+
return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
return null;
|
|
669
|
+
}
|
|
670
|
+
static _hitTestScrollbar(ctx, request) {
|
|
671
|
+
// Is it the overview ruler?
|
|
672
|
+
// Is it a child of the scrollable element?
|
|
673
|
+
if (ElementPath.isChildOfScrollableElement(request.targetPath)) {
|
|
674
|
+
const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
|
|
675
|
+
const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);
|
|
676
|
+
return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));
|
|
677
|
+
}
|
|
678
|
+
return null;
|
|
679
|
+
}
|
|
680
|
+
getMouseColumn(relativePos) {
|
|
681
|
+
const options = this._context.configuration.options;
|
|
682
|
+
const layoutInfo = options.get(165 /* EditorOption.layoutInfo */);
|
|
683
|
+
const mouseContentHorizontalOffset = this._context.viewLayout.getCurrentScrollLeft() + relativePos.x - layoutInfo.contentLeft;
|
|
684
|
+
return MouseTargetFactory._getMouseColumn(mouseContentHorizontalOffset, options.get(59 /* EditorOption.fontInfo */).typicalHalfwidthCharacterWidth);
|
|
685
|
+
}
|
|
686
|
+
static _getMouseColumn(mouseContentHorizontalOffset, typicalHalfwidthCharacterWidth) {
|
|
687
|
+
if (mouseContentHorizontalOffset < 0) {
|
|
688
|
+
return 1;
|
|
689
|
+
}
|
|
690
|
+
const chars = Math.round(mouseContentHorizontalOffset / typicalHalfwidthCharacterWidth);
|
|
691
|
+
return (chars + 1);
|
|
692
|
+
}
|
|
693
|
+
static createMouseTargetFromHitTestPosition(ctx, request, spanNode, pos, injectedText) {
|
|
694
|
+
const lineNumber = pos.lineNumber;
|
|
695
|
+
const column = pos.column;
|
|
696
|
+
const lineWidth = ctx.getLineWidth(lineNumber);
|
|
697
|
+
if (request.mouseContentHorizontalOffset > lineWidth) {
|
|
698
|
+
const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);
|
|
699
|
+
return request.fulfillContentEmpty(pos, detail);
|
|
700
|
+
}
|
|
701
|
+
const visibleRange = ctx.visibleRangeForPosition(lineNumber, column);
|
|
702
|
+
if (!visibleRange) {
|
|
703
|
+
return request.fulfillUnknown(pos);
|
|
704
|
+
}
|
|
705
|
+
const columnHorizontalOffset = visibleRange.left;
|
|
706
|
+
if (Math.abs(request.mouseContentHorizontalOffset - columnHorizontalOffset) < 1) {
|
|
707
|
+
return request.fulfillContentText(pos, null, { mightBeForeignElement: !!injectedText, injectedText });
|
|
708
|
+
}
|
|
709
|
+
const points = [];
|
|
710
|
+
points.push({ offset: visibleRange.left, column: column });
|
|
711
|
+
if (column > 1) {
|
|
712
|
+
const visibleRange = ctx.visibleRangeForPosition(lineNumber, column - 1);
|
|
713
|
+
if (visibleRange) {
|
|
714
|
+
points.push({ offset: visibleRange.left, column: column - 1 });
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
const lineMaxColumn = ctx.viewModel.getLineMaxColumn(lineNumber);
|
|
718
|
+
if (column < lineMaxColumn) {
|
|
719
|
+
const visibleRange = ctx.visibleRangeForPosition(lineNumber, column + 1);
|
|
720
|
+
if (visibleRange) {
|
|
721
|
+
points.push({ offset: visibleRange.left, column: column + 1 });
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
points.sort((a, b) => a.offset - b.offset);
|
|
725
|
+
const mouseCoordinates = request.pos.toClientCoordinates(getWindow(ctx.viewDomNode));
|
|
726
|
+
const spanNodeClientRect = spanNode.getBoundingClientRect();
|
|
727
|
+
const mouseIsOverSpanNode = (spanNodeClientRect.left <= mouseCoordinates.clientX && mouseCoordinates.clientX <= spanNodeClientRect.right);
|
|
728
|
+
let rng = null;
|
|
729
|
+
for (let i = 1; i < points.length; i++) {
|
|
730
|
+
const prev = points[i - 1];
|
|
731
|
+
const curr = points[i];
|
|
732
|
+
if (prev.offset <= request.mouseContentHorizontalOffset && request.mouseContentHorizontalOffset <= curr.offset) {
|
|
733
|
+
rng = new Range(lineNumber, prev.column, lineNumber, curr.column);
|
|
734
|
+
// See https://github.com/microsoft/vscode/issues/152819
|
|
735
|
+
// Due to the use of zwj, the browser's hit test result is skewed towards the left
|
|
736
|
+
// Here we try to correct that if the mouse horizontal offset is closer to the right than the left
|
|
737
|
+
const prevDelta = Math.abs(prev.offset - request.mouseContentHorizontalOffset);
|
|
738
|
+
const nextDelta = Math.abs(curr.offset - request.mouseContentHorizontalOffset);
|
|
739
|
+
pos = (prevDelta < nextDelta
|
|
740
|
+
? new Position(lineNumber, prev.column)
|
|
741
|
+
: new Position(lineNumber, curr.column));
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return request.fulfillContentText(pos, rng, { mightBeForeignElement: !mouseIsOverSpanNode || !!injectedText, injectedText });
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Most probably WebKit browsers and Edge
|
|
749
|
+
*/
|
|
750
|
+
static _doHitTestWithCaretRangeFromPoint(ctx, request) {
|
|
751
|
+
// In Chrome, especially on Linux it is possible to click between lines,
|
|
752
|
+
// so try to adjust the `hity` below so that it lands in the center of a line
|
|
753
|
+
const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);
|
|
754
|
+
const lineStartVerticalOffset = ctx.getVerticalOffsetForLineNumber(lineNumber);
|
|
755
|
+
const lineEndVerticalOffset = lineStartVerticalOffset + ctx.lineHeight;
|
|
756
|
+
const isBelowLastLine = (lineNumber === ctx.viewModel.getLineCount()
|
|
757
|
+
&& request.mouseVerticalOffset > lineEndVerticalOffset);
|
|
758
|
+
if (!isBelowLastLine) {
|
|
759
|
+
const lineCenteredVerticalOffset = Math.floor((lineStartVerticalOffset + lineEndVerticalOffset) / 2);
|
|
760
|
+
let adjustedPageY = request.pos.y + (lineCenteredVerticalOffset - request.mouseVerticalOffset);
|
|
761
|
+
if (adjustedPageY <= request.editorPos.y) {
|
|
762
|
+
adjustedPageY = request.editorPos.y + 1;
|
|
763
|
+
}
|
|
764
|
+
if (adjustedPageY >= request.editorPos.y + request.editorPos.height) {
|
|
765
|
+
adjustedPageY = request.editorPos.y + request.editorPos.height - 1;
|
|
766
|
+
}
|
|
767
|
+
const adjustedPage = new PageCoordinates(request.pos.x, adjustedPageY);
|
|
768
|
+
const r = this._actualDoHitTestWithCaretRangeFromPoint(ctx, adjustedPage.toClientCoordinates(getWindow(ctx.viewDomNode)));
|
|
769
|
+
if (r.type === 1 /* HitTestResultType.Content */) {
|
|
770
|
+
return r;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
// Also try to hit test without the adjustment (for the edge cases that we are near the top or bottom)
|
|
774
|
+
return this._actualDoHitTestWithCaretRangeFromPoint(ctx, request.pos.toClientCoordinates(getWindow(ctx.viewDomNode)));
|
|
775
|
+
}
|
|
776
|
+
static _actualDoHitTestWithCaretRangeFromPoint(ctx, coords) {
|
|
777
|
+
const shadowRoot = getShadowRoot(ctx.viewDomNode);
|
|
778
|
+
let range;
|
|
779
|
+
if (shadowRoot) {
|
|
780
|
+
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
|
781
|
+
if (typeof shadowRoot.caretRangeFromPoint === 'undefined') {
|
|
782
|
+
range = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY);
|
|
783
|
+
}
|
|
784
|
+
else {
|
|
785
|
+
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
|
786
|
+
range = shadowRoot.caretRangeFromPoint(coords.clientX, coords.clientY);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
|
791
|
+
range = ctx.viewDomNode.ownerDocument.caretRangeFromPoint(coords.clientX, coords.clientY);
|
|
792
|
+
}
|
|
793
|
+
if (!range || !range.startContainer) {
|
|
794
|
+
return new UnknownHitTestResult();
|
|
795
|
+
}
|
|
796
|
+
// Chrome always hits a TEXT_NODE, while Edge sometimes hits a token span
|
|
797
|
+
const startContainer = range.startContainer;
|
|
798
|
+
if (startContainer.nodeType === startContainer.TEXT_NODE) {
|
|
799
|
+
// startContainer is expected to be the token text
|
|
800
|
+
const parent1 = startContainer.parentNode; // expected to be the token span
|
|
801
|
+
const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span
|
|
802
|
+
const parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div
|
|
803
|
+
const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null;
|
|
804
|
+
if (parent3ClassName === ViewLine.CLASS_NAME) {
|
|
805
|
+
return HitTestResult.createFromDOMInfo(ctx, parent1, range.startOffset);
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
return new UnknownHitTestResult(startContainer.parentNode);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
else if (startContainer.nodeType === startContainer.ELEMENT_NODE) {
|
|
812
|
+
// startContainer is expected to be the token span
|
|
813
|
+
const parent1 = startContainer.parentNode; // expected to be the view line container span
|
|
814
|
+
const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line div
|
|
815
|
+
const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null;
|
|
816
|
+
if (parent2ClassName === ViewLine.CLASS_NAME) {
|
|
817
|
+
return HitTestResult.createFromDOMInfo(ctx, startContainer, startContainer.textContent.length);
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
return new UnknownHitTestResult(startContainer);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return new UnknownHitTestResult();
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Most probably Gecko
|
|
827
|
+
*/
|
|
828
|
+
static _doHitTestWithCaretPositionFromPoint(ctx, coords) {
|
|
829
|
+
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
|
830
|
+
const hitResult = ctx.viewDomNode.ownerDocument.caretPositionFromPoint(coords.clientX, coords.clientY);
|
|
831
|
+
if (hitResult.offsetNode.nodeType === hitResult.offsetNode.TEXT_NODE) {
|
|
832
|
+
// offsetNode is expected to be the token text
|
|
833
|
+
const parent1 = hitResult.offsetNode.parentNode; // expected to be the token span
|
|
834
|
+
const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span
|
|
835
|
+
const parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div
|
|
836
|
+
const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null;
|
|
837
|
+
if (parent3ClassName === ViewLine.CLASS_NAME) {
|
|
838
|
+
return HitTestResult.createFromDOMInfo(ctx, hitResult.offsetNode.parentNode, hitResult.offset);
|
|
839
|
+
}
|
|
840
|
+
else {
|
|
841
|
+
return new UnknownHitTestResult(hitResult.offsetNode.parentNode);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
// For inline decorations, Gecko sometimes returns the `<span>` of the line and the offset is the `<span>` with the inline decoration
|
|
845
|
+
// Some other times, it returns the `<span>` with the inline decoration
|
|
846
|
+
if (hitResult.offsetNode.nodeType === hitResult.offsetNode.ELEMENT_NODE) {
|
|
847
|
+
const parent1 = hitResult.offsetNode.parentNode;
|
|
848
|
+
const parent1ClassName = parent1 && parent1.nodeType === parent1.ELEMENT_NODE ? parent1.className : null;
|
|
849
|
+
const parent2 = parent1 ? parent1.parentNode : null;
|
|
850
|
+
const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null;
|
|
851
|
+
if (parent1ClassName === ViewLine.CLASS_NAME) {
|
|
852
|
+
// it returned the `<span>` of the line and the offset is the `<span>` with the inline decoration
|
|
853
|
+
const tokenSpan = hitResult.offsetNode.childNodes[Math.min(hitResult.offset, hitResult.offsetNode.childNodes.length - 1)];
|
|
854
|
+
if (tokenSpan) {
|
|
855
|
+
return HitTestResult.createFromDOMInfo(ctx, tokenSpan, 0);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
else if (parent2ClassName === ViewLine.CLASS_NAME) {
|
|
859
|
+
// it returned the `<span>` with the inline decoration
|
|
860
|
+
return HitTestResult.createFromDOMInfo(ctx, hitResult.offsetNode, 0);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return new UnknownHitTestResult(hitResult.offsetNode);
|
|
864
|
+
}
|
|
865
|
+
static _snapToSoftTabBoundary(position, viewModel) {
|
|
866
|
+
const lineContent = viewModel.getLineContent(position.lineNumber);
|
|
867
|
+
const { tabSize } = viewModel.model.getOptions();
|
|
868
|
+
const newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, position.column - 1, tabSize, 2 /* Direction.Nearest */);
|
|
869
|
+
if (newPosition !== -1) {
|
|
870
|
+
return new Position(position.lineNumber, newPosition + 1);
|
|
871
|
+
}
|
|
872
|
+
return position;
|
|
873
|
+
}
|
|
874
|
+
static doHitTest(ctx, request) {
|
|
875
|
+
let result = new UnknownHitTestResult();
|
|
876
|
+
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
|
877
|
+
if (typeof ctx.viewDomNode.ownerDocument.caretRangeFromPoint === 'function') {
|
|
878
|
+
result = this._doHitTestWithCaretRangeFromPoint(ctx, request);
|
|
879
|
+
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
|
880
|
+
}
|
|
881
|
+
else if (ctx.viewDomNode.ownerDocument.caretPositionFromPoint) {
|
|
882
|
+
result = this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates(getWindow(ctx.viewDomNode)));
|
|
883
|
+
}
|
|
884
|
+
if (result.type === 1 /* HitTestResultType.Content */) {
|
|
885
|
+
const injectedText = ctx.viewModel.getInjectedTextAt(result.position);
|
|
886
|
+
const normalizedPosition = ctx.viewModel.normalizePosition(result.position, 2 /* PositionAffinity.None */);
|
|
887
|
+
if (injectedText || !normalizedPosition.equals(result.position)) {
|
|
888
|
+
result = new ContentHitTestResult(normalizedPosition, result.spanNode, injectedText);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
return result;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
function shadowCaretRangeFromPoint(shadowRoot, x, y) {
|
|
895
|
+
const range = document.createRange();
|
|
896
|
+
// Get the element under the point
|
|
897
|
+
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
|
898
|
+
let el = shadowRoot.elementFromPoint(x, y);
|
|
899
|
+
// When el is not null, it may be div.monaco-mouse-cursor-text Element, which has not childNodes, we don't need to handle it.
|
|
900
|
+
if (el?.hasChildNodes()) {
|
|
901
|
+
// Get the last child of the element until its firstChild is a text node
|
|
902
|
+
// This assumes that the pointer is on the right of the line, out of the tokens
|
|
903
|
+
// and that we want to get the offset of the last token of the line
|
|
904
|
+
while (el && el.firstChild && el.firstChild.nodeType !== el.firstChild.TEXT_NODE && el.lastChild && el.lastChild.firstChild) {
|
|
905
|
+
el = el.lastChild;
|
|
906
|
+
}
|
|
907
|
+
// Grab its rect
|
|
908
|
+
const rect = el.getBoundingClientRect();
|
|
909
|
+
// And its font (the computed shorthand font property might be empty, see #3217)
|
|
910
|
+
const elWindow = getWindow(el);
|
|
911
|
+
const fontStyle = elWindow.getComputedStyle(el, null).getPropertyValue('font-style');
|
|
912
|
+
const fontVariant = elWindow.getComputedStyle(el, null).getPropertyValue('font-variant');
|
|
913
|
+
const fontWeight = elWindow.getComputedStyle(el, null).getPropertyValue('font-weight');
|
|
914
|
+
const fontSize = elWindow.getComputedStyle(el, null).getPropertyValue('font-size');
|
|
915
|
+
const lineHeight = elWindow.getComputedStyle(el, null).getPropertyValue('line-height');
|
|
916
|
+
const fontFamily = elWindow.getComputedStyle(el, null).getPropertyValue('font-family');
|
|
917
|
+
const font = `${fontStyle} ${fontVariant} ${fontWeight} ${fontSize}/${lineHeight} ${fontFamily}`;
|
|
918
|
+
// And also its txt content
|
|
919
|
+
const text = el.innerText;
|
|
920
|
+
// Position the pixel cursor at the left of the element
|
|
921
|
+
let pixelCursor = rect.left;
|
|
922
|
+
let offset = 0;
|
|
923
|
+
let step;
|
|
924
|
+
// If the point is on the right of the box put the cursor after the last character
|
|
925
|
+
if (x > rect.left + rect.width) {
|
|
926
|
+
offset = text.length;
|
|
927
|
+
}
|
|
928
|
+
else {
|
|
929
|
+
const charWidthReader = CharWidthReader.getInstance();
|
|
930
|
+
// Goes through all the characters of the innerText, and checks if the x of the point
|
|
931
|
+
// belongs to the character.
|
|
932
|
+
for (let i = 0; i < text.length + 1; i++) {
|
|
933
|
+
// The step is half the width of the character
|
|
934
|
+
step = charWidthReader.getCharWidth(text.charAt(i), font) / 2;
|
|
935
|
+
// Move to the center of the character
|
|
936
|
+
pixelCursor += step;
|
|
937
|
+
// If the x of the point is smaller that the position of the cursor, the point is over that character
|
|
938
|
+
if (x < pixelCursor) {
|
|
939
|
+
offset = i;
|
|
940
|
+
break;
|
|
941
|
+
}
|
|
942
|
+
// Move between the current character and the next
|
|
943
|
+
pixelCursor += step;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
// Creates a range with the text node of the element and set the offset found
|
|
947
|
+
range.setStart(el.firstChild, offset);
|
|
948
|
+
range.setEnd(el.firstChild, offset);
|
|
949
|
+
}
|
|
950
|
+
return range;
|
|
951
|
+
}
|
|
952
|
+
class CharWidthReader {
|
|
953
|
+
static { this._INSTANCE = null; }
|
|
954
|
+
static getInstance() {
|
|
955
|
+
if (!CharWidthReader._INSTANCE) {
|
|
956
|
+
CharWidthReader._INSTANCE = new CharWidthReader();
|
|
957
|
+
}
|
|
958
|
+
return CharWidthReader._INSTANCE;
|
|
959
|
+
}
|
|
960
|
+
constructor() {
|
|
961
|
+
this._cache = {};
|
|
962
|
+
this._canvas = document.createElement('canvas');
|
|
963
|
+
}
|
|
964
|
+
getCharWidth(char, font) {
|
|
965
|
+
const cacheKey = char + font;
|
|
966
|
+
if (this._cache[cacheKey]) {
|
|
967
|
+
return this._cache[cacheKey];
|
|
968
|
+
}
|
|
969
|
+
const context = this._canvas.getContext('2d');
|
|
970
|
+
context.font = font;
|
|
971
|
+
const metrics = context.measureText(char);
|
|
972
|
+
const width = metrics.width;
|
|
973
|
+
this._cache[cacheKey] = width;
|
|
974
|
+
return width;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
export { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData };
|