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,1048 @@
|
|
|
1
|
+
import { mapFindFirst } from '../../../../../base/common/arraysFind.js';
|
|
2
|
+
import { itemsEquals } from '../../../../../base/common/equals.js';
|
|
3
|
+
import { BugIndicatingError, onUnexpectedExternalError } from '../../../../../base/common/errors.js';
|
|
4
|
+
import { Emitter } from '../../../../../base/common/event.js';
|
|
5
|
+
import { Disposable } from '../../../../../base/common/lifecycle.js';
|
|
6
|
+
import '../../../../../base/common/observableInternal/index.js';
|
|
7
|
+
import { firstNonWhitespaceIndex } from '../../../../../base/common/strings.js';
|
|
8
|
+
import { isDefined } from '../../../../../base/common/types.js';
|
|
9
|
+
import { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';
|
|
10
|
+
import { ICommandService } from '../../../../../platform/commands/common/commands.js';
|
|
11
|
+
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
12
|
+
import { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';
|
|
13
|
+
import { CursorColumns } from '../../../../common/core/cursorColumns.js';
|
|
14
|
+
import { LineRange } from '../../../../common/core/ranges/lineRange.js';
|
|
15
|
+
import { Position } from '../../../../common/core/position.js';
|
|
16
|
+
import { Range } from '../../../../common/core/range.js';
|
|
17
|
+
import { Selection } from '../../../../common/core/selection.js';
|
|
18
|
+
import { TextEdit, TextReplacement } from '../../../../common/core/edits/textEdit.js';
|
|
19
|
+
import { TextLength } from '../../../../common/core/text/textLength.js';
|
|
20
|
+
import { InlineCompletionTriggerKind, InlineCompletionEndOfLifeReasonKind } from '../../../../common/languages.js';
|
|
21
|
+
import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';
|
|
22
|
+
import { TextModelText } from '../../../../common/model/textModelText.js';
|
|
23
|
+
import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';
|
|
24
|
+
import { SnippetController2 } from '../../../snippet/browser/snippetController2.js';
|
|
25
|
+
import { removeTextReplacementCommonSuffixPrefix, getEndPositionsAfterApplying } from '../utils.js';
|
|
26
|
+
import { ObservableAnimatedValue, AnimatedValue, easeOutCubic } from './animation.js';
|
|
27
|
+
import { computeGhostText } from './computeGhostText.js';
|
|
28
|
+
import { GhostText, ghostTextsOrReplacementsEqual, ghostTextOrReplacementEquals } from './ghostText.js';
|
|
29
|
+
import { InlineCompletionsSource } from './inlineCompletionsSource.js';
|
|
30
|
+
import { InlineEdit } from './inlineEdit.js';
|
|
31
|
+
import { InlineCompletionEditorType } from './provideInlineCompletions.js';
|
|
32
|
+
import { singleTextRemoveCommonPrefix, singleTextEditAugments } from './singleTextEditHelpers.js';
|
|
33
|
+
import { EditSources } from '../../../../common/textModelEditSource.js';
|
|
34
|
+
import { ICodeEditorService } from '../../../../browser/services/codeEditorService.js';
|
|
35
|
+
import { IInlineCompletionsService } from '../../../../browser/services/inlineCompletionsService.js';
|
|
36
|
+
import { TypingInterval } from './typingSpeed.js';
|
|
37
|
+
import { StringReplacement } from '../../../../common/core/edits/stringEdit.js';
|
|
38
|
+
import { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';
|
|
39
|
+
import { URI } from '../../../../../base/common/uri.js';
|
|
40
|
+
import { derived, derivedHandleChanges, derivedOpts } from '../../../../../base/common/observableInternal/observables/derived.js';
|
|
41
|
+
import { recomputeInitiallyAndOnChange, mapObservableArrayCached } from '../../../../../base/common/observableInternal/utils/utils.js';
|
|
42
|
+
import { observableValue } from '../../../../../base/common/observableInternal/observables/observableValue.js';
|
|
43
|
+
import { observableSignal } from '../../../../../base/common/observableInternal/observables/observableSignal.js';
|
|
44
|
+
import { constObservable } from '../../../../../base/common/observableInternal/observables/constObservable.js';
|
|
45
|
+
import { autorun } from '../../../../../base/common/observableInternal/reactions/autorun.js';
|
|
46
|
+
import { observableFromEvent } from '../../../../../base/common/observableInternal/observables/observableFromEvent.js';
|
|
47
|
+
import { subtransaction, transaction } from '../../../../../base/common/observableInternal/transaction.js';
|
|
48
|
+
|
|
49
|
+
/*---------------------------------------------------------------------------------------------
|
|
50
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
51
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
52
|
+
*--------------------------------------------------------------------------------------------*/
|
|
53
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
54
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
55
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
56
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
57
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
58
|
+
};
|
|
59
|
+
var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
60
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
61
|
+
};
|
|
62
|
+
let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
63
|
+
get isAcceptingPartially() { return this._isAcceptingPartially; }
|
|
64
|
+
constructor(textModel, _selectedSuggestItem, _textModelVersionId, _positions, _debounceValue, _enabled, _editor, _instantiationService, _commandService, _languageConfigurationService, _accessibilityService, _languageFeaturesService, _codeEditorService, _inlineCompletionsService) {
|
|
65
|
+
super();
|
|
66
|
+
this.textModel = textModel;
|
|
67
|
+
this._selectedSuggestItem = _selectedSuggestItem;
|
|
68
|
+
this._textModelVersionId = _textModelVersionId;
|
|
69
|
+
this._positions = _positions;
|
|
70
|
+
this._debounceValue = _debounceValue;
|
|
71
|
+
this._enabled = _enabled;
|
|
72
|
+
this._editor = _editor;
|
|
73
|
+
this._instantiationService = _instantiationService;
|
|
74
|
+
this._commandService = _commandService;
|
|
75
|
+
this._languageConfigurationService = _languageConfigurationService;
|
|
76
|
+
this._accessibilityService = _accessibilityService;
|
|
77
|
+
this._languageFeaturesService = _languageFeaturesService;
|
|
78
|
+
this._codeEditorService = _codeEditorService;
|
|
79
|
+
this._inlineCompletionsService = _inlineCompletionsService;
|
|
80
|
+
this._isActive = observableValue(this, false);
|
|
81
|
+
this._onlyRequestInlineEditsSignal = observableSignal(this);
|
|
82
|
+
this._forceUpdateExplicitlySignal = observableSignal(this);
|
|
83
|
+
this._noDelaySignal = observableSignal(this);
|
|
84
|
+
this._fetchSpecificProviderSignal = observableSignal(this);
|
|
85
|
+
// We use a semantic id to keep the same inline completion selected even if the provider reorders the completions.
|
|
86
|
+
this._selectedInlineCompletionId = observableValue(this, undefined);
|
|
87
|
+
this.primaryPosition = derived(this, reader => this._positions.read(reader)[0] ?? new Position(1, 1));
|
|
88
|
+
this.allPositions = derived(this, reader => this._positions.read(reader));
|
|
89
|
+
this._isAcceptingPartially = false;
|
|
90
|
+
this._appearedInsideViewport = derived(this, reader => {
|
|
91
|
+
const state = this.state.read(reader);
|
|
92
|
+
if (!state || !state.inlineCompletion) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return isSuggestionInViewport(this._editor, state.inlineCompletion);
|
|
96
|
+
});
|
|
97
|
+
this._onDidAccept = new Emitter();
|
|
98
|
+
this.onDidAccept = this._onDidAccept.event;
|
|
99
|
+
this._lastShownInlineCompletionInfo = undefined;
|
|
100
|
+
this._lastAcceptedInlineCompletionInfo = undefined;
|
|
101
|
+
this._didUndoInlineEdits = derivedHandleChanges({
|
|
102
|
+
owner: this,
|
|
103
|
+
changeTracker: {
|
|
104
|
+
createChangeSummary: () => ({ didUndo: false }),
|
|
105
|
+
handleChange: (ctx, changeSummary) => {
|
|
106
|
+
changeSummary.didUndo = ctx.didChange(this._textModelVersionId) && !!ctx.change?.isUndoing;
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}, (reader, changeSummary) => {
|
|
111
|
+
const versionId = this._textModelVersionId.read(reader);
|
|
112
|
+
if (versionId !== null
|
|
113
|
+
&& this._lastAcceptedInlineCompletionInfo
|
|
114
|
+
&& this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === versionId - 1
|
|
115
|
+
&& this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit
|
|
116
|
+
&& changeSummary.didUndo) {
|
|
117
|
+
this._lastAcceptedInlineCompletionInfo = undefined;
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
return false;
|
|
121
|
+
});
|
|
122
|
+
this._preserveCurrentCompletionReasons = new Set([
|
|
123
|
+
VersionIdChangeReason.Redo,
|
|
124
|
+
VersionIdChangeReason.Undo,
|
|
125
|
+
VersionIdChangeReason.AcceptWord,
|
|
126
|
+
]);
|
|
127
|
+
this.dontRefetchSignal = observableSignal(this);
|
|
128
|
+
this._fetchInlineCompletionsPromise = derivedHandleChanges({
|
|
129
|
+
owner: this,
|
|
130
|
+
changeTracker: {
|
|
131
|
+
createChangeSummary: () => ({
|
|
132
|
+
dontRefetch: false,
|
|
133
|
+
preserveCurrentCompletion: false,
|
|
134
|
+
inlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic,
|
|
135
|
+
onlyRequestInlineEdits: false,
|
|
136
|
+
shouldDebounce: true,
|
|
137
|
+
provider: undefined,
|
|
138
|
+
textChange: false,
|
|
139
|
+
changeReason: '',
|
|
140
|
+
}),
|
|
141
|
+
handleChange: (ctx, changeSummary) => {
|
|
142
|
+
/** @description fetch inline completions */
|
|
143
|
+
if (ctx.didChange(this._textModelVersionId)) {
|
|
144
|
+
if (this._preserveCurrentCompletionReasons.has(this._getReason(ctx.change))) {
|
|
145
|
+
changeSummary.preserveCurrentCompletion = true;
|
|
146
|
+
}
|
|
147
|
+
const detailedReasons = ctx.change?.detailedReasons ?? [];
|
|
148
|
+
changeSummary.changeReason = detailedReasons.length > 0 ? detailedReasons[0].getType() : '';
|
|
149
|
+
changeSummary.textChange = true;
|
|
150
|
+
}
|
|
151
|
+
else if (ctx.didChange(this._forceUpdateExplicitlySignal)) {
|
|
152
|
+
changeSummary.preserveCurrentCompletion = true;
|
|
153
|
+
changeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit;
|
|
154
|
+
}
|
|
155
|
+
else if (ctx.didChange(this.dontRefetchSignal)) {
|
|
156
|
+
changeSummary.dontRefetch = true;
|
|
157
|
+
}
|
|
158
|
+
else if (ctx.didChange(this._onlyRequestInlineEditsSignal)) {
|
|
159
|
+
changeSummary.onlyRequestInlineEdits = true;
|
|
160
|
+
}
|
|
161
|
+
else if (ctx.didChange(this._fetchSpecificProviderSignal)) {
|
|
162
|
+
changeSummary.provider = ctx.change;
|
|
163
|
+
}
|
|
164
|
+
return true;
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
}, (reader, changeSummary) => {
|
|
168
|
+
this._source.clearOperationOnTextModelChange.read(reader); // Make sure the clear operation runs before the fetch operation
|
|
169
|
+
this._noDelaySignal.read(reader);
|
|
170
|
+
this.dontRefetchSignal.read(reader);
|
|
171
|
+
this._onlyRequestInlineEditsSignal.read(reader);
|
|
172
|
+
this._forceUpdateExplicitlySignal.read(reader);
|
|
173
|
+
this._fetchSpecificProviderSignal.read(reader);
|
|
174
|
+
const shouldUpdate = ((this._enabled.read(reader) && this._selectedSuggestItem.read(reader)) || this._isActive.read(reader))
|
|
175
|
+
&& (!this._inlineCompletionsService.isSnoozing() || changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit);
|
|
176
|
+
if (!shouldUpdate) {
|
|
177
|
+
this._source.cancelUpdate();
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
this._textModelVersionId.read(reader); // Refetch on text change
|
|
181
|
+
const suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(undefined);
|
|
182
|
+
let suggestItem = this._selectedSuggestItem.read(reader);
|
|
183
|
+
if (this._shouldShowOnSuggestConflict.read(undefined)) {
|
|
184
|
+
suggestItem = undefined;
|
|
185
|
+
}
|
|
186
|
+
if (suggestWidgetInlineCompletions && !suggestItem) {
|
|
187
|
+
this._source.seedInlineCompletionsWithSuggestWidget();
|
|
188
|
+
}
|
|
189
|
+
if (changeSummary.dontRefetch) {
|
|
190
|
+
return Promise.resolve(true);
|
|
191
|
+
}
|
|
192
|
+
if (this._didUndoInlineEdits.read(reader) && changeSummary.inlineCompletionTriggerKind !== InlineCompletionTriggerKind.Explicit) {
|
|
193
|
+
transaction(tx => {
|
|
194
|
+
this._source.clear(tx);
|
|
195
|
+
});
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
let reason = '';
|
|
199
|
+
if (changeSummary.provider) {
|
|
200
|
+
reason += 'providerOnDidChange';
|
|
201
|
+
}
|
|
202
|
+
else if (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit) {
|
|
203
|
+
reason += 'explicit';
|
|
204
|
+
}
|
|
205
|
+
if (changeSummary.changeReason) {
|
|
206
|
+
reason += reason.length > 0 ? `:${changeSummary.changeReason}` : changeSummary.changeReason;
|
|
207
|
+
}
|
|
208
|
+
const typingInterval = this._typing.getTypingInterval();
|
|
209
|
+
const requestInfo = {
|
|
210
|
+
editorType: this.editorType,
|
|
211
|
+
startTime: Date.now(),
|
|
212
|
+
languageId: this.textModel.getLanguageId(),
|
|
213
|
+
reason,
|
|
214
|
+
typingInterval: typingInterval.averageInterval,
|
|
215
|
+
typingIntervalCharacterCount: typingInterval.characterCount,
|
|
216
|
+
availableProviders: [],
|
|
217
|
+
};
|
|
218
|
+
let context = {
|
|
219
|
+
triggerKind: changeSummary.inlineCompletionTriggerKind,
|
|
220
|
+
selectedSuggestionInfo: suggestItem?.toSelectedSuggestionInfo(),
|
|
221
|
+
includeInlineCompletions: !changeSummary.onlyRequestInlineEdits,
|
|
222
|
+
includeInlineEdits: this._inlineEditsEnabled.read(reader),
|
|
223
|
+
requestIssuedDateTime: requestInfo.startTime,
|
|
224
|
+
earliestShownDateTime: requestInfo.startTime + (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit || this.inAcceptFlow.read(undefined) ? 0 : this._minShowDelay.read(undefined)),
|
|
225
|
+
};
|
|
226
|
+
if (context.triggerKind === InlineCompletionTriggerKind.Automatic && changeSummary.textChange) {
|
|
227
|
+
if (this.textModel.getAlternativeVersionId() === this._lastShownInlineCompletionInfo?.alternateTextModelVersionId) {
|
|
228
|
+
// When undoing back to a version where an inline edit/completion was shown,
|
|
229
|
+
// we want to show an inline edit (or completion) again if it was originally an inline edit (or completion).
|
|
230
|
+
context = {
|
|
231
|
+
...context,
|
|
232
|
+
includeInlineCompletions: !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,
|
|
233
|
+
includeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const itemToPreserveCandidate = this.selectedInlineCompletion.read(undefined) ?? this._inlineCompletionItems.read(undefined)?.inlineEdit;
|
|
238
|
+
const itemToPreserve = changeSummary.preserveCurrentCompletion || itemToPreserveCandidate?.forwardStable
|
|
239
|
+
? itemToPreserveCandidate : undefined;
|
|
240
|
+
const userJumpedToActiveCompletion = this._jumpedToId.map(jumpedTo => !!jumpedTo && jumpedTo === this._inlineCompletionItems.read(undefined)?.inlineEdit?.semanticId);
|
|
241
|
+
const providers = changeSummary.provider
|
|
242
|
+
? { providers: [changeSummary.provider], label: 'single:' + changeSummary.provider.providerId?.toString() }
|
|
243
|
+
: { providers: this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel), label: undefined }; // TODO: should use inlineCompletionProviders
|
|
244
|
+
const availableProviders = this.getAvailableProviders(providers.providers);
|
|
245
|
+
requestInfo.availableProviders = availableProviders.map(p => p.providerId).filter(isDefined);
|
|
246
|
+
return this._source.fetch(availableProviders, providers.label, context, itemToPreserve?.identity, changeSummary.shouldDebounce, userJumpedToActiveCompletion, requestInfo);
|
|
247
|
+
});
|
|
248
|
+
this._inlineCompletionItems = derivedOpts({ owner: this }, reader => {
|
|
249
|
+
const c = this._source.inlineCompletions.read(reader);
|
|
250
|
+
if (!c) {
|
|
251
|
+
return undefined;
|
|
252
|
+
}
|
|
253
|
+
const cursorPosition = this.primaryPosition.read(reader);
|
|
254
|
+
let inlineEdit = undefined;
|
|
255
|
+
const visibleCompletions = [];
|
|
256
|
+
for (const completion of c.inlineCompletions) {
|
|
257
|
+
if (!completion.isInlineEdit) {
|
|
258
|
+
if (completion.isVisible(this.textModel, cursorPosition)) {
|
|
259
|
+
visibleCompletions.push(completion);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
inlineEdit = completion;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (visibleCompletions.length !== 0) {
|
|
267
|
+
// Don't show the inline edit if there is a visible completion
|
|
268
|
+
inlineEdit = undefined;
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
inlineCompletions: visibleCompletions,
|
|
272
|
+
inlineEdit,
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
this._filteredInlineCompletionItems = derivedOpts({ owner: this, equalsFn: itemsEquals() }, reader => {
|
|
276
|
+
const c = this._inlineCompletionItems.read(reader);
|
|
277
|
+
return c?.inlineCompletions ?? [];
|
|
278
|
+
});
|
|
279
|
+
this.selectedInlineCompletionIndex = derived(this, (reader) => {
|
|
280
|
+
const selectedInlineCompletionId = this._selectedInlineCompletionId.read(reader);
|
|
281
|
+
const filteredCompletions = this._filteredInlineCompletionItems.read(reader);
|
|
282
|
+
const idx = this._selectedInlineCompletionId === undefined ? -1
|
|
283
|
+
: filteredCompletions.findIndex(v => v.semanticId === selectedInlineCompletionId);
|
|
284
|
+
if (idx === -1) {
|
|
285
|
+
// Reset the selection so that the selection does not jump back when it appears again
|
|
286
|
+
this._selectedInlineCompletionId.set(undefined, undefined);
|
|
287
|
+
return 0;
|
|
288
|
+
}
|
|
289
|
+
return idx;
|
|
290
|
+
});
|
|
291
|
+
this.selectedInlineCompletion = derived(this, (reader) => {
|
|
292
|
+
const filteredCompletions = this._filteredInlineCompletionItems.read(reader);
|
|
293
|
+
const idx = this.selectedInlineCompletionIndex.read(reader);
|
|
294
|
+
return filteredCompletions[idx];
|
|
295
|
+
});
|
|
296
|
+
this.activeCommands = derivedOpts({ owner: this, equalsFn: itemsEquals() }, r => this.selectedInlineCompletion.read(r)?.source.inlineSuggestions.commands ?? []);
|
|
297
|
+
this.inlineCompletionsCount = derived(this, reader => {
|
|
298
|
+
if (this.lastTriggerKind.read(reader) === InlineCompletionTriggerKind.Explicit) {
|
|
299
|
+
return this._filteredInlineCompletionItems.read(reader).length;
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
return undefined;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
this._hasVisiblePeekWidgets = derived(this, reader => this._editorObs.openedPeekWidgets.read(reader) > 0);
|
|
306
|
+
this._shouldShowOnSuggestConflict = derived(this, reader => {
|
|
307
|
+
const showOnSuggestConflict = this._showOnSuggestConflict.read(reader);
|
|
308
|
+
if (showOnSuggestConflict !== 'never') {
|
|
309
|
+
const hasInlineCompletion = !!this.selectedInlineCompletion.read(reader);
|
|
310
|
+
if (hasInlineCompletion) {
|
|
311
|
+
const item = this._selectedSuggestItem.read(reader);
|
|
312
|
+
if (!item) {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
if (showOnSuggestConflict === 'whenSuggestListIsIncomplete') {
|
|
316
|
+
return item.listIncomplete;
|
|
317
|
+
}
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return false;
|
|
322
|
+
});
|
|
323
|
+
this.state = derivedOpts({
|
|
324
|
+
owner: this,
|
|
325
|
+
equalsFn: (a, b) => {
|
|
326
|
+
if (!a || !b) {
|
|
327
|
+
return a === b;
|
|
328
|
+
}
|
|
329
|
+
if (a.kind === 'ghostText' && b.kind === 'ghostText') {
|
|
330
|
+
return ghostTextsOrReplacementsEqual(a.ghostTexts, b.ghostTexts)
|
|
331
|
+
&& a.inlineCompletion === b.inlineCompletion
|
|
332
|
+
&& a.suggestItem === b.suggestItem;
|
|
333
|
+
}
|
|
334
|
+
else if (a.kind === 'inlineEdit' && b.kind === 'inlineEdit') {
|
|
335
|
+
return a.inlineEdit.equals(b.inlineEdit);
|
|
336
|
+
}
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
}, (reader) => {
|
|
340
|
+
const model = this.textModel;
|
|
341
|
+
if (this._suppressInSnippetMode.read(reader) && this._isInSnippetMode.read(reader)) {
|
|
342
|
+
return undefined;
|
|
343
|
+
}
|
|
344
|
+
const item = this._inlineCompletionItems.read(reader);
|
|
345
|
+
const inlineEditResult = item?.inlineEdit;
|
|
346
|
+
if (inlineEditResult) {
|
|
347
|
+
if (this._hasVisiblePeekWidgets.read(reader)) {
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
let edit = inlineEditResult.getSingleTextEdit();
|
|
351
|
+
edit = singleTextRemoveCommonPrefix(edit, model);
|
|
352
|
+
const cursorAtInlineEdit = this.primaryPosition.map(cursorPos => LineRange.fromRangeInclusive(inlineEditResult.targetRange).addMargin(1, 1).contains(cursorPos.lineNumber));
|
|
353
|
+
const commands = inlineEditResult.source.inlineSuggestions.commands;
|
|
354
|
+
const inlineEdit = new InlineEdit(edit, commands ?? [], inlineEditResult);
|
|
355
|
+
const edits = inlineEditResult.updatedEdit;
|
|
356
|
+
const e = edits ? TextEdit.fromStringEdit(edits, new TextModelText(this.textModel)).replacements : [edit];
|
|
357
|
+
const nextEditUri = (item.inlineEdit?.command?.id === 'vscode.open' || item.inlineEdit?.command?.id === '_workbench.open') &&
|
|
358
|
+
// eslint-disable-next-line local/code-no-any-casts
|
|
359
|
+
item.inlineEdit?.command.arguments?.length ? URI.from(item.inlineEdit?.command.arguments[0]) : undefined;
|
|
360
|
+
return { kind: 'inlineEdit', inlineEdit, inlineCompletion: inlineEditResult, edits: e, cursorAtInlineEdit, nextEditUri };
|
|
361
|
+
}
|
|
362
|
+
const suggestItem = this._selectedSuggestItem.read(reader);
|
|
363
|
+
if (!this._shouldShowOnSuggestConflict.read(reader) && suggestItem) {
|
|
364
|
+
const suggestCompletionEdit = singleTextRemoveCommonPrefix(suggestItem.getSingleTextEdit(), model);
|
|
365
|
+
const augmentation = this._computeAugmentation(suggestCompletionEdit, reader);
|
|
366
|
+
const isSuggestionPreviewEnabled = this._suggestPreviewEnabled.read(reader);
|
|
367
|
+
if (!isSuggestionPreviewEnabled && !augmentation) {
|
|
368
|
+
return undefined;
|
|
369
|
+
}
|
|
370
|
+
const fullEdit = augmentation?.edit ?? suggestCompletionEdit;
|
|
371
|
+
const fullEditPreviewLength = augmentation ? augmentation.edit.text.length - suggestCompletionEdit.text.length : 0;
|
|
372
|
+
const mode = this._suggestPreviewMode.read(reader);
|
|
373
|
+
const positions = this._positions.read(reader);
|
|
374
|
+
const allPotentialEdits = [fullEdit, ...getSecondaryEdits(this.textModel, positions, fullEdit)];
|
|
375
|
+
const validEditsAndGhostTexts = allPotentialEdits
|
|
376
|
+
.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], fullEditPreviewLength) : undefined }))
|
|
377
|
+
.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);
|
|
378
|
+
const edits = validEditsAndGhostTexts.map(({ edit }) => edit);
|
|
379
|
+
const ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText);
|
|
380
|
+
const primaryGhostText = ghostTexts[0] ?? new GhostText(fullEdit.range.endLineNumber, []);
|
|
381
|
+
return { kind: 'ghostText', edits, primaryGhostText, ghostTexts, inlineCompletion: augmentation?.completion, suggestItem };
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
if (!this._isActive.read(reader)) {
|
|
385
|
+
return undefined;
|
|
386
|
+
}
|
|
387
|
+
const inlineCompletion = this.selectedInlineCompletion.read(reader);
|
|
388
|
+
if (!inlineCompletion) {
|
|
389
|
+
return undefined;
|
|
390
|
+
}
|
|
391
|
+
const replacement = inlineCompletion.getSingleTextEdit();
|
|
392
|
+
const mode = this._inlineSuggestMode.read(reader);
|
|
393
|
+
const positions = this._positions.read(reader);
|
|
394
|
+
const allPotentialEdits = [replacement, ...getSecondaryEdits(this.textModel, positions, replacement)];
|
|
395
|
+
const validEditsAndGhostTexts = allPotentialEdits
|
|
396
|
+
.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], 0) : undefined }))
|
|
397
|
+
.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);
|
|
398
|
+
const edits = validEditsAndGhostTexts.map(({ edit }) => edit);
|
|
399
|
+
const ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText);
|
|
400
|
+
if (!ghostTexts[0]) {
|
|
401
|
+
return undefined;
|
|
402
|
+
}
|
|
403
|
+
return { kind: 'ghostText', edits, primaryGhostText: ghostTexts[0], ghostTexts, inlineCompletion, suggestItem: undefined };
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
this.inlineCompletionState = derived(this, reader => {
|
|
407
|
+
const s = this.state.read(reader);
|
|
408
|
+
if (!s || s.kind !== 'ghostText') {
|
|
409
|
+
return undefined;
|
|
410
|
+
}
|
|
411
|
+
if (this._editorObs.inComposition.read(reader)) {
|
|
412
|
+
return undefined;
|
|
413
|
+
}
|
|
414
|
+
return s;
|
|
415
|
+
});
|
|
416
|
+
this.inlineEditState = derived(this, reader => {
|
|
417
|
+
const s = this.state.read(reader);
|
|
418
|
+
if (!s || s.kind !== 'inlineEdit') {
|
|
419
|
+
return undefined;
|
|
420
|
+
}
|
|
421
|
+
return s;
|
|
422
|
+
});
|
|
423
|
+
this.inlineEditAvailable = derived(this, reader => {
|
|
424
|
+
const s = this.inlineEditState.read(reader);
|
|
425
|
+
return !!s;
|
|
426
|
+
});
|
|
427
|
+
this.warning = derived(this, reader => {
|
|
428
|
+
return this.inlineCompletionState.read(reader)?.inlineCompletion?.warning;
|
|
429
|
+
});
|
|
430
|
+
this.ghostTexts = derivedOpts({ owner: this, equalsFn: ghostTextsOrReplacementsEqual }, reader => {
|
|
431
|
+
const v = this.inlineCompletionState.read(reader);
|
|
432
|
+
if (!v) {
|
|
433
|
+
return undefined;
|
|
434
|
+
}
|
|
435
|
+
return v.ghostTexts;
|
|
436
|
+
});
|
|
437
|
+
this.primaryGhostText = derivedOpts({ owner: this, equalsFn: ghostTextOrReplacementEquals }, reader => {
|
|
438
|
+
const v = this.inlineCompletionState.read(reader);
|
|
439
|
+
if (!v) {
|
|
440
|
+
return undefined;
|
|
441
|
+
}
|
|
442
|
+
return v?.primaryGhostText;
|
|
443
|
+
});
|
|
444
|
+
this.showCollapsed = derived(this, reader => {
|
|
445
|
+
const state = this.state.read(reader);
|
|
446
|
+
if (!state || state.kind !== 'inlineEdit') {
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
449
|
+
if (state.inlineCompletion.hint) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
const isCurrentModelVersion = state.inlineCompletion.updatedEditModelVersion === this._textModelVersionId.read(reader);
|
|
453
|
+
return (this._inlineEditsShowCollapsedEnabled.read(reader) || !isCurrentModelVersion)
|
|
454
|
+
&& this._jumpedToId.read(reader) !== state.inlineCompletion.semanticId
|
|
455
|
+
&& !this._inAcceptFlow.read(reader);
|
|
456
|
+
});
|
|
457
|
+
this._tabShouldIndent = derived(this, reader => {
|
|
458
|
+
if (this._inAcceptFlow.read(reader)) {
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
function isMultiLine(range) {
|
|
462
|
+
return range.startLineNumber !== range.endLineNumber;
|
|
463
|
+
}
|
|
464
|
+
function getNonIndentationRange(model, lineNumber) {
|
|
465
|
+
const columnStart = model.getLineIndentColumn(lineNumber);
|
|
466
|
+
const lastNonWsColumn = model.getLineLastNonWhitespaceColumn(lineNumber);
|
|
467
|
+
const columnEnd = Math.max(lastNonWsColumn, columnStart);
|
|
468
|
+
return new Range(lineNumber, columnStart, lineNumber, columnEnd);
|
|
469
|
+
}
|
|
470
|
+
const selections = this._editorObs.selections.read(reader);
|
|
471
|
+
return selections?.some(s => {
|
|
472
|
+
if (s.isEmpty()) {
|
|
473
|
+
return this.textModel.getLineLength(s.startLineNumber) === 0;
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
return isMultiLine(s) || s.containsRange(getNonIndentationRange(this.textModel, s.startLineNumber));
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
});
|
|
480
|
+
this.tabShouldJumpToInlineEdit = derived(this, reader => {
|
|
481
|
+
if (this._tabShouldIndent.read(reader)) {
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
const s = this.inlineEditState.read(reader);
|
|
485
|
+
if (!s) {
|
|
486
|
+
return false;
|
|
487
|
+
}
|
|
488
|
+
if (this.showCollapsed.read(reader)) {
|
|
489
|
+
return true;
|
|
490
|
+
}
|
|
491
|
+
if (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader) && !s.inlineCompletion.hint?.jumpToEdit) {
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
return !s.cursorAtInlineEdit.read(reader);
|
|
495
|
+
});
|
|
496
|
+
this.tabShouldAcceptInlineEdit = derived(this, reader => {
|
|
497
|
+
const s = this.inlineEditState.read(reader);
|
|
498
|
+
if (!s) {
|
|
499
|
+
return false;
|
|
500
|
+
}
|
|
501
|
+
if (this.showCollapsed.read(reader)) {
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
if (this._tabShouldIndent.read(reader)) {
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
if (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader) && !s.inlineCompletion.hint?.jumpToEdit) {
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
if (s.inlineCompletion.targetRange.startLineNumber === this._editorObs.cursorLineNumber.read(reader)) {
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
if (this._jumpedToId.read(reader) === s.inlineCompletion.semanticId) {
|
|
514
|
+
return true;
|
|
515
|
+
}
|
|
516
|
+
return s.cursorAtInlineEdit.read(reader);
|
|
517
|
+
});
|
|
518
|
+
this._jumpedToId = observableValue(this, undefined);
|
|
519
|
+
this._inAcceptFlow = observableValue(this, false);
|
|
520
|
+
this.inAcceptFlow = this._inAcceptFlow;
|
|
521
|
+
this._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this._textModelVersionId, this._debounceValue, this.primaryPosition));
|
|
522
|
+
this.lastTriggerKind = this._source.inlineCompletions.map(this, v => v?.request?.context.triggerKind);
|
|
523
|
+
this._editorObs = observableCodeEditor(this._editor);
|
|
524
|
+
const suggest = this._editorObs.getOption(134 /* EditorOption.suggest */);
|
|
525
|
+
this._suggestPreviewEnabled = suggest.map(v => v.preview);
|
|
526
|
+
this._suggestPreviewMode = suggest.map(v => v.previewMode);
|
|
527
|
+
const inlineSuggest = this._editorObs.getOption(71 /* EditorOption.inlineSuggest */);
|
|
528
|
+
this._inlineSuggestMode = inlineSuggest.map(v => v.mode);
|
|
529
|
+
this._suppressedInlineCompletionGroupIds = inlineSuggest.map(v => new Set(v.experimental.suppressInlineSuggestions.split(',')));
|
|
530
|
+
this._inlineEditsEnabled = inlineSuggest.map(v => !!v.edits.enabled);
|
|
531
|
+
this._inlineEditsShowCollapsedEnabled = inlineSuggest.map(s => s.edits.showCollapsed);
|
|
532
|
+
this._triggerCommandOnProviderChange = inlineSuggest.map(s => s.triggerCommandOnProviderChange);
|
|
533
|
+
this._minShowDelay = inlineSuggest.map(s => s.minShowDelay);
|
|
534
|
+
this._showOnSuggestConflict = inlineSuggest.map(s => s.experimental.showOnSuggestConflict);
|
|
535
|
+
this._suppressInSnippetMode = inlineSuggest.map(s => s.suppressInSnippetMode);
|
|
536
|
+
const snippetController = SnippetController2.get(this._editor);
|
|
537
|
+
this._isInSnippetMode = snippetController?.isInSnippetObservable ?? constObservable(false);
|
|
538
|
+
this._typing = this._register(new TypingInterval(this.textModel));
|
|
539
|
+
this._register(this._inlineCompletionsService.onDidChangeIsSnoozing((isSnoozing) => {
|
|
540
|
+
if (isSnoozing) {
|
|
541
|
+
this.stop();
|
|
542
|
+
}
|
|
543
|
+
}));
|
|
544
|
+
{ // Determine editor type
|
|
545
|
+
const isNotebook = this.textModel.uri.scheme === 'vscode-notebook-cell';
|
|
546
|
+
const [diffEditor] = this._codeEditorService.listDiffEditors()
|
|
547
|
+
.filter(d => d.getOriginalEditor().getId() === this._editor.getId() ||
|
|
548
|
+
d.getModifiedEditor().getId() === this._editor.getId());
|
|
549
|
+
this.isInDiffEditor = !!diffEditor;
|
|
550
|
+
this.editorType = isNotebook ? InlineCompletionEditorType.Notebook
|
|
551
|
+
: this.isInDiffEditor ? InlineCompletionEditorType.DiffEditor
|
|
552
|
+
: InlineCompletionEditorType.TextEditor;
|
|
553
|
+
}
|
|
554
|
+
this._register(recomputeInitiallyAndOnChange(this.state, (s) => {
|
|
555
|
+
if (s && s.inlineCompletion) {
|
|
556
|
+
this._inlineCompletionsService.reportNewCompletion(s.inlineCompletion.requestUuid);
|
|
557
|
+
}
|
|
558
|
+
}));
|
|
559
|
+
this._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise));
|
|
560
|
+
this._register(autorun(reader => {
|
|
561
|
+
this._editorObs.versionId.read(reader);
|
|
562
|
+
this._inAcceptFlow.set(false, undefined);
|
|
563
|
+
}));
|
|
564
|
+
this._register(autorun(reader => {
|
|
565
|
+
const jumpToReset = this.state.map((s, reader) => !s || s.kind === 'inlineEdit' && !s.cursorAtInlineEdit.read(reader)).read(reader);
|
|
566
|
+
if (jumpToReset) {
|
|
567
|
+
this._jumpedToId.set(undefined, undefined);
|
|
568
|
+
}
|
|
569
|
+
}));
|
|
570
|
+
const inlineEditSemanticId = this.inlineEditState.map(s => s?.inlineCompletion.semanticId);
|
|
571
|
+
this._register(autorun(reader => {
|
|
572
|
+
const id = inlineEditSemanticId.read(reader);
|
|
573
|
+
if (id) {
|
|
574
|
+
this._editor.pushUndoStop();
|
|
575
|
+
this._lastShownInlineCompletionInfo = {
|
|
576
|
+
alternateTextModelVersionId: this.textModel.getAlternativeVersionId(),
|
|
577
|
+
inlineCompletion: this.state.get().inlineCompletion,
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}));
|
|
581
|
+
// TODO: should use getAvailableProviders and update on _suppressedInlineCompletionGroupIds change
|
|
582
|
+
const inlineCompletionProviders = observableFromEvent(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () => this._languageFeaturesService.inlineCompletionsProvider.all(textModel));
|
|
583
|
+
mapObservableArrayCached(this, inlineCompletionProviders, (provider, store) => {
|
|
584
|
+
if (!provider.onDidChangeInlineCompletions) {
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
store.add(provider.onDidChangeInlineCompletions(() => {
|
|
588
|
+
if (!this._enabled.get()) {
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
// Only update the active editor
|
|
592
|
+
const activeEditor = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor();
|
|
593
|
+
if (activeEditor !== this._editor) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
if (this._triggerCommandOnProviderChange.get()) {
|
|
597
|
+
// TODO@hediet remove this and always do the else branch.
|
|
598
|
+
this.trigger(undefined, { onlyFetchInlineEdits: true });
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
// If there is an active suggestion from a different provider, we ignore the update
|
|
602
|
+
const activeState = this.state.get();
|
|
603
|
+
if (activeState && (activeState.inlineCompletion || activeState.edits) && activeState.inlineCompletion?.source.provider !== provider) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
transaction(tx => {
|
|
607
|
+
this._fetchSpecificProviderSignal.trigger(tx, provider);
|
|
608
|
+
this.trigger(tx);
|
|
609
|
+
});
|
|
610
|
+
}));
|
|
611
|
+
}).recomputeInitiallyAndOnChange(this._store);
|
|
612
|
+
this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store);
|
|
613
|
+
}
|
|
614
|
+
getIndentationInfo(reader) {
|
|
615
|
+
let startsWithIndentation = false;
|
|
616
|
+
let startsWithIndentationLessThanTabSize = true;
|
|
617
|
+
const ghostText = this?.primaryGhostText.read(reader);
|
|
618
|
+
if (!!this?._selectedSuggestItem && ghostText && ghostText.parts.length > 0) {
|
|
619
|
+
const { column, lines } = ghostText.parts[0];
|
|
620
|
+
const firstLine = lines[0].line;
|
|
621
|
+
const indentationEndColumn = this.textModel.getLineIndentColumn(ghostText.lineNumber);
|
|
622
|
+
const inIndentation = column <= indentationEndColumn;
|
|
623
|
+
if (inIndentation) {
|
|
624
|
+
let firstNonWsIdx = firstNonWhitespaceIndex(firstLine);
|
|
625
|
+
if (firstNonWsIdx === -1) {
|
|
626
|
+
firstNonWsIdx = firstLine.length - 1;
|
|
627
|
+
}
|
|
628
|
+
startsWithIndentation = firstNonWsIdx > 0;
|
|
629
|
+
const tabSize = this.textModel.getOptions().tabSize;
|
|
630
|
+
const visibleColumnIndentation = CursorColumns.visibleColumnFromColumn(firstLine, firstNonWsIdx + 1, tabSize);
|
|
631
|
+
startsWithIndentationLessThanTabSize = visibleColumnIndentation < tabSize;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
return {
|
|
635
|
+
startsWithIndentation,
|
|
636
|
+
startsWithIndentationLessThanTabSize,
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
_getReason(e) {
|
|
640
|
+
if (e?.isUndoing) {
|
|
641
|
+
return VersionIdChangeReason.Undo;
|
|
642
|
+
}
|
|
643
|
+
if (e?.isRedoing) {
|
|
644
|
+
return VersionIdChangeReason.Redo;
|
|
645
|
+
}
|
|
646
|
+
if (this.isAcceptingPartially) {
|
|
647
|
+
return VersionIdChangeReason.AcceptWord;
|
|
648
|
+
}
|
|
649
|
+
return VersionIdChangeReason.Other;
|
|
650
|
+
}
|
|
651
|
+
// TODO: This is not an ideal implementation of excludesGroupIds, however as this is currently still behind proposed API
|
|
652
|
+
// and due to the time constraints, we are using a simplified approach
|
|
653
|
+
getAvailableProviders(providers) {
|
|
654
|
+
const suppressedProviderGroupIds = this._suppressedInlineCompletionGroupIds.get();
|
|
655
|
+
const unsuppressedProviders = providers.filter(provider => !(provider.groupId && suppressedProviderGroupIds.has(provider.groupId)));
|
|
656
|
+
const excludedGroupIds = new Set();
|
|
657
|
+
for (const provider of unsuppressedProviders) {
|
|
658
|
+
provider.excludesGroupIds?.forEach(p => excludedGroupIds.add(p));
|
|
659
|
+
}
|
|
660
|
+
const availableProviders = [];
|
|
661
|
+
for (const provider of unsuppressedProviders) {
|
|
662
|
+
if (provider.groupId && excludedGroupIds.has(provider.groupId)) {
|
|
663
|
+
continue;
|
|
664
|
+
}
|
|
665
|
+
availableProviders.push(provider);
|
|
666
|
+
}
|
|
667
|
+
return availableProviders;
|
|
668
|
+
}
|
|
669
|
+
async trigger(tx, options = {}) {
|
|
670
|
+
subtransaction(tx, tx => {
|
|
671
|
+
if (options.onlyFetchInlineEdits) {
|
|
672
|
+
this._onlyRequestInlineEditsSignal.trigger(tx);
|
|
673
|
+
}
|
|
674
|
+
if (options.noDelay) {
|
|
675
|
+
this._noDelaySignal.trigger(tx);
|
|
676
|
+
}
|
|
677
|
+
this._isActive.set(true, tx);
|
|
678
|
+
if (options.explicit) {
|
|
679
|
+
this._inAcceptFlow.set(true, tx);
|
|
680
|
+
this._forceUpdateExplicitlySignal.trigger(tx);
|
|
681
|
+
}
|
|
682
|
+
if (options.provider) {
|
|
683
|
+
this._fetchSpecificProviderSignal.trigger(tx, options.provider);
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
await this._fetchInlineCompletionsPromise.get();
|
|
687
|
+
}
|
|
688
|
+
async triggerExplicitly(tx, onlyFetchInlineEdits = false) {
|
|
689
|
+
return this.trigger(tx, { onlyFetchInlineEdits, explicit: true });
|
|
690
|
+
}
|
|
691
|
+
stop(stopReason = 'automatic', tx) {
|
|
692
|
+
subtransaction(tx, tx => {
|
|
693
|
+
if (stopReason === 'explicitCancel') {
|
|
694
|
+
const inlineCompletion = this.state.get()?.inlineCompletion;
|
|
695
|
+
if (inlineCompletion) {
|
|
696
|
+
inlineCompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Rejected });
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
this._isActive.set(false, tx);
|
|
700
|
+
this._source.clear(tx);
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
_computeAugmentation(suggestCompletion, reader) {
|
|
704
|
+
const model = this.textModel;
|
|
705
|
+
const suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(reader);
|
|
706
|
+
const candidateInlineCompletions = suggestWidgetInlineCompletions
|
|
707
|
+
? suggestWidgetInlineCompletions.inlineCompletions.filter(c => !c.isInlineEdit)
|
|
708
|
+
: [this.selectedInlineCompletion.read(reader)].filter(isDefined);
|
|
709
|
+
const augmentedCompletion = mapFindFirst(candidateInlineCompletions, completion => {
|
|
710
|
+
let r = completion.getSingleTextEdit();
|
|
711
|
+
r = singleTextRemoveCommonPrefix(r, model, Range.fromPositions(r.range.getStartPosition(), suggestCompletion.range.getEndPosition()));
|
|
712
|
+
return singleTextEditAugments(r, suggestCompletion) ? { completion, edit: r } : undefined;
|
|
713
|
+
});
|
|
714
|
+
return augmentedCompletion;
|
|
715
|
+
}
|
|
716
|
+
async _deltaSelectedInlineCompletionIndex(delta) {
|
|
717
|
+
await this.triggerExplicitly();
|
|
718
|
+
const completions = this._filteredInlineCompletionItems.get() || [];
|
|
719
|
+
if (completions.length > 0) {
|
|
720
|
+
const newIdx = (this.selectedInlineCompletionIndex.get() + delta + completions.length) % completions.length;
|
|
721
|
+
this._selectedInlineCompletionId.set(completions[newIdx].semanticId, undefined);
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
this._selectedInlineCompletionId.set(undefined, undefined);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
async next() { await this._deltaSelectedInlineCompletionIndex(1); }
|
|
728
|
+
async previous() { await this._deltaSelectedInlineCompletionIndex(-1); }
|
|
729
|
+
_getMetadata(completion, languageId, type = undefined) {
|
|
730
|
+
if (type) {
|
|
731
|
+
return EditSources.inlineCompletionPartialAccept({
|
|
732
|
+
nes: completion.isInlineEdit,
|
|
733
|
+
requestUuid: completion.requestUuid,
|
|
734
|
+
providerId: completion.source.provider.providerId,
|
|
735
|
+
languageId,
|
|
736
|
+
type,
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
return EditSources.inlineCompletionAccept({
|
|
741
|
+
nes: completion.isInlineEdit,
|
|
742
|
+
requestUuid: completion.requestUuid,
|
|
743
|
+
providerId: completion.source.provider.providerId,
|
|
744
|
+
languageId
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
async accept(editor = this._editor) {
|
|
749
|
+
if (editor.getModel() !== this.textModel) {
|
|
750
|
+
throw new BugIndicatingError();
|
|
751
|
+
}
|
|
752
|
+
let completion;
|
|
753
|
+
let isNextEditUri = false;
|
|
754
|
+
const state = this.state.get();
|
|
755
|
+
if (state?.kind === 'ghostText') {
|
|
756
|
+
if (!state || state.primaryGhostText.isEmpty() || !state.inlineCompletion) {
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
completion = state.inlineCompletion;
|
|
760
|
+
}
|
|
761
|
+
else if (state?.kind === 'inlineEdit') {
|
|
762
|
+
completion = state.inlineCompletion;
|
|
763
|
+
isNextEditUri = !!state.nextEditUri;
|
|
764
|
+
}
|
|
765
|
+
else {
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
// Make sure the completion list will not be disposed before the text change is sent.
|
|
769
|
+
completion.addRef();
|
|
770
|
+
try {
|
|
771
|
+
editor.pushUndoStop();
|
|
772
|
+
if (isNextEditUri) {
|
|
773
|
+
// Do nothing
|
|
774
|
+
}
|
|
775
|
+
else if (completion.snippetInfo) {
|
|
776
|
+
const mainEdit = TextReplacement.delete(completion.editRange);
|
|
777
|
+
const additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));
|
|
778
|
+
const edit = TextEdit.fromParallelReplacementsUnsorted([mainEdit, ...additionalEdits]);
|
|
779
|
+
editor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));
|
|
780
|
+
editor.setPosition(completion.snippetInfo.range.getStartPosition(), 'inlineCompletionAccept');
|
|
781
|
+
SnippetController2.get(editor)?.insert(completion.snippetInfo.snippet, { undoStopBefore: false });
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
const edits = state.edits;
|
|
785
|
+
// The cursor should move to the end of the edit, not the end of the range provided by the extension
|
|
786
|
+
// Inline Edit diffs (human readable) the suggestion from the extension so it already removes common suffix/prefix
|
|
787
|
+
// Inline Completions does diff the suggestion so it may contain common suffix
|
|
788
|
+
let minimalEdits = edits;
|
|
789
|
+
if (state.kind === 'ghostText') {
|
|
790
|
+
minimalEdits = removeTextReplacementCommonSuffixPrefix(edits, this.textModel);
|
|
791
|
+
}
|
|
792
|
+
const selections = getEndPositionsAfterApplying(minimalEdits).map(p => Selection.fromPositions(p));
|
|
793
|
+
const additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));
|
|
794
|
+
const edit = TextEdit.fromParallelReplacementsUnsorted([...edits, ...additionalEdits]);
|
|
795
|
+
editor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));
|
|
796
|
+
if (completion.hint === undefined) {
|
|
797
|
+
// do not move the cursor when the completion is displayed in a different location
|
|
798
|
+
editor.setSelections(state.kind === 'inlineEdit' ? selections.slice(-1) : selections, 'inlineCompletionAccept');
|
|
799
|
+
}
|
|
800
|
+
if (state.kind === 'inlineEdit' && !this._accessibilityService.isMotionReduced()) {
|
|
801
|
+
const editRanges = edit.getNewRanges();
|
|
802
|
+
const dec = this._store.add(new FadeoutDecoration(editor, editRanges, () => {
|
|
803
|
+
this._store.delete(dec);
|
|
804
|
+
}));
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
this._onDidAccept.fire();
|
|
808
|
+
// Reset before invoking the command, as the command might cause a follow up trigger (which we don't want to reset).
|
|
809
|
+
this.stop();
|
|
810
|
+
if (completion.command) {
|
|
811
|
+
await this._commandService
|
|
812
|
+
.executeCommand(completion.command.id, ...(completion.command.arguments || []))
|
|
813
|
+
.then(undefined, onUnexpectedExternalError);
|
|
814
|
+
}
|
|
815
|
+
completion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted });
|
|
816
|
+
}
|
|
817
|
+
finally {
|
|
818
|
+
completion.removeRef();
|
|
819
|
+
this._inAcceptFlow.set(true, undefined);
|
|
820
|
+
this._lastAcceptedInlineCompletionInfo = { textModelVersionIdAfter: this.textModel.getVersionId(), inlineCompletion: completion };
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
async acceptNextWord() {
|
|
824
|
+
await this._acceptNext(this._editor, 'word', (pos, text) => {
|
|
825
|
+
const langId = this.textModel.getLanguageIdAtPosition(pos.lineNumber, pos.column);
|
|
826
|
+
const config = this._languageConfigurationService.getLanguageConfiguration(langId);
|
|
827
|
+
const wordRegExp = new RegExp(config.wordDefinition.source, config.wordDefinition.flags.replace('g', ''));
|
|
828
|
+
const m1 = text.match(wordRegExp);
|
|
829
|
+
let acceptUntilIndexExclusive = 0;
|
|
830
|
+
if (m1 && m1.index !== undefined) {
|
|
831
|
+
if (m1.index === 0) {
|
|
832
|
+
acceptUntilIndexExclusive = m1[0].length;
|
|
833
|
+
}
|
|
834
|
+
else {
|
|
835
|
+
acceptUntilIndexExclusive = m1.index;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
else {
|
|
839
|
+
acceptUntilIndexExclusive = text.length;
|
|
840
|
+
}
|
|
841
|
+
const wsRegExp = /\s+/g;
|
|
842
|
+
const m2 = wsRegExp.exec(text);
|
|
843
|
+
if (m2 && m2.index !== undefined) {
|
|
844
|
+
if (m2.index + m2[0].length < acceptUntilIndexExclusive) {
|
|
845
|
+
acceptUntilIndexExclusive = m2.index + m2[0].length;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
return acceptUntilIndexExclusive;
|
|
849
|
+
}, 0 /* PartialAcceptTriggerKind.Word */);
|
|
850
|
+
}
|
|
851
|
+
async acceptNextLine() {
|
|
852
|
+
await this._acceptNext(this._editor, 'line', (pos, text) => {
|
|
853
|
+
const m = text.match(/\n/);
|
|
854
|
+
if (m && m.index !== undefined) {
|
|
855
|
+
return m.index + 1;
|
|
856
|
+
}
|
|
857
|
+
return text.length;
|
|
858
|
+
}, 1 /* PartialAcceptTriggerKind.Line */);
|
|
859
|
+
}
|
|
860
|
+
async _acceptNext(editor, type, getAcceptUntilIndex, kind) {
|
|
861
|
+
if (editor.getModel() !== this.textModel) {
|
|
862
|
+
throw new BugIndicatingError();
|
|
863
|
+
}
|
|
864
|
+
const state = this.inlineCompletionState.get();
|
|
865
|
+
if (!state || state.primaryGhostText.isEmpty() || !state.inlineCompletion) {
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
const ghostText = state.primaryGhostText;
|
|
869
|
+
const completion = state.inlineCompletion;
|
|
870
|
+
if (completion.snippetInfo) {
|
|
871
|
+
// not in WYSIWYG mode, partial commit might change completion, thus it is not supported
|
|
872
|
+
await this.accept(editor);
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
const firstPart = ghostText.parts[0];
|
|
876
|
+
const ghostTextPos = new Position(ghostText.lineNumber, firstPart.column);
|
|
877
|
+
const ghostTextVal = firstPart.text;
|
|
878
|
+
const acceptUntilIndexExclusive = getAcceptUntilIndex(ghostTextPos, ghostTextVal);
|
|
879
|
+
if (acceptUntilIndexExclusive === ghostTextVal.length && ghostText.parts.length === 1) {
|
|
880
|
+
this.accept(editor);
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
const partialGhostTextVal = ghostTextVal.substring(0, acceptUntilIndexExclusive);
|
|
884
|
+
const positions = this._positions.get();
|
|
885
|
+
const cursorPosition = positions[0];
|
|
886
|
+
// Executing the edit might free the completion, so we have to hold a reference on it.
|
|
887
|
+
completion.addRef();
|
|
888
|
+
try {
|
|
889
|
+
this._isAcceptingPartially = true;
|
|
890
|
+
try {
|
|
891
|
+
editor.pushUndoStop();
|
|
892
|
+
const replaceRange = Range.fromPositions(cursorPosition, ghostTextPos);
|
|
893
|
+
const newText = editor.getModel().getValueInRange(replaceRange) + partialGhostTextVal;
|
|
894
|
+
const primaryEdit = new TextReplacement(replaceRange, newText);
|
|
895
|
+
const edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)].filter(isDefined);
|
|
896
|
+
const selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p));
|
|
897
|
+
editor.edit(TextEdit.fromParallelReplacementsUnsorted(edits), this._getMetadata(completion, type));
|
|
898
|
+
editor.setSelections(selections, 'inlineCompletionPartialAccept');
|
|
899
|
+
editor.revealPositionInCenterIfOutsideViewport(editor.getPosition(), 1 /* ScrollType.Immediate */);
|
|
900
|
+
}
|
|
901
|
+
finally {
|
|
902
|
+
this._isAcceptingPartially = false;
|
|
903
|
+
}
|
|
904
|
+
const acceptedRange = Range.fromPositions(completion.editRange.getStartPosition(), TextLength.ofText(partialGhostTextVal).addToPosition(ghostTextPos));
|
|
905
|
+
// This assumes that the inline completion and the model use the same EOL style.
|
|
906
|
+
const text = editor.getModel().getValueInRange(acceptedRange, 1 /* EndOfLinePreference.LF */);
|
|
907
|
+
const acceptedLength = text.length;
|
|
908
|
+
completion.reportPartialAccept(acceptedLength, { kind, acceptedLength: acceptedLength }, { characters: acceptUntilIndexExclusive, ratio: acceptUntilIndexExclusive / ghostTextVal.length, count: 1 });
|
|
909
|
+
}
|
|
910
|
+
finally {
|
|
911
|
+
completion.removeRef();
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
handleSuggestAccepted(item) {
|
|
915
|
+
const itemEdit = singleTextRemoveCommonPrefix(item.getSingleTextEdit(), this.textModel);
|
|
916
|
+
const augmentedCompletion = this._computeAugmentation(itemEdit, undefined);
|
|
917
|
+
if (!augmentedCompletion) {
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
// This assumes that the inline completion and the model use the same EOL style.
|
|
921
|
+
const alreadyAcceptedLength = this.textModel.getValueInRange(augmentedCompletion.completion.editRange, 1 /* EndOfLinePreference.LF */).length;
|
|
922
|
+
const acceptedLength = alreadyAcceptedLength + itemEdit.text.length;
|
|
923
|
+
augmentedCompletion.completion.reportPartialAccept(itemEdit.text.length, {
|
|
924
|
+
kind: 2 /* PartialAcceptTriggerKind.Suggest */,
|
|
925
|
+
acceptedLength,
|
|
926
|
+
}, {
|
|
927
|
+
characters: itemEdit.text.length,
|
|
928
|
+
count: 1,
|
|
929
|
+
ratio: 1
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
extractReproSample() {
|
|
933
|
+
const value = this.textModel.getValue();
|
|
934
|
+
const item = this.state.get()?.inlineCompletion;
|
|
935
|
+
return {
|
|
936
|
+
documentValue: value,
|
|
937
|
+
inlineCompletion: item?.getSourceCompletion(),
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
jump() {
|
|
941
|
+
const s = this.inlineEditState.get();
|
|
942
|
+
if (!s) {
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
transaction(tx => {
|
|
946
|
+
this._jumpedToId.set(s.inlineCompletion.semanticId, tx);
|
|
947
|
+
this.dontRefetchSignal.trigger(tx);
|
|
948
|
+
const targetRange = s.inlineCompletion.targetRange;
|
|
949
|
+
const targetPosition = targetRange.getStartPosition();
|
|
950
|
+
this._editor.setPosition(targetPosition, 'inlineCompletions.jump');
|
|
951
|
+
// TODO: consider using view information to reveal it
|
|
952
|
+
const isSingleLineChange = targetRange.isSingleLine() && (s.inlineCompletion.hint || !s.inlineCompletion.insertText.includes('\n'));
|
|
953
|
+
if (isSingleLineChange) {
|
|
954
|
+
this._editor.revealPosition(targetPosition);
|
|
955
|
+
}
|
|
956
|
+
else {
|
|
957
|
+
const revealRange = new Range(targetRange.startLineNumber - 1, 1, targetRange.endLineNumber + 1, 1);
|
|
958
|
+
this._editor.revealRange(revealRange, 1 /* ScrollType.Immediate */);
|
|
959
|
+
}
|
|
960
|
+
s.inlineCompletion.identity.setJumpTo(tx);
|
|
961
|
+
this._editor.focus();
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
async handleInlineSuggestionShown(inlineCompletion, viewKind, viewData) {
|
|
965
|
+
await inlineCompletion.reportInlineEditShown(this._commandService, viewKind, viewData);
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
InlineCompletionsModel = __decorate([
|
|
969
|
+
__param(7, IInstantiationService),
|
|
970
|
+
__param(8, ICommandService),
|
|
971
|
+
__param(9, ILanguageConfigurationService),
|
|
972
|
+
__param(10, IAccessibilityService),
|
|
973
|
+
__param(11, ILanguageFeaturesService),
|
|
974
|
+
__param(12, ICodeEditorService),
|
|
975
|
+
__param(13, IInlineCompletionsService)
|
|
976
|
+
], InlineCompletionsModel);
|
|
977
|
+
var VersionIdChangeReason;
|
|
978
|
+
(function (VersionIdChangeReason) {
|
|
979
|
+
VersionIdChangeReason[VersionIdChangeReason["Undo"] = 0] = "Undo";
|
|
980
|
+
VersionIdChangeReason[VersionIdChangeReason["Redo"] = 1] = "Redo";
|
|
981
|
+
VersionIdChangeReason[VersionIdChangeReason["AcceptWord"] = 2] = "AcceptWord";
|
|
982
|
+
VersionIdChangeReason[VersionIdChangeReason["Other"] = 3] = "Other";
|
|
983
|
+
})(VersionIdChangeReason || (VersionIdChangeReason = {}));
|
|
984
|
+
function getSecondaryEdits(textModel, positions, primaryTextRepl) {
|
|
985
|
+
if (positions.length === 1) {
|
|
986
|
+
// No secondary cursor positions
|
|
987
|
+
return [];
|
|
988
|
+
}
|
|
989
|
+
const text = new TextModelText(textModel);
|
|
990
|
+
const textTransformer = text.getTransformer();
|
|
991
|
+
const primaryOffset = textTransformer.getOffset(positions[0]);
|
|
992
|
+
const secondaryOffsets = positions.slice(1).map(pos => textTransformer.getOffset(pos));
|
|
993
|
+
primaryTextRepl = primaryTextRepl.removeCommonPrefixAndSuffix(text);
|
|
994
|
+
const primaryStringRepl = textTransformer.getStringReplacement(primaryTextRepl);
|
|
995
|
+
const deltaFromOffsetToRangeStart = primaryStringRepl.replaceRange.start - primaryOffset;
|
|
996
|
+
const primaryContextRange = primaryStringRepl.replaceRange.join(OffsetRange.emptyAt(primaryOffset));
|
|
997
|
+
const primaryContextValue = text.getValueOfOffsetRange(primaryContextRange);
|
|
998
|
+
const replacements = secondaryOffsets.map(secondaryOffset => {
|
|
999
|
+
const newRangeStart = secondaryOffset + deltaFromOffsetToRangeStart;
|
|
1000
|
+
const newRangeEnd = newRangeStart + primaryStringRepl.replaceRange.length;
|
|
1001
|
+
const range = new OffsetRange(newRangeStart, newRangeEnd);
|
|
1002
|
+
const contextRange = range.join(OffsetRange.emptyAt(secondaryOffset));
|
|
1003
|
+
const contextValue = text.getValueOfOffsetRange(contextRange);
|
|
1004
|
+
if (contextValue !== primaryContextValue) {
|
|
1005
|
+
return undefined;
|
|
1006
|
+
}
|
|
1007
|
+
const stringRepl = new StringReplacement(range, primaryStringRepl.newText);
|
|
1008
|
+
const repl = textTransformer.getTextReplacement(stringRepl);
|
|
1009
|
+
return repl;
|
|
1010
|
+
}).filter(isDefined);
|
|
1011
|
+
return replacements;
|
|
1012
|
+
}
|
|
1013
|
+
class FadeoutDecoration extends Disposable {
|
|
1014
|
+
constructor(editor, ranges, onDispose) {
|
|
1015
|
+
super();
|
|
1016
|
+
if (onDispose) {
|
|
1017
|
+
this._register({ dispose: () => onDispose() });
|
|
1018
|
+
}
|
|
1019
|
+
this._register(observableCodeEditor(editor).setDecorations(constObservable(ranges.map(range => ({
|
|
1020
|
+
range: range,
|
|
1021
|
+
options: {
|
|
1022
|
+
description: 'animation',
|
|
1023
|
+
className: 'edits-fadeout-decoration',
|
|
1024
|
+
zIndex: 1,
|
|
1025
|
+
}
|
|
1026
|
+
})))));
|
|
1027
|
+
const animation = new AnimatedValue(1, 0, 1000, easeOutCubic);
|
|
1028
|
+
const val = new ObservableAnimatedValue(animation);
|
|
1029
|
+
this._register(autorun(reader => {
|
|
1030
|
+
const opacity = val.getValue(reader);
|
|
1031
|
+
editor.getContainerDomNode().style.setProperty('--animation-opacity', opacity.toString());
|
|
1032
|
+
if (animation.isFinished()) {
|
|
1033
|
+
this.dispose();
|
|
1034
|
+
}
|
|
1035
|
+
}));
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
function isSuggestionInViewport(editor, suggestion) {
|
|
1039
|
+
const targetRange = suggestion.targetRange;
|
|
1040
|
+
const visibleRanges = editor.getVisibleRanges();
|
|
1041
|
+
if (visibleRanges.length < 1) {
|
|
1042
|
+
return false;
|
|
1043
|
+
}
|
|
1044
|
+
const viewportRange = new Range(visibleRanges[0].startLineNumber, visibleRanges[0].startColumn, visibleRanges[visibleRanges.length - 1].endLineNumber, visibleRanges[visibleRanges.length - 1].endColumn);
|
|
1045
|
+
return viewportRange.containsRange(targetRange);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
export { InlineCompletionsModel, VersionIdChangeReason, getSecondaryEdits };
|