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,1168 @@
|
|
|
1
|
+
import { trackFocus, getTotalWidth, getDomNodePagePosition, getTopLeftOffset, getComputedStyle } from '../../../../base/browser/dom.js';
|
|
2
|
+
import { alert } from '../../../../base/browser/ui/aria/aria.js';
|
|
3
|
+
import { Toggle } from '../../../../base/browser/ui/toggle/toggle.js';
|
|
4
|
+
import { Sash } from '../../../../base/browser/ui/sash/sash.js';
|
|
5
|
+
import { Widget } from '../../../../base/browser/ui/widget.js';
|
|
6
|
+
import { Delayer } from '../../../../base/common/async.js';
|
|
7
|
+
import { Codicon } from '../../../../base/common/codicons.js';
|
|
8
|
+
import { onUnexpectedError } from '../../../../base/common/errors.js';
|
|
9
|
+
import { toDisposable } from '../../../../base/common/lifecycle.js';
|
|
10
|
+
import { isLinux, isMacintosh } from '../../../../base/common/platform.js';
|
|
11
|
+
import { format } from '../../../../base/common/strings.js';
|
|
12
|
+
import './findWidget.css';
|
|
13
|
+
import { Range } from '../../../common/core/range.js';
|
|
14
|
+
import { MATCHES_LIMIT, CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_REPLACE_INPUT_FOCUSED, FIND_IDS } from './findModel.js';
|
|
15
|
+
import { localize } from '../../../../nls.js';
|
|
16
|
+
import { ContextScopedFindInput, ContextScopedReplaceInput } from '../../../../platform/history/browser/contextScopedHistoryWidget.js';
|
|
17
|
+
import { showHistoryKeybindingHint } from '../../../../platform/history/browser/historyWidgetKeybindingHint.js';
|
|
18
|
+
import { asCssVariable } from '../../../../platform/theme/common/colorUtils.js';
|
|
19
|
+
import { contrastBorder } from '../../../../platform/theme/common/colors/baseColors.js';
|
|
20
|
+
import '../../../../platform/theme/common/colors/chartsColors.js';
|
|
21
|
+
import { editorFindMatchHighlightBorder, editorFindRangeHighlightBorder, editorFindMatchForeground, editorFindMatchHighlightForeground } from '../../../../platform/theme/common/colors/editorColors.js';
|
|
22
|
+
import { inputActiveOptionForeground, inputActiveOptionBorder, inputActiveOptionBackground } from '../../../../platform/theme/common/colors/inputColors.js';
|
|
23
|
+
import '../../../../platform/theme/common/colors/listColors.js';
|
|
24
|
+
import '../../../../platform/theme/common/colors/menuColors.js';
|
|
25
|
+
import '../../../../platform/theme/common/colors/minimapColors.js';
|
|
26
|
+
import '../../../../platform/theme/common/colors/miscColors.js';
|
|
27
|
+
import '../../../../platform/theme/common/colors/quickpickColors.js';
|
|
28
|
+
import '../../../../platform/theme/common/colors/searchColors.js';
|
|
29
|
+
import { registerIcon, widgetClose } from '../../../../platform/theme/common/iconRegistry.js';
|
|
30
|
+
import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js';
|
|
31
|
+
import { ThemeIcon } from '../../../../base/common/themables.js';
|
|
32
|
+
import { isHighContrast } from '../../../../platform/theme/common/theme.js';
|
|
33
|
+
import { assertReturnsDefined } from '../../../../base/common/types.js';
|
|
34
|
+
import { defaultToggleStyles, defaultInputBoxStyles } from '../../../../platform/theme/browser/defaultStyles.js';
|
|
35
|
+
|
|
36
|
+
/*---------------------------------------------------------------------------------------------
|
|
37
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
38
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
39
|
+
*--------------------------------------------------------------------------------------------*/
|
|
40
|
+
const findCollapsedIcon = registerIcon('find-collapsed', Codicon.chevronRight, localize(956, 'Icon to indicate that the editor find widget is collapsed.'));
|
|
41
|
+
const findExpandedIcon = registerIcon('find-expanded', Codicon.chevronDown, localize(957, 'Icon to indicate that the editor find widget is expanded.'));
|
|
42
|
+
const findSelectionIcon = registerIcon('find-selection', Codicon.selection, localize(958, 'Icon for \'Find in Selection\' in the editor find widget.'));
|
|
43
|
+
const findReplaceIcon = registerIcon('find-replace', Codicon.replace, localize(959, 'Icon for \'Replace\' in the editor find widget.'));
|
|
44
|
+
const findReplaceAllIcon = registerIcon('find-replace-all', Codicon.replaceAll, localize(960, 'Icon for \'Replace All\' in the editor find widget.'));
|
|
45
|
+
const findPreviousMatchIcon = registerIcon('find-previous-match', Codicon.arrowUp, localize(961, 'Icon for \'Find Previous\' in the editor find widget.'));
|
|
46
|
+
const findNextMatchIcon = registerIcon('find-next-match', Codicon.arrowDown, localize(962, 'Icon for \'Find Next\' in the editor find widget.'));
|
|
47
|
+
const NLS_FIND_DIALOG_LABEL = localize(963, "Find / Replace");
|
|
48
|
+
const NLS_FIND_INPUT_LABEL = localize(964, "Find");
|
|
49
|
+
const NLS_FIND_INPUT_PLACEHOLDER = localize(965, "Find");
|
|
50
|
+
const NLS_PREVIOUS_MATCH_BTN_LABEL = localize(966, "Previous Match");
|
|
51
|
+
const NLS_NEXT_MATCH_BTN_LABEL = localize(967, "Next Match");
|
|
52
|
+
const NLS_TOGGLE_SELECTION_FIND_TITLE = localize(968, "Find in Selection");
|
|
53
|
+
const NLS_CLOSE_BTN_LABEL = localize(969, "Close");
|
|
54
|
+
const NLS_REPLACE_INPUT_LABEL = localize(970, "Replace");
|
|
55
|
+
const NLS_REPLACE_INPUT_PLACEHOLDER = localize(971, "Replace");
|
|
56
|
+
const NLS_REPLACE_BTN_LABEL = localize(972, "Replace");
|
|
57
|
+
const NLS_REPLACE_ALL_BTN_LABEL = localize(973, "Replace All");
|
|
58
|
+
const NLS_TOGGLE_REPLACE_MODE_BTN_LABEL = localize(974, "Toggle Replace");
|
|
59
|
+
const NLS_MATCHES_COUNT_LIMIT_TITLE = localize(975, "Only the first {0} results are highlighted, but all find operations work on the entire text.", MATCHES_LIMIT);
|
|
60
|
+
const NLS_MATCHES_LOCATION = localize(976, "{0} of {1}");
|
|
61
|
+
const NLS_NO_RESULTS = localize(977, "No results");
|
|
62
|
+
const FIND_WIDGET_INITIAL_WIDTH = 419;
|
|
63
|
+
const PART_WIDTH = 275;
|
|
64
|
+
const FIND_INPUT_AREA_WIDTH = PART_WIDTH - 54;
|
|
65
|
+
let MAX_MATCHES_COUNT_WIDTH = 69;
|
|
66
|
+
// let FIND_ALL_CONTROLS_WIDTH = 17/** Find Input margin-left */ + (MAX_MATCHES_COUNT_WIDTH + 3 + 1) /** Match Results */ + 23 /** Button */ * 4 + 2/** sash */;
|
|
67
|
+
const FIND_INPUT_AREA_HEIGHT = 33; // The height of Find Widget when Replace Input is not visible.
|
|
68
|
+
const ctrlKeyMod = (isMacintosh ? 256 /* KeyMod.WinCtrl */ : 2048 /* KeyMod.CtrlCmd */);
|
|
69
|
+
class FindWidgetViewZone {
|
|
70
|
+
constructor(afterLineNumber) {
|
|
71
|
+
this.afterLineNumber = afterLineNumber;
|
|
72
|
+
this.heightInPx = FIND_INPUT_AREA_HEIGHT;
|
|
73
|
+
this.suppressMouseDown = false;
|
|
74
|
+
this.domNode = document.createElement('div');
|
|
75
|
+
this.domNode.className = 'dock-find-viewzone';
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function stopPropagationForMultiLineUpwards(event, value, textarea) {
|
|
79
|
+
const isMultiline = !!value.match(/\n/);
|
|
80
|
+
if (textarea && isMultiline && textarea.selectionStart > 0) {
|
|
81
|
+
event.stopPropagation();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function stopPropagationForMultiLineDownwards(event, value, textarea) {
|
|
86
|
+
const isMultiline = !!value.match(/\n/);
|
|
87
|
+
if (textarea && isMultiline && textarea.selectionEnd < textarea.value.length) {
|
|
88
|
+
event.stopPropagation();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
class FindWidget extends Widget {
|
|
93
|
+
static { this.ID = 'editor.contrib.findWidget'; }
|
|
94
|
+
constructor(codeEditor, controller, state, contextViewProvider, keybindingService, contextKeyService, _hoverService, _findWidgetSearchHistory, _replaceWidgetHistory) {
|
|
95
|
+
super();
|
|
96
|
+
this._hoverService = _hoverService;
|
|
97
|
+
this._findWidgetSearchHistory = _findWidgetSearchHistory;
|
|
98
|
+
this._replaceWidgetHistory = _replaceWidgetHistory;
|
|
99
|
+
this._cachedHeight = null;
|
|
100
|
+
this._revealTimeouts = [];
|
|
101
|
+
this._codeEditor = codeEditor;
|
|
102
|
+
this._controller = controller;
|
|
103
|
+
this._state = state;
|
|
104
|
+
this._contextViewProvider = contextViewProvider;
|
|
105
|
+
this._keybindingService = keybindingService;
|
|
106
|
+
this._contextKeyService = contextKeyService;
|
|
107
|
+
this._isVisible = false;
|
|
108
|
+
this._isReplaceVisible = false;
|
|
109
|
+
this._ignoreChangeEvent = false;
|
|
110
|
+
this._updateHistoryDelayer = new Delayer(500);
|
|
111
|
+
this._register(toDisposable(() => this._updateHistoryDelayer.cancel()));
|
|
112
|
+
this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));
|
|
113
|
+
this._buildDomNode();
|
|
114
|
+
this._updateButtons();
|
|
115
|
+
this._tryUpdateWidgetWidth();
|
|
116
|
+
this._findInput.inputBox.layout();
|
|
117
|
+
this._register(this._codeEditor.onDidChangeConfiguration((e) => {
|
|
118
|
+
if (e.hasChanged(104 /* EditorOption.readOnly */)) {
|
|
119
|
+
if (this._codeEditor.getOption(104 /* EditorOption.readOnly */)) {
|
|
120
|
+
// Hide replace part if editor becomes read only
|
|
121
|
+
this._state.change({ isReplaceRevealed: false }, false);
|
|
122
|
+
}
|
|
123
|
+
this._updateButtons();
|
|
124
|
+
}
|
|
125
|
+
if (e.hasChanged(165 /* EditorOption.layoutInfo */)) {
|
|
126
|
+
this._tryUpdateWidgetWidth();
|
|
127
|
+
}
|
|
128
|
+
if (e.hasChanged(2 /* EditorOption.accessibilitySupport */)) {
|
|
129
|
+
this.updateAccessibilitySupport();
|
|
130
|
+
}
|
|
131
|
+
if (e.hasChanged(50 /* EditorOption.find */)) {
|
|
132
|
+
const supportLoop = this._codeEditor.getOption(50 /* EditorOption.find */).loop;
|
|
133
|
+
this._state.change({ loop: supportLoop }, false);
|
|
134
|
+
const addExtraSpaceOnTop = this._codeEditor.getOption(50 /* EditorOption.find */).addExtraSpaceOnTop;
|
|
135
|
+
if (addExtraSpaceOnTop && !this._viewZone) {
|
|
136
|
+
this._viewZone = new FindWidgetViewZone(0);
|
|
137
|
+
this._showViewZone();
|
|
138
|
+
}
|
|
139
|
+
if (!addExtraSpaceOnTop && this._viewZone) {
|
|
140
|
+
this._removeViewZone();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}));
|
|
144
|
+
this.updateAccessibilitySupport();
|
|
145
|
+
this._register(this._codeEditor.onDidChangeCursorSelection(() => {
|
|
146
|
+
if (this._isVisible) {
|
|
147
|
+
this._updateToggleSelectionFindButton();
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
150
|
+
this._register(this._codeEditor.onDidFocusEditorWidget(async () => {
|
|
151
|
+
if (this._isVisible) {
|
|
152
|
+
const globalBufferTerm = await this._controller.getGlobalBufferTerm();
|
|
153
|
+
if (globalBufferTerm && globalBufferTerm !== this._state.searchString) {
|
|
154
|
+
this._state.change({ searchString: globalBufferTerm }, false);
|
|
155
|
+
this._findInput.select();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}));
|
|
159
|
+
this._findInputFocused = CONTEXT_FIND_INPUT_FOCUSED.bindTo(contextKeyService);
|
|
160
|
+
this._findFocusTracker = this._register(trackFocus(this._findInput.inputBox.inputElement));
|
|
161
|
+
this._register(this._findFocusTracker.onDidFocus(() => {
|
|
162
|
+
this._findInputFocused.set(true);
|
|
163
|
+
this._updateSearchScope();
|
|
164
|
+
}));
|
|
165
|
+
this._register(this._findFocusTracker.onDidBlur(() => {
|
|
166
|
+
this._findInputFocused.set(false);
|
|
167
|
+
}));
|
|
168
|
+
this._replaceInputFocused = CONTEXT_REPLACE_INPUT_FOCUSED.bindTo(contextKeyService);
|
|
169
|
+
this._replaceFocusTracker = this._register(trackFocus(this._replaceInput.inputBox.inputElement));
|
|
170
|
+
this._register(this._replaceFocusTracker.onDidFocus(() => {
|
|
171
|
+
this._replaceInputFocused.set(true);
|
|
172
|
+
this._updateSearchScope();
|
|
173
|
+
}));
|
|
174
|
+
this._register(this._replaceFocusTracker.onDidBlur(() => {
|
|
175
|
+
this._replaceInputFocused.set(false);
|
|
176
|
+
}));
|
|
177
|
+
this._codeEditor.addOverlayWidget(this);
|
|
178
|
+
if (this._codeEditor.getOption(50 /* EditorOption.find */).addExtraSpaceOnTop) {
|
|
179
|
+
this._viewZone = new FindWidgetViewZone(0); // Put it before the first line then users can scroll beyond the first line.
|
|
180
|
+
}
|
|
181
|
+
this._register(this._codeEditor.onDidChangeModel(() => {
|
|
182
|
+
if (!this._isVisible) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this._viewZoneId = undefined;
|
|
186
|
+
}));
|
|
187
|
+
this._register(this._codeEditor.onDidScrollChange((e) => {
|
|
188
|
+
if (e.scrollTopChanged) {
|
|
189
|
+
this._layoutViewZone();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
// for other scroll changes, layout the viewzone in next tick to avoid ruining current rendering.
|
|
193
|
+
setTimeout(() => {
|
|
194
|
+
this._layoutViewZone();
|
|
195
|
+
}, 0);
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
// ----- IOverlayWidget API
|
|
199
|
+
getId() {
|
|
200
|
+
return FindWidget.ID;
|
|
201
|
+
}
|
|
202
|
+
getDomNode() {
|
|
203
|
+
return this._domNode;
|
|
204
|
+
}
|
|
205
|
+
getPosition() {
|
|
206
|
+
if (this._isVisible) {
|
|
207
|
+
return {
|
|
208
|
+
preference: 0 /* OverlayWidgetPositionPreference.TOP_RIGHT_CORNER */
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
// ----- React to state changes
|
|
214
|
+
_onStateChanged(e) {
|
|
215
|
+
if (e.searchString) {
|
|
216
|
+
try {
|
|
217
|
+
this._ignoreChangeEvent = true;
|
|
218
|
+
this._findInput.setValue(this._state.searchString);
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
this._ignoreChangeEvent = false;
|
|
222
|
+
}
|
|
223
|
+
this._updateButtons();
|
|
224
|
+
}
|
|
225
|
+
if (e.replaceString) {
|
|
226
|
+
this._replaceInput.inputBox.value = this._state.replaceString;
|
|
227
|
+
}
|
|
228
|
+
if (e.isRevealed) {
|
|
229
|
+
if (this._state.isRevealed) {
|
|
230
|
+
this._reveal();
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
this._hide(true);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (e.isReplaceRevealed) {
|
|
237
|
+
if (this._state.isReplaceRevealed) {
|
|
238
|
+
if (!this._codeEditor.getOption(104 /* EditorOption.readOnly */) && !this._isReplaceVisible) {
|
|
239
|
+
this._isReplaceVisible = true;
|
|
240
|
+
this._replaceInput.width = getTotalWidth(this._findInput.domNode);
|
|
241
|
+
this._updateButtons();
|
|
242
|
+
this._replaceInput.inputBox.layout();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
if (this._isReplaceVisible) {
|
|
247
|
+
this._isReplaceVisible = false;
|
|
248
|
+
this._updateButtons();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if ((e.isRevealed || e.isReplaceRevealed) && (this._state.isRevealed || this._state.isReplaceRevealed)) {
|
|
253
|
+
if (this._tryUpdateHeight()) {
|
|
254
|
+
this._showViewZone();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (e.isRegex) {
|
|
258
|
+
this._findInput.setRegex(this._state.isRegex);
|
|
259
|
+
}
|
|
260
|
+
if (e.wholeWord) {
|
|
261
|
+
this._findInput.setWholeWords(this._state.wholeWord);
|
|
262
|
+
}
|
|
263
|
+
if (e.matchCase) {
|
|
264
|
+
this._findInput.setCaseSensitive(this._state.matchCase);
|
|
265
|
+
}
|
|
266
|
+
if (e.preserveCase) {
|
|
267
|
+
this._replaceInput.setPreserveCase(this._state.preserveCase);
|
|
268
|
+
}
|
|
269
|
+
if (e.searchScope) {
|
|
270
|
+
if (this._state.searchScope) {
|
|
271
|
+
this._toggleSelectionFind.checked = true;
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
this._toggleSelectionFind.checked = false;
|
|
275
|
+
}
|
|
276
|
+
this._updateToggleSelectionFindButton();
|
|
277
|
+
}
|
|
278
|
+
if (e.searchString || e.matchesCount || e.matchesPosition) {
|
|
279
|
+
const showRedOutline = (this._state.searchString.length > 0 && this._state.matchesCount === 0);
|
|
280
|
+
this._domNode.classList.toggle('no-results', showRedOutline);
|
|
281
|
+
this._updateMatchesCount();
|
|
282
|
+
this._updateButtons();
|
|
283
|
+
}
|
|
284
|
+
if (e.searchString || e.currentMatch) {
|
|
285
|
+
this._layoutViewZone();
|
|
286
|
+
}
|
|
287
|
+
if (e.updateHistory) {
|
|
288
|
+
this._delayedUpdateHistory();
|
|
289
|
+
}
|
|
290
|
+
if (e.loop) {
|
|
291
|
+
this._updateButtons();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
_delayedUpdateHistory() {
|
|
295
|
+
this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(undefined, onUnexpectedError);
|
|
296
|
+
}
|
|
297
|
+
_updateHistory() {
|
|
298
|
+
if (this._state.searchString) {
|
|
299
|
+
this._findInput.inputBox.addToHistory();
|
|
300
|
+
}
|
|
301
|
+
if (this._state.replaceString) {
|
|
302
|
+
this._replaceInput.inputBox.addToHistory();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
_updateMatchesCount() {
|
|
306
|
+
this._matchesCount.style.minWidth = MAX_MATCHES_COUNT_WIDTH + 'px';
|
|
307
|
+
if (this._state.matchesCount >= MATCHES_LIMIT) {
|
|
308
|
+
this._matchesCount.title = NLS_MATCHES_COUNT_LIMIT_TITLE;
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
this._matchesCount.title = '';
|
|
312
|
+
}
|
|
313
|
+
// remove previous content
|
|
314
|
+
this._matchesCount.firstChild?.remove();
|
|
315
|
+
let label;
|
|
316
|
+
if (this._state.matchesCount > 0) {
|
|
317
|
+
let matchesCount = String(this._state.matchesCount);
|
|
318
|
+
if (this._state.matchesCount >= MATCHES_LIMIT) {
|
|
319
|
+
matchesCount += '+';
|
|
320
|
+
}
|
|
321
|
+
let matchesPosition = String(this._state.matchesPosition);
|
|
322
|
+
if (matchesPosition === '0') {
|
|
323
|
+
matchesPosition = '?';
|
|
324
|
+
}
|
|
325
|
+
label = format(NLS_MATCHES_LOCATION, matchesPosition, matchesCount);
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
label = NLS_NO_RESULTS;
|
|
329
|
+
}
|
|
330
|
+
this._matchesCount.appendChild(document.createTextNode(label));
|
|
331
|
+
alert(this._getAriaLabel(label, this._state.currentMatch, this._state.searchString));
|
|
332
|
+
MAX_MATCHES_COUNT_WIDTH = Math.max(MAX_MATCHES_COUNT_WIDTH, this._matchesCount.clientWidth);
|
|
333
|
+
}
|
|
334
|
+
// ----- actions
|
|
335
|
+
_getAriaLabel(label, currentMatch, searchString) {
|
|
336
|
+
if (label === NLS_NO_RESULTS) {
|
|
337
|
+
return searchString === ''
|
|
338
|
+
? localize(978, "{0} found", label)
|
|
339
|
+
: localize(979, "{0} found for '{1}'", label, searchString);
|
|
340
|
+
}
|
|
341
|
+
if (currentMatch) {
|
|
342
|
+
const ariaLabel = localize(980, "{0} found for '{1}', at {2}", label, searchString, currentMatch.startLineNumber + ':' + currentMatch.startColumn);
|
|
343
|
+
const model = this._codeEditor.getModel();
|
|
344
|
+
if (model && (currentMatch.startLineNumber <= model.getLineCount()) && (currentMatch.startLineNumber >= 1)) {
|
|
345
|
+
const lineContent = model.getLineContent(currentMatch.startLineNumber);
|
|
346
|
+
return `${lineContent}, ${ariaLabel}`;
|
|
347
|
+
}
|
|
348
|
+
return ariaLabel;
|
|
349
|
+
}
|
|
350
|
+
return localize(981, "{0} found for '{1}'", label, searchString);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* If 'selection find' is ON we should not disable the button (its function is to cancel 'selection find').
|
|
354
|
+
* If 'selection find' is OFF we enable the button only if there is a selection.
|
|
355
|
+
*/
|
|
356
|
+
_updateToggleSelectionFindButton() {
|
|
357
|
+
const selection = this._codeEditor.getSelection();
|
|
358
|
+
const isSelection = selection ? (selection.startLineNumber !== selection.endLineNumber || selection.startColumn !== selection.endColumn) : false;
|
|
359
|
+
const isChecked = this._toggleSelectionFind.checked;
|
|
360
|
+
if (this._isVisible && (isChecked || isSelection)) {
|
|
361
|
+
this._toggleSelectionFind.enable();
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
this._toggleSelectionFind.disable();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
_updateButtons() {
|
|
368
|
+
this._findInput.setEnabled(this._isVisible);
|
|
369
|
+
this._replaceInput.setEnabled(this._isVisible && this._isReplaceVisible);
|
|
370
|
+
this._updateToggleSelectionFindButton();
|
|
371
|
+
this._closeBtn.setEnabled(this._isVisible);
|
|
372
|
+
const findInputIsNonEmpty = (this._state.searchString.length > 0);
|
|
373
|
+
const matchesCount = this._state.matchesCount ? true : false;
|
|
374
|
+
this._prevBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount && this._state.canNavigateBack());
|
|
375
|
+
this._nextBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount && this._state.canNavigateForward());
|
|
376
|
+
this._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);
|
|
377
|
+
this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);
|
|
378
|
+
this._domNode.classList.toggle('replaceToggled', this._isReplaceVisible);
|
|
379
|
+
this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);
|
|
380
|
+
const canReplace = !this._codeEditor.getOption(104 /* EditorOption.readOnly */);
|
|
381
|
+
this._toggleReplaceBtn.setEnabled(this._isVisible && canReplace);
|
|
382
|
+
}
|
|
383
|
+
_reveal() {
|
|
384
|
+
this._revealTimeouts.forEach(e => {
|
|
385
|
+
clearTimeout(e);
|
|
386
|
+
});
|
|
387
|
+
this._revealTimeouts = [];
|
|
388
|
+
if (!this._isVisible) {
|
|
389
|
+
this._isVisible = true;
|
|
390
|
+
const selection = this._codeEditor.getSelection();
|
|
391
|
+
switch (this._codeEditor.getOption(50 /* EditorOption.find */).autoFindInSelection) {
|
|
392
|
+
case 'always':
|
|
393
|
+
this._toggleSelectionFind.checked = true;
|
|
394
|
+
break;
|
|
395
|
+
case 'never':
|
|
396
|
+
this._toggleSelectionFind.checked = false;
|
|
397
|
+
break;
|
|
398
|
+
case 'multiline': {
|
|
399
|
+
const isSelectionMultipleLine = !!selection && selection.startLineNumber !== selection.endLineNumber;
|
|
400
|
+
this._toggleSelectionFind.checked = isSelectionMultipleLine;
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
this._tryUpdateWidgetWidth();
|
|
405
|
+
this._updateButtons();
|
|
406
|
+
this._revealTimeouts.push(setTimeout(() => {
|
|
407
|
+
this._domNode.classList.add('visible');
|
|
408
|
+
this._domNode.setAttribute('aria-hidden', 'false');
|
|
409
|
+
}, 0));
|
|
410
|
+
// validate query again as it's being dismissed when we hide the find widget.
|
|
411
|
+
this._revealTimeouts.push(setTimeout(() => {
|
|
412
|
+
this._findInput.validate();
|
|
413
|
+
}, 200));
|
|
414
|
+
this._codeEditor.layoutOverlayWidget(this);
|
|
415
|
+
let adjustEditorScrollTop = true;
|
|
416
|
+
if (this._codeEditor.getOption(50 /* EditorOption.find */).seedSearchStringFromSelection && selection) {
|
|
417
|
+
const domNode = this._codeEditor.getDomNode();
|
|
418
|
+
if (domNode) {
|
|
419
|
+
const editorCoords = getDomNodePagePosition(domNode);
|
|
420
|
+
const startCoords = this._codeEditor.getScrolledVisiblePosition(selection.getStartPosition());
|
|
421
|
+
const startLeft = editorCoords.left + (startCoords ? startCoords.left : 0);
|
|
422
|
+
const startTop = startCoords ? startCoords.top : 0;
|
|
423
|
+
if (this._viewZone && startTop < this._viewZone.heightInPx) {
|
|
424
|
+
if (selection.endLineNumber > selection.startLineNumber) {
|
|
425
|
+
adjustEditorScrollTop = false;
|
|
426
|
+
}
|
|
427
|
+
const leftOfFindWidget = getTopLeftOffset(this._domNode).left;
|
|
428
|
+
if (startLeft > leftOfFindWidget) {
|
|
429
|
+
adjustEditorScrollTop = false;
|
|
430
|
+
}
|
|
431
|
+
const endCoords = this._codeEditor.getScrolledVisiblePosition(selection.getEndPosition());
|
|
432
|
+
const endLeft = editorCoords.left + (endCoords ? endCoords.left : 0);
|
|
433
|
+
if (endLeft > leftOfFindWidget) {
|
|
434
|
+
adjustEditorScrollTop = false;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
this._showViewZone(adjustEditorScrollTop);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
_hide(focusTheEditor) {
|
|
443
|
+
this._revealTimeouts.forEach(e => {
|
|
444
|
+
clearTimeout(e);
|
|
445
|
+
});
|
|
446
|
+
this._revealTimeouts = [];
|
|
447
|
+
if (this._isVisible) {
|
|
448
|
+
this._isVisible = false;
|
|
449
|
+
this._updateButtons();
|
|
450
|
+
this._domNode.classList.remove('visible');
|
|
451
|
+
this._domNode.setAttribute('aria-hidden', 'true');
|
|
452
|
+
this._findInput.clearMessage();
|
|
453
|
+
if (focusTheEditor) {
|
|
454
|
+
this._codeEditor.focus();
|
|
455
|
+
}
|
|
456
|
+
this._codeEditor.layoutOverlayWidget(this);
|
|
457
|
+
this._removeViewZone();
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
_layoutViewZone(targetScrollTop) {
|
|
461
|
+
const addExtraSpaceOnTop = this._codeEditor.getOption(50 /* EditorOption.find */).addExtraSpaceOnTop;
|
|
462
|
+
if (!addExtraSpaceOnTop) {
|
|
463
|
+
this._removeViewZone();
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
if (!this._isVisible) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
const viewZone = this._viewZone;
|
|
470
|
+
if (this._viewZoneId !== undefined || !viewZone) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
this._codeEditor.changeViewZones((accessor) => {
|
|
474
|
+
viewZone.heightInPx = this._getHeight();
|
|
475
|
+
this._viewZoneId = accessor.addZone(viewZone);
|
|
476
|
+
// scroll top adjust to make sure the editor doesn't scroll when adding viewzone at the beginning.
|
|
477
|
+
this._codeEditor.setScrollTop(targetScrollTop || this._codeEditor.getScrollTop() + viewZone.heightInPx);
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
_showViewZone(adjustScroll = true) {
|
|
481
|
+
if (!this._isVisible) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const addExtraSpaceOnTop = this._codeEditor.getOption(50 /* EditorOption.find */).addExtraSpaceOnTop;
|
|
485
|
+
if (!addExtraSpaceOnTop) {
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
if (this._viewZone === undefined) {
|
|
489
|
+
this._viewZone = new FindWidgetViewZone(0);
|
|
490
|
+
}
|
|
491
|
+
const viewZone = this._viewZone;
|
|
492
|
+
this._codeEditor.changeViewZones((accessor) => {
|
|
493
|
+
if (this._viewZoneId !== undefined) {
|
|
494
|
+
// the view zone already exists, we need to update the height
|
|
495
|
+
const newHeight = this._getHeight();
|
|
496
|
+
if (newHeight === viewZone.heightInPx) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
const scrollAdjustment = newHeight - viewZone.heightInPx;
|
|
500
|
+
viewZone.heightInPx = newHeight;
|
|
501
|
+
accessor.layoutZone(this._viewZoneId);
|
|
502
|
+
if (adjustScroll) {
|
|
503
|
+
this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment);
|
|
504
|
+
}
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
let scrollAdjustment = this._getHeight();
|
|
509
|
+
// if the editor has top padding, factor that into the zone height
|
|
510
|
+
scrollAdjustment -= this._codeEditor.getOption(96 /* EditorOption.padding */).top;
|
|
511
|
+
if (scrollAdjustment <= 0) {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
viewZone.heightInPx = scrollAdjustment;
|
|
515
|
+
this._viewZoneId = accessor.addZone(viewZone);
|
|
516
|
+
if (adjustScroll) {
|
|
517
|
+
this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
_removeViewZone() {
|
|
523
|
+
this._codeEditor.changeViewZones((accessor) => {
|
|
524
|
+
if (this._viewZoneId !== undefined) {
|
|
525
|
+
accessor.removeZone(this._viewZoneId);
|
|
526
|
+
this._viewZoneId = undefined;
|
|
527
|
+
if (this._viewZone) {
|
|
528
|
+
this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() - this._viewZone.heightInPx);
|
|
529
|
+
this._viewZone = undefined;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
_tryUpdateWidgetWidth() {
|
|
535
|
+
if (!this._isVisible) {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
if (!this._domNode.isConnected) {
|
|
539
|
+
// the widget is not in the DOM
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
const layoutInfo = this._codeEditor.getLayoutInfo();
|
|
543
|
+
const editorContentWidth = layoutInfo.contentWidth;
|
|
544
|
+
if (editorContentWidth <= 0) {
|
|
545
|
+
// for example, diff view original editor
|
|
546
|
+
this._domNode.classList.add('hiddenEditor');
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
else if (this._domNode.classList.contains('hiddenEditor')) {
|
|
550
|
+
this._domNode.classList.remove('hiddenEditor');
|
|
551
|
+
}
|
|
552
|
+
const editorWidth = layoutInfo.width;
|
|
553
|
+
const minimapWidth = layoutInfo.minimap.minimapWidth;
|
|
554
|
+
let collapsedFindWidget = false;
|
|
555
|
+
let reducedFindWidget = false;
|
|
556
|
+
let narrowFindWidget = false;
|
|
557
|
+
if (this._resized) {
|
|
558
|
+
const widgetWidth = getTotalWidth(this._domNode);
|
|
559
|
+
if (widgetWidth > FIND_WIDGET_INITIAL_WIDTH) {
|
|
560
|
+
// as the widget is resized by users, we may need to change the max width of the widget as the editor width changes.
|
|
561
|
+
this._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`;
|
|
562
|
+
this._replaceInput.width = getTotalWidth(this._findInput.domNode);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth >= editorWidth) {
|
|
567
|
+
reducedFindWidget = true;
|
|
568
|
+
}
|
|
569
|
+
if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth) {
|
|
570
|
+
narrowFindWidget = true;
|
|
571
|
+
}
|
|
572
|
+
if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth + 50) {
|
|
573
|
+
collapsedFindWidget = true;
|
|
574
|
+
}
|
|
575
|
+
this._domNode.classList.toggle('collapsed-find-widget', collapsedFindWidget);
|
|
576
|
+
this._domNode.classList.toggle('narrow-find-widget', narrowFindWidget);
|
|
577
|
+
this._domNode.classList.toggle('reduced-find-widget', reducedFindWidget);
|
|
578
|
+
if (!narrowFindWidget && !collapsedFindWidget) {
|
|
579
|
+
// the minimal left offset of findwidget is 15px.
|
|
580
|
+
this._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`;
|
|
581
|
+
}
|
|
582
|
+
this._findInput.layout({ collapsedFindWidget, narrowFindWidget, reducedFindWidget });
|
|
583
|
+
if (this._resized) {
|
|
584
|
+
const findInputWidth = this._findInput.inputBox.element.clientWidth;
|
|
585
|
+
if (findInputWidth > 0) {
|
|
586
|
+
this._replaceInput.width = findInputWidth;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
else if (this._isReplaceVisible) {
|
|
590
|
+
this._replaceInput.width = getTotalWidth(this._findInput.domNode);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
_getHeight() {
|
|
594
|
+
let totalheight = 0;
|
|
595
|
+
// find input margin top
|
|
596
|
+
totalheight += 4;
|
|
597
|
+
// find input height
|
|
598
|
+
totalheight += this._findInput.inputBox.height + 2 /** input box border */;
|
|
599
|
+
if (this._isReplaceVisible) {
|
|
600
|
+
// replace input margin
|
|
601
|
+
totalheight += 4;
|
|
602
|
+
totalheight += this._replaceInput.inputBox.height + 2 /** input box border */;
|
|
603
|
+
}
|
|
604
|
+
// margin bottom
|
|
605
|
+
totalheight += 4;
|
|
606
|
+
return totalheight;
|
|
607
|
+
}
|
|
608
|
+
_tryUpdateHeight() {
|
|
609
|
+
const totalHeight = this._getHeight();
|
|
610
|
+
if (this._cachedHeight !== null && this._cachedHeight === totalHeight) {
|
|
611
|
+
return false;
|
|
612
|
+
}
|
|
613
|
+
this._cachedHeight = totalHeight;
|
|
614
|
+
this._domNode.style.height = `${totalHeight}px`;
|
|
615
|
+
return true;
|
|
616
|
+
}
|
|
617
|
+
// ----- Public
|
|
618
|
+
focusFindInput() {
|
|
619
|
+
this._findInput.select();
|
|
620
|
+
// Edge browser requires focus() in addition to select()
|
|
621
|
+
this._findInput.focus();
|
|
622
|
+
}
|
|
623
|
+
focusReplaceInput() {
|
|
624
|
+
this._replaceInput.select();
|
|
625
|
+
// Edge browser requires focus() in addition to select()
|
|
626
|
+
this._replaceInput.focus();
|
|
627
|
+
}
|
|
628
|
+
highlightFindOptions() {
|
|
629
|
+
this._findInput.highlightFindOptions();
|
|
630
|
+
}
|
|
631
|
+
_updateSearchScope() {
|
|
632
|
+
if (!this._codeEditor.hasModel()) {
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
if (this._toggleSelectionFind.checked) {
|
|
636
|
+
const selections = this._codeEditor.getSelections();
|
|
637
|
+
selections.map(selection => {
|
|
638
|
+
if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {
|
|
639
|
+
selection = selection.setEndPosition(selection.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(selection.endLineNumber - 1));
|
|
640
|
+
}
|
|
641
|
+
const currentMatch = this._state.currentMatch;
|
|
642
|
+
if (selection.startLineNumber !== selection.endLineNumber) {
|
|
643
|
+
if (!Range.equalsRange(selection, currentMatch)) {
|
|
644
|
+
return selection;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
return null;
|
|
648
|
+
}).filter(element => !!element);
|
|
649
|
+
if (selections.length) {
|
|
650
|
+
this._state.change({ searchScope: selections }, true);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
_onFindInputMouseDown(e) {
|
|
655
|
+
// on linux, middle key does pasting.
|
|
656
|
+
if (e.middleButton) {
|
|
657
|
+
e.stopPropagation();
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
_onFindInputKeyDown(e) {
|
|
661
|
+
if (e.equals(ctrlKeyMod | 3 /* KeyCode.Enter */)) {
|
|
662
|
+
if (this._keybindingService.dispatchEvent(e, e.target)) {
|
|
663
|
+
e.preventDefault();
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
this._findInput.inputBox.insertAtCursor('\n');
|
|
668
|
+
e.preventDefault();
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (e.equals(2 /* KeyCode.Tab */)) {
|
|
673
|
+
if (this._isReplaceVisible) {
|
|
674
|
+
this._replaceInput.focus();
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
this._findInput.focusOnCaseSensitive();
|
|
678
|
+
}
|
|
679
|
+
e.preventDefault();
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
if (e.equals(2048 /* KeyMod.CtrlCmd */ | 18 /* KeyCode.DownArrow */)) {
|
|
683
|
+
this._codeEditor.focus();
|
|
684
|
+
e.preventDefault();
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
if (e.equals(16 /* KeyCode.UpArrow */)) {
|
|
688
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
689
|
+
return stopPropagationForMultiLineUpwards(e, this._findInput.getValue(), this._findInput.domNode.querySelector('textarea'));
|
|
690
|
+
}
|
|
691
|
+
if (e.equals(18 /* KeyCode.DownArrow */)) {
|
|
692
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
693
|
+
return stopPropagationForMultiLineDownwards(e, this._findInput.getValue(), this._findInput.domNode.querySelector('textarea'));
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
_onReplaceInputKeyDown(e) {
|
|
697
|
+
if (e.equals(ctrlKeyMod | 3 /* KeyCode.Enter */)) {
|
|
698
|
+
if (this._keybindingService.dispatchEvent(e, e.target)) {
|
|
699
|
+
e.preventDefault();
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
this._replaceInput.inputBox.insertAtCursor('\n');
|
|
704
|
+
e.preventDefault();
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
if (e.equals(2 /* KeyCode.Tab */)) {
|
|
709
|
+
this._findInput.focusOnCaseSensitive();
|
|
710
|
+
e.preventDefault();
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
if (e.equals(1024 /* KeyMod.Shift */ | 2 /* KeyCode.Tab */)) {
|
|
714
|
+
this._findInput.focus();
|
|
715
|
+
e.preventDefault();
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
if (e.equals(2048 /* KeyMod.CtrlCmd */ | 18 /* KeyCode.DownArrow */)) {
|
|
719
|
+
this._codeEditor.focus();
|
|
720
|
+
e.preventDefault();
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
if (e.equals(16 /* KeyCode.UpArrow */)) {
|
|
724
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
725
|
+
return stopPropagationForMultiLineUpwards(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector('textarea'));
|
|
726
|
+
}
|
|
727
|
+
if (e.equals(18 /* KeyCode.DownArrow */)) {
|
|
728
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
729
|
+
return stopPropagationForMultiLineDownwards(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector('textarea'));
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
// ----- sash
|
|
733
|
+
getVerticalSashLeft(_sash) {
|
|
734
|
+
return 0;
|
|
735
|
+
}
|
|
736
|
+
// ----- initialization
|
|
737
|
+
_keybindingLabelFor(actionId) {
|
|
738
|
+
const kb = this._keybindingService.lookupKeybinding(actionId);
|
|
739
|
+
if (!kb) {
|
|
740
|
+
return '';
|
|
741
|
+
}
|
|
742
|
+
return ` (${kb.getLabel()})`;
|
|
743
|
+
}
|
|
744
|
+
_buildDomNode() {
|
|
745
|
+
const flexibleHeight = true;
|
|
746
|
+
const flexibleWidth = true;
|
|
747
|
+
// Find input
|
|
748
|
+
const findSearchHistoryConfig = this._codeEditor.getOption(50 /* EditorOption.find */).history;
|
|
749
|
+
const replaceHistoryConfig = this._codeEditor.getOption(50 /* EditorOption.find */).replaceHistory;
|
|
750
|
+
this._findInput = this._register(new ContextScopedFindInput(null, this._contextViewProvider, {
|
|
751
|
+
width: FIND_INPUT_AREA_WIDTH,
|
|
752
|
+
label: NLS_FIND_INPUT_LABEL,
|
|
753
|
+
placeholder: NLS_FIND_INPUT_PLACEHOLDER,
|
|
754
|
+
appendCaseSensitiveLabel: this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand),
|
|
755
|
+
appendWholeWordsLabel: this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand),
|
|
756
|
+
appendRegexLabel: this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand),
|
|
757
|
+
validation: (value) => {
|
|
758
|
+
if (value.length === 0 || !this._findInput.getRegex()) {
|
|
759
|
+
return null;
|
|
760
|
+
}
|
|
761
|
+
try {
|
|
762
|
+
// use `g` and `u` which are also used by the TextModel search
|
|
763
|
+
new RegExp(value, 'gu');
|
|
764
|
+
return null;
|
|
765
|
+
}
|
|
766
|
+
catch (e) {
|
|
767
|
+
return { content: e.message };
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
flexibleHeight,
|
|
771
|
+
flexibleWidth,
|
|
772
|
+
flexibleMaxHeight: 118,
|
|
773
|
+
showCommonFindToggles: true,
|
|
774
|
+
showHistoryHint: () => showHistoryKeybindingHint(this._keybindingService),
|
|
775
|
+
inputBoxStyles: defaultInputBoxStyles,
|
|
776
|
+
toggleStyles: defaultToggleStyles,
|
|
777
|
+
history: findSearchHistoryConfig === 'workspace' ? this._findWidgetSearchHistory : new Set([]),
|
|
778
|
+
}, this._contextKeyService));
|
|
779
|
+
this._findInput.setRegex(!!this._state.isRegex);
|
|
780
|
+
this._findInput.setCaseSensitive(!!this._state.matchCase);
|
|
781
|
+
this._findInput.setWholeWords(!!this._state.wholeWord);
|
|
782
|
+
this._register(this._findInput.onKeyDown((e) => {
|
|
783
|
+
if (e.equals(3 /* KeyCode.Enter */) && !this._codeEditor.getOption(50 /* EditorOption.find */).findOnType) {
|
|
784
|
+
this._state.change({ searchString: this._findInput.getValue() }, true);
|
|
785
|
+
}
|
|
786
|
+
this._onFindInputKeyDown(e);
|
|
787
|
+
}));
|
|
788
|
+
this._register(this._findInput.inputBox.onDidChange(() => {
|
|
789
|
+
if (this._ignoreChangeEvent || !this._codeEditor.getOption(50 /* EditorOption.find */).findOnType) {
|
|
790
|
+
return;
|
|
791
|
+
}
|
|
792
|
+
this._state.change({ searchString: this._findInput.getValue() }, true);
|
|
793
|
+
}));
|
|
794
|
+
this._register(this._findInput.onDidOptionChange(() => {
|
|
795
|
+
this._state.change({
|
|
796
|
+
isRegex: this._findInput.getRegex(),
|
|
797
|
+
wholeWord: this._findInput.getWholeWords(),
|
|
798
|
+
matchCase: this._findInput.getCaseSensitive()
|
|
799
|
+
}, true);
|
|
800
|
+
}));
|
|
801
|
+
this._register(this._findInput.onCaseSensitiveKeyDown((e) => {
|
|
802
|
+
if (e.equals(1024 /* KeyMod.Shift */ | 2 /* KeyCode.Tab */)) {
|
|
803
|
+
if (this._isReplaceVisible) {
|
|
804
|
+
this._replaceInput.focus();
|
|
805
|
+
e.preventDefault();
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}));
|
|
809
|
+
this._register(this._findInput.onRegexKeyDown((e) => {
|
|
810
|
+
if (e.equals(2 /* KeyCode.Tab */)) {
|
|
811
|
+
if (this._isReplaceVisible) {
|
|
812
|
+
this._replaceInput.focusOnPreserve();
|
|
813
|
+
e.preventDefault();
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}));
|
|
817
|
+
this._register(this._findInput.inputBox.onDidHeightChange((e) => {
|
|
818
|
+
if (this._tryUpdateHeight()) {
|
|
819
|
+
this._showViewZone();
|
|
820
|
+
}
|
|
821
|
+
}));
|
|
822
|
+
if (isLinux) {
|
|
823
|
+
this._register(this._findInput.onMouseDown((e) => this._onFindInputMouseDown(e)));
|
|
824
|
+
}
|
|
825
|
+
this._matchesCount = document.createElement('div');
|
|
826
|
+
this._matchesCount.className = 'matchesCount';
|
|
827
|
+
this._updateMatchesCount();
|
|
828
|
+
const hoverLifecycleOptions = { groupId: 'find-widget' };
|
|
829
|
+
// Previous button
|
|
830
|
+
this._prevBtn = this._register(new SimpleButton({
|
|
831
|
+
label: NLS_PREVIOUS_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.PreviousMatchFindAction),
|
|
832
|
+
icon: findPreviousMatchIcon,
|
|
833
|
+
hoverLifecycleOptions,
|
|
834
|
+
onTrigger: () => {
|
|
835
|
+
assertReturnsDefined(this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction)).run().then(undefined, onUnexpectedError);
|
|
836
|
+
}
|
|
837
|
+
}, this._hoverService));
|
|
838
|
+
// Next button
|
|
839
|
+
this._nextBtn = this._register(new SimpleButton({
|
|
840
|
+
label: NLS_NEXT_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.NextMatchFindAction),
|
|
841
|
+
icon: findNextMatchIcon,
|
|
842
|
+
hoverLifecycleOptions,
|
|
843
|
+
onTrigger: () => {
|
|
844
|
+
assertReturnsDefined(this._codeEditor.getAction(FIND_IDS.NextMatchFindAction)).run().then(undefined, onUnexpectedError);
|
|
845
|
+
}
|
|
846
|
+
}, this._hoverService));
|
|
847
|
+
const findPart = document.createElement('div');
|
|
848
|
+
findPart.className = 'find-part';
|
|
849
|
+
findPart.appendChild(this._findInput.domNode);
|
|
850
|
+
const actionsContainer = document.createElement('div');
|
|
851
|
+
actionsContainer.className = 'find-actions';
|
|
852
|
+
findPart.appendChild(actionsContainer);
|
|
853
|
+
actionsContainer.appendChild(this._matchesCount);
|
|
854
|
+
actionsContainer.appendChild(this._prevBtn.domNode);
|
|
855
|
+
actionsContainer.appendChild(this._nextBtn.domNode);
|
|
856
|
+
// Toggle selection button
|
|
857
|
+
this._toggleSelectionFind = this._register(new Toggle({
|
|
858
|
+
icon: findSelectionIcon,
|
|
859
|
+
title: NLS_TOGGLE_SELECTION_FIND_TITLE + this._keybindingLabelFor(FIND_IDS.ToggleSearchScopeCommand),
|
|
860
|
+
isChecked: false,
|
|
861
|
+
hoverLifecycleOptions,
|
|
862
|
+
inputActiveOptionBackground: asCssVariable(inputActiveOptionBackground),
|
|
863
|
+
inputActiveOptionBorder: asCssVariable(inputActiveOptionBorder),
|
|
864
|
+
inputActiveOptionForeground: asCssVariable(inputActiveOptionForeground),
|
|
865
|
+
}));
|
|
866
|
+
this._register(this._toggleSelectionFind.onChange(() => {
|
|
867
|
+
if (this._toggleSelectionFind.checked) {
|
|
868
|
+
if (this._codeEditor.hasModel()) {
|
|
869
|
+
let selections = this._codeEditor.getSelections();
|
|
870
|
+
selections = selections.map(selection => {
|
|
871
|
+
if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {
|
|
872
|
+
selection = selection.setEndPosition(selection.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(selection.endLineNumber - 1));
|
|
873
|
+
}
|
|
874
|
+
if (!selection.isEmpty()) {
|
|
875
|
+
return selection;
|
|
876
|
+
}
|
|
877
|
+
return null;
|
|
878
|
+
}).filter((element) => !!element);
|
|
879
|
+
if (selections.length) {
|
|
880
|
+
this._state.change({ searchScope: selections }, true);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
this._state.change({ searchScope: null }, true);
|
|
886
|
+
}
|
|
887
|
+
}));
|
|
888
|
+
actionsContainer.appendChild(this._toggleSelectionFind.domNode);
|
|
889
|
+
// Close button
|
|
890
|
+
this._closeBtn = this._register(new SimpleButton({
|
|
891
|
+
label: NLS_CLOSE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.CloseFindWidgetCommand),
|
|
892
|
+
icon: widgetClose,
|
|
893
|
+
hoverLifecycleOptions,
|
|
894
|
+
onTrigger: () => {
|
|
895
|
+
this._state.change({ isRevealed: false, searchScope: null }, false);
|
|
896
|
+
},
|
|
897
|
+
onKeyDown: (e) => {
|
|
898
|
+
if (e.equals(2 /* KeyCode.Tab */)) {
|
|
899
|
+
if (this._isReplaceVisible) {
|
|
900
|
+
if (this._replaceBtn.isEnabled()) {
|
|
901
|
+
this._replaceBtn.focus();
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
this._codeEditor.focus();
|
|
905
|
+
}
|
|
906
|
+
e.preventDefault();
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}, this._hoverService));
|
|
911
|
+
// Replace input
|
|
912
|
+
this._replaceInput = this._register(new ContextScopedReplaceInput(null, undefined, {
|
|
913
|
+
label: NLS_REPLACE_INPUT_LABEL,
|
|
914
|
+
placeholder: NLS_REPLACE_INPUT_PLACEHOLDER,
|
|
915
|
+
appendPreserveCaseLabel: this._keybindingLabelFor(FIND_IDS.TogglePreserveCaseCommand),
|
|
916
|
+
history: replaceHistoryConfig === 'workspace' ? this._replaceWidgetHistory : new Set([]),
|
|
917
|
+
flexibleHeight,
|
|
918
|
+
flexibleWidth,
|
|
919
|
+
flexibleMaxHeight: 118,
|
|
920
|
+
showHistoryHint: () => showHistoryKeybindingHint(this._keybindingService),
|
|
921
|
+
inputBoxStyles: defaultInputBoxStyles,
|
|
922
|
+
toggleStyles: defaultToggleStyles,
|
|
923
|
+
hoverLifecycleOptions,
|
|
924
|
+
}, this._contextKeyService, true));
|
|
925
|
+
this._replaceInput.setPreserveCase(!!this._state.preserveCase);
|
|
926
|
+
this._register(this._replaceInput.onKeyDown((e) => this._onReplaceInputKeyDown(e)));
|
|
927
|
+
this._register(this._replaceInput.inputBox.onDidChange(() => {
|
|
928
|
+
this._state.change({ replaceString: this._replaceInput.inputBox.value }, false);
|
|
929
|
+
}));
|
|
930
|
+
this._register(this._replaceInput.inputBox.onDidHeightChange((e) => {
|
|
931
|
+
if (this._isReplaceVisible && this._tryUpdateHeight()) {
|
|
932
|
+
this._showViewZone();
|
|
933
|
+
}
|
|
934
|
+
}));
|
|
935
|
+
this._register(this._replaceInput.onDidOptionChange(() => {
|
|
936
|
+
this._state.change({
|
|
937
|
+
preserveCase: this._replaceInput.getPreserveCase()
|
|
938
|
+
}, true);
|
|
939
|
+
}));
|
|
940
|
+
this._register(this._replaceInput.onPreserveCaseKeyDown((e) => {
|
|
941
|
+
if (e.equals(2 /* KeyCode.Tab */)) {
|
|
942
|
+
if (this._prevBtn.isEnabled()) {
|
|
943
|
+
this._prevBtn.focus();
|
|
944
|
+
}
|
|
945
|
+
else if (this._nextBtn.isEnabled()) {
|
|
946
|
+
this._nextBtn.focus();
|
|
947
|
+
}
|
|
948
|
+
else if (this._toggleSelectionFind.enabled) {
|
|
949
|
+
this._toggleSelectionFind.focus();
|
|
950
|
+
}
|
|
951
|
+
else if (this._closeBtn.isEnabled()) {
|
|
952
|
+
this._closeBtn.focus();
|
|
953
|
+
}
|
|
954
|
+
e.preventDefault();
|
|
955
|
+
}
|
|
956
|
+
}));
|
|
957
|
+
// Replace one button
|
|
958
|
+
this._replaceBtn = this._register(new SimpleButton({
|
|
959
|
+
label: NLS_REPLACE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.ReplaceOneAction),
|
|
960
|
+
icon: findReplaceIcon,
|
|
961
|
+
hoverLifecycleOptions,
|
|
962
|
+
onTrigger: () => {
|
|
963
|
+
this._controller.replace();
|
|
964
|
+
},
|
|
965
|
+
onKeyDown: (e) => {
|
|
966
|
+
if (e.equals(1024 /* KeyMod.Shift */ | 2 /* KeyCode.Tab */)) {
|
|
967
|
+
this._closeBtn.focus();
|
|
968
|
+
e.preventDefault();
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}, this._hoverService));
|
|
972
|
+
// Replace all button
|
|
973
|
+
this._replaceAllBtn = this._register(new SimpleButton({
|
|
974
|
+
label: NLS_REPLACE_ALL_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.ReplaceAllAction),
|
|
975
|
+
icon: findReplaceAllIcon,
|
|
976
|
+
hoverLifecycleOptions,
|
|
977
|
+
onTrigger: () => {
|
|
978
|
+
this._controller.replaceAll();
|
|
979
|
+
}
|
|
980
|
+
}, this._hoverService));
|
|
981
|
+
const replacePart = document.createElement('div');
|
|
982
|
+
replacePart.className = 'replace-part';
|
|
983
|
+
replacePart.appendChild(this._replaceInput.domNode);
|
|
984
|
+
const replaceActionsContainer = document.createElement('div');
|
|
985
|
+
replaceActionsContainer.className = 'replace-actions';
|
|
986
|
+
replacePart.appendChild(replaceActionsContainer);
|
|
987
|
+
replaceActionsContainer.appendChild(this._replaceBtn.domNode);
|
|
988
|
+
replaceActionsContainer.appendChild(this._replaceAllBtn.domNode);
|
|
989
|
+
// Toggle replace button
|
|
990
|
+
this._toggleReplaceBtn = this._register(new SimpleButton({
|
|
991
|
+
label: NLS_TOGGLE_REPLACE_MODE_BTN_LABEL,
|
|
992
|
+
className: 'codicon toggle left',
|
|
993
|
+
onTrigger: () => {
|
|
994
|
+
this._state.change({ isReplaceRevealed: !this._isReplaceVisible }, false);
|
|
995
|
+
if (this._isReplaceVisible) {
|
|
996
|
+
this._replaceInput.width = getTotalWidth(this._findInput.domNode);
|
|
997
|
+
this._replaceInput.inputBox.layout();
|
|
998
|
+
}
|
|
999
|
+
this._showViewZone();
|
|
1000
|
+
}
|
|
1001
|
+
}, this._hoverService));
|
|
1002
|
+
this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);
|
|
1003
|
+
// Widget
|
|
1004
|
+
this._domNode = document.createElement('div');
|
|
1005
|
+
this._domNode.className = 'editor-widget find-widget';
|
|
1006
|
+
this._domNode.setAttribute('aria-hidden', 'true');
|
|
1007
|
+
this._domNode.ariaLabel = NLS_FIND_DIALOG_LABEL;
|
|
1008
|
+
this._domNode.role = 'dialog';
|
|
1009
|
+
// We need to set this explicitly, otherwise on IE11, the width inheritence of flex doesn't work.
|
|
1010
|
+
this._domNode.style.width = `${FIND_WIDGET_INITIAL_WIDTH}px`;
|
|
1011
|
+
this._domNode.appendChild(this._toggleReplaceBtn.domNode);
|
|
1012
|
+
this._domNode.appendChild(findPart);
|
|
1013
|
+
this._domNode.appendChild(this._closeBtn.domNode);
|
|
1014
|
+
this._domNode.appendChild(replacePart);
|
|
1015
|
+
this._resizeSash = this._register(new Sash(this._domNode, this, { orientation: 0 /* Orientation.VERTICAL */, size: 2 }));
|
|
1016
|
+
this._resized = false;
|
|
1017
|
+
let originalWidth = FIND_WIDGET_INITIAL_WIDTH;
|
|
1018
|
+
this._register(this._resizeSash.onDidStart(() => {
|
|
1019
|
+
originalWidth = getTotalWidth(this._domNode);
|
|
1020
|
+
}));
|
|
1021
|
+
this._register(this._resizeSash.onDidChange((evt) => {
|
|
1022
|
+
this._resized = true;
|
|
1023
|
+
const width = originalWidth + evt.startX - evt.currentX;
|
|
1024
|
+
if (width < FIND_WIDGET_INITIAL_WIDTH) {
|
|
1025
|
+
// narrow down the find widget should be handled by CSS.
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
const maxWidth = parseFloat(getComputedStyle(this._domNode).maxWidth) || 0;
|
|
1029
|
+
if (width > maxWidth) {
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
this._domNode.style.width = `${width}px`;
|
|
1033
|
+
if (this._isReplaceVisible) {
|
|
1034
|
+
this._replaceInput.width = getTotalWidth(this._findInput.domNode);
|
|
1035
|
+
}
|
|
1036
|
+
this._findInput.inputBox.layout();
|
|
1037
|
+
this._tryUpdateHeight();
|
|
1038
|
+
}));
|
|
1039
|
+
this._register(this._resizeSash.onDidReset(() => {
|
|
1040
|
+
// users double click on the sash
|
|
1041
|
+
const currentWidth = getTotalWidth(this._domNode);
|
|
1042
|
+
if (currentWidth < FIND_WIDGET_INITIAL_WIDTH) {
|
|
1043
|
+
// The editor is narrow and the width of the find widget is controlled fully by CSS.
|
|
1044
|
+
return;
|
|
1045
|
+
}
|
|
1046
|
+
let width = FIND_WIDGET_INITIAL_WIDTH;
|
|
1047
|
+
if (!this._resized || currentWidth === FIND_WIDGET_INITIAL_WIDTH) {
|
|
1048
|
+
// 1. never resized before, double click should maximizes it
|
|
1049
|
+
// 2. users resized it already but its width is the same as default
|
|
1050
|
+
const layoutInfo = this._codeEditor.getLayoutInfo();
|
|
1051
|
+
width = layoutInfo.width - 28 - layoutInfo.minimap.minimapWidth - 15;
|
|
1052
|
+
this._resized = true;
|
|
1053
|
+
}
|
|
1054
|
+
this._domNode.style.width = `${width}px`;
|
|
1055
|
+
if (this._isReplaceVisible) {
|
|
1056
|
+
this._replaceInput.width = getTotalWidth(this._findInput.domNode);
|
|
1057
|
+
}
|
|
1058
|
+
this._findInput.inputBox.layout();
|
|
1059
|
+
}));
|
|
1060
|
+
}
|
|
1061
|
+
updateAccessibilitySupport() {
|
|
1062
|
+
const value = this._codeEditor.getOption(2 /* EditorOption.accessibilitySupport */);
|
|
1063
|
+
this._findInput.setFocusInputOnOptionClick(value !== 2 /* AccessibilitySupport.Enabled */);
|
|
1064
|
+
}
|
|
1065
|
+
getViewState() {
|
|
1066
|
+
let widgetViewZoneVisible = false;
|
|
1067
|
+
if (this._viewZone && this._viewZoneId) {
|
|
1068
|
+
widgetViewZoneVisible = this._viewZone.heightInPx > this._codeEditor.getScrollTop();
|
|
1069
|
+
}
|
|
1070
|
+
return {
|
|
1071
|
+
widgetViewZoneVisible,
|
|
1072
|
+
scrollTop: this._codeEditor.getScrollTop()
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
setViewState(state) {
|
|
1076
|
+
if (!state) {
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
if (state.widgetViewZoneVisible) {
|
|
1080
|
+
// we should add the view zone
|
|
1081
|
+
this._layoutViewZone(state.scrollTop);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
class SimpleButton extends Widget {
|
|
1086
|
+
constructor(opts, hoverService) {
|
|
1087
|
+
super();
|
|
1088
|
+
this._opts = opts;
|
|
1089
|
+
let className = 'button';
|
|
1090
|
+
if (this._opts.className) {
|
|
1091
|
+
className = className + ' ' + this._opts.className;
|
|
1092
|
+
}
|
|
1093
|
+
if (this._opts.icon) {
|
|
1094
|
+
className = className + ' ' + ThemeIcon.asClassName(this._opts.icon);
|
|
1095
|
+
}
|
|
1096
|
+
this._domNode = document.createElement('div');
|
|
1097
|
+
this._domNode.tabIndex = 0;
|
|
1098
|
+
this._domNode.className = className;
|
|
1099
|
+
this._domNode.setAttribute('role', 'button');
|
|
1100
|
+
this._domNode.setAttribute('aria-label', this._opts.label);
|
|
1101
|
+
this._register(hoverService.setupDelayedHover(this._domNode, {
|
|
1102
|
+
content: this._opts.label,
|
|
1103
|
+
style: 1 /* HoverStyle.Pointer */,
|
|
1104
|
+
}, opts.hoverLifecycleOptions));
|
|
1105
|
+
this.onclick(this._domNode, (e) => {
|
|
1106
|
+
this._opts.onTrigger();
|
|
1107
|
+
e.preventDefault();
|
|
1108
|
+
});
|
|
1109
|
+
this.onkeydown(this._domNode, (e) => {
|
|
1110
|
+
if (e.equals(10 /* KeyCode.Space */) || e.equals(3 /* KeyCode.Enter */)) {
|
|
1111
|
+
this._opts.onTrigger();
|
|
1112
|
+
e.preventDefault();
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
this._opts.onKeyDown?.(e);
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
get domNode() {
|
|
1119
|
+
return this._domNode;
|
|
1120
|
+
}
|
|
1121
|
+
isEnabled() {
|
|
1122
|
+
return (this._domNode.tabIndex >= 0);
|
|
1123
|
+
}
|
|
1124
|
+
focus() {
|
|
1125
|
+
this._domNode.focus();
|
|
1126
|
+
}
|
|
1127
|
+
setEnabled(enabled) {
|
|
1128
|
+
this._domNode.classList.toggle('disabled', !enabled);
|
|
1129
|
+
this._domNode.setAttribute('aria-disabled', String(!enabled));
|
|
1130
|
+
this._domNode.tabIndex = enabled ? 0 : -1;
|
|
1131
|
+
}
|
|
1132
|
+
setExpanded(expanded) {
|
|
1133
|
+
this._domNode.setAttribute('aria-expanded', String(!!expanded));
|
|
1134
|
+
if (expanded) {
|
|
1135
|
+
this._domNode.classList.remove(...ThemeIcon.asClassNameArray(findCollapsedIcon));
|
|
1136
|
+
this._domNode.classList.add(...ThemeIcon.asClassNameArray(findExpandedIcon));
|
|
1137
|
+
}
|
|
1138
|
+
else {
|
|
1139
|
+
this._domNode.classList.remove(...ThemeIcon.asClassNameArray(findExpandedIcon));
|
|
1140
|
+
this._domNode.classList.add(...ThemeIcon.asClassNameArray(findCollapsedIcon));
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
// theming
|
|
1145
|
+
registerThemingParticipant((theme, collector) => {
|
|
1146
|
+
const findMatchHighlightBorder = theme.getColor(editorFindMatchHighlightBorder);
|
|
1147
|
+
if (findMatchHighlightBorder) {
|
|
1148
|
+
collector.addRule(`.monaco-editor .findMatch { border: 1px ${isHighContrast(theme.type) ? 'dotted' : 'solid'} ${findMatchHighlightBorder}; box-sizing: border-box; }`);
|
|
1149
|
+
}
|
|
1150
|
+
const findRangeHighlightBorder = theme.getColor(editorFindRangeHighlightBorder);
|
|
1151
|
+
if (findRangeHighlightBorder) {
|
|
1152
|
+
collector.addRule(`.monaco-editor .findScope { border: 1px ${isHighContrast(theme.type) ? 'dashed' : 'solid'} ${findRangeHighlightBorder}; }`);
|
|
1153
|
+
}
|
|
1154
|
+
const hcBorder = theme.getColor(contrastBorder);
|
|
1155
|
+
if (hcBorder) {
|
|
1156
|
+
collector.addRule(`.monaco-editor .find-widget { border: 1px solid ${hcBorder}; }`);
|
|
1157
|
+
}
|
|
1158
|
+
const findMatchForeground = theme.getColor(editorFindMatchForeground);
|
|
1159
|
+
if (findMatchForeground) {
|
|
1160
|
+
collector.addRule(`.monaco-editor .findMatchInline { color: ${findMatchForeground}; }`);
|
|
1161
|
+
}
|
|
1162
|
+
const findMatchHighlightForeground = theme.getColor(editorFindMatchHighlightForeground);
|
|
1163
|
+
if (findMatchHighlightForeground) {
|
|
1164
|
+
collector.addRule(`.monaco-editor .currentFindMatchInline { color: ${findMatchHighlightForeground}; }`);
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
|
|
1168
|
+
export { FindWidget, FindWidgetViewZone, NLS_MATCHES_LOCATION, NLS_NO_RESULTS, SimpleButton, findNextMatchIcon, findPreviousMatchIcon, findReplaceAllIcon, findReplaceIcon, findSelectionIcon };
|