monaco-editor-core 0.57.0 → 0.58.0-dev-20261104
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/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +38 -6
- package/esm/vs/base/browser/browser.js +8 -0
- package/esm/vs/base/browser/browser.js.map +1 -1
- package/esm/vs/base/browser/contextmenu.js +8 -1
- package/esm/vs/base/browser/contextmenu.js.map +1 -1
- package/esm/vs/base/browser/dom.js +34 -5
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +2457 -2640
- package/esm/vs/base/browser/markdownRenderer.js +48 -21
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/pixelRatio.js +3 -2
- package/esm/vs/base/browser/pixelRatio.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +5 -2
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.js +7 -2
- package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
- package/esm/vs/base/browser/ui/animations/animations.js +68 -40
- package/esm/vs/base/browser/ui/animations/animations.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.js +7 -0
- package/esm/vs/base/browser/ui/button/button.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/contextview/contextview.css +15 -0
- package/esm/vs/base/browser/ui/contextview/contextview.js +266 -40
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js +72 -0
- package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js.map +1 -0
- package/esm/vs/base/browser/ui/dialog/dialog.css +5 -0
- package/esm/vs/base/browser/ui/dropdown/dropdown.js +2 -1
- package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listView.js +87 -15
- package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +37 -15
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/menu/menu.js +189 -52
- package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
- package/esm/vs/base/browser/ui/radio/radio.css +11 -0
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +2 -1
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +14 -8
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
- package/esm/vs/base/browser/ui/splitview/splitview.js +11 -7
- package/esm/vs/base/browser/ui/splitview/splitview.js.map +1 -1
- package/esm/vs/base/browser/ui/toggle/switch.css +16 -7
- package/esm/vs/base/browser/ui/toggle/switch.js +9 -6
- package/esm/vs/base/browser/ui/toggle/switch.js.map +1 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -2
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +85 -38
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +48 -9
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +10 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTree.js +3 -0
- package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
- package/esm/vs/base/common/actions.js +8 -2
- package/esm/vs/base/common/actions.js.map +1 -1
- package/esm/vs/base/common/arrays.js +4 -4
- package/esm/vs/base/common/arrays.js.map +1 -1
- package/esm/vs/base/common/async.js +12 -8
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/cancellation.js +25 -0
- package/esm/vs/base/common/cancellation.js.map +1 -1
- package/esm/vs/base/common/codicons.js +2 -0
- package/esm/vs/base/common/codicons.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +2 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/color.js +1 -1
- package/esm/vs/base/common/color.js.map +1 -1
- package/esm/vs/base/common/diff/diff.js +60 -1
- package/esm/vs/base/common/diff/diff.js.map +1 -1
- package/esm/vs/base/common/event.js +1 -1
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/glob.js +1 -0
- package/esm/vs/base/common/glob.js.map +1 -1
- package/esm/vs/base/common/htmlContent.js +74 -12
- package/esm/vs/base/common/htmlContent.js.map +1 -1
- package/esm/vs/base/common/json.js +19 -0
- package/esm/vs/base/common/json.js.map +1 -0
- package/esm/vs/base/common/network.js +16 -0
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/resources.js +14 -2
- package/esm/vs/base/common/resources.js.map +1 -1
- package/esm/vs/base/common/strings.js +1 -1
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/base/common/uri.js +2 -2
- package/esm/vs/base/common/uri.js.map +1 -1
- package/esm/vs/editor/browser/config/editorConfiguration.js +1 -1
- package/esm/vs/editor/browser/config/fontMeasurements.js +19 -6
- package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +3 -3
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +11 -5
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -38
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +3 -3
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +6 -6
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +12 -10
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +7 -7
- package/esm/vs/editor/browser/controller/mouseTarget.js +3 -3
- package/esm/vs/editor/browser/coreCommands.js +2 -2
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/editorMarkdownSanitizer.js +19 -0
- package/esm/vs/editor/browser/editorMarkdownSanitizer.js.map +1 -0
- package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +1 -1
- package/esm/vs/editor/browser/services/editorWorkerService.js +3 -2
- package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
- package/esm/vs/editor/browser/services/openerService.js +6 -2
- package/esm/vs/editor/browser/services/openerService.js.map +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js +34 -11
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
- package/esm/vs/editor/browser/view/viewController.js +7 -7
- package/esm/vs/editor/browser/view/viewController.js.map +1 -1
- package/esm/vs/editor/browser/view/viewLayer.js +1 -1
- package/esm/vs/editor/browser/view/viewOverlays.js +4 -4
- package/esm/vs/editor/browser/view.js +5 -5
- package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +11 -3
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -6
- package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +12 -12
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +9 -2
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
- package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +2 -2
- package/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -2
- package/esm/vs/editor/browser/viewParts/margin/margin.js +2 -2
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js +6 -6
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +9 -2
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +5 -5
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js +2 -2
- package/esm/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -3
- package/esm/vs/editor/browser/viewParts/selections/selections.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +6 -6
- package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +5 -5
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +11 -11
- package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
- package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +4 -4
- package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js +2 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +22 -21
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +18 -18
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +10 -10
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +4 -4
- package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +21 -3
- package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +10 -10
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js +21 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +11 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js.map +1 -1
- package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js +64 -0
- package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js.map +1 -0
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +68 -58
- package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +560 -500
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
- package/esm/vs/editor/common/core/edits/textEdit.js +16 -0
- package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursor.js +20 -10
- package/esm/vs/editor/common/cursor/cursor.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +67 -14
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorTypeOperations.js +2 -2
- package/esm/vs/editor/common/cursor/cursorTypeOperations.js.map +1 -1
- package/esm/vs/editor/common/cursorCommon.js +22 -21
- package/esm/vs/editor/common/cursorCommon.js.map +1 -1
- package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +21 -8
- package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js.map +1 -1
- package/esm/vs/editor/common/diff/documentDiffProvider.js.map +1 -1
- package/esm/vs/editor/common/diff/externalLinesDiffComputer.js +38 -26
- package/esm/vs/editor/common/diff/externalLinesDiffComputer.js.map +1 -1
- package/esm/vs/editor/common/diff/rangeMapping.js +11 -1
- package/esm/vs/editor/common/diff/rangeMapping.js.map +1 -1
- package/esm/vs/editor/common/diff/verifyLinesDiff.js +28 -0
- package/esm/vs/editor/common/diff/verifyLinesDiff.js.map +1 -0
- package/esm/vs/editor/common/editorContextKeys.js +53 -53
- package/esm/vs/editor/common/languages/languageConfiguration.js +8 -0
- package/esm/vs/editor/common/languages/languageConfiguration.js.map +1 -1
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/services/editorWebWorker.js +27 -6
- package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
- package/esm/vs/editor/common/services/editorWorker.js.map +1 -1
- package/esm/vs/editor/common/services/languageService.js +6 -4
- package/esm/vs/editor/common/services/languageService.js.map +1 -1
- package/esm/vs/editor/common/services/markerDecorationsService.js +21 -2
- package/esm/vs/editor/common/services/markerDecorationsService.js.map +1 -1
- package/esm/vs/editor/common/standalone/standaloneEnums.js +100 -97
- package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -11
- package/esm/vs/editor/common/textModelEditSource.js +9 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLayout.js +16 -16
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +19 -19
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +9 -9
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +23 -20
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +25 -10
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +3 -3
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +17 -17
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +39 -39
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js +19 -0
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js.map +1 -0
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +26 -18
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +18 -18
- package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findModel.js +6 -6
- package/esm/vs/editor/contrib/find/browser/findWidget.js +40 -40
- package/esm/vs/editor/contrib/find/browser/findWidget.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +23 -23
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +2 -2
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +4 -4
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js.map +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +9 -3
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +2 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -8
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +6 -6
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +5 -5
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +9 -9
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +3 -3
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +7 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +5 -4
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js.map +1 -1
- package/esm/vs/editor/contrib/links/browser/links.js +16 -15
- package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
- package/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +1 -1
- package/esm/vs/editor/contrib/message/browser/messageController.js +16 -12
- package/esm/vs/editor/contrib/message/browser/messageController.js.map +1 -1
- package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +91 -55
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js.map +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +3 -3
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js.map +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +6 -4
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +3 -3
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +6 -6
- package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +23 -13
- package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js.map +1 -1
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +5 -5
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
- package/esm/vs/editor/contrib/snippet/browser/snippetSession.js +2 -2
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +10 -8
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +6 -6
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +15 -15
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +27 -27
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +8 -6
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +5 -5
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +3 -3
- package/esm/vs/editor/contrib/suggest/browser/wordDistance.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +27 -27
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +1 -1
- package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js.map +1 -1
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +50 -14
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +6 -6
- package/esm/vs/editor/editor.api.d.ts +133 -98
- package/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +1 -1
- package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +5 -3
- package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +15 -1
- package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
- package/esm/vs/nls.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +72 -66
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js.map +1 -1
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +434 -136
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +74 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +24 -26
- package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js +16 -0
- package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js.map +1 -0
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +15 -17
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +25 -12
- package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js +4 -2
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +15 -8
- package/esm/vs/platform/actions/common/menuService.js.map +1 -1
- package/esm/vs/platform/configuration/common/configuration.js +3 -1
- package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationModels.js +16 -11
- package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationRegistry.js +29 -27
- package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurations.js +13 -1
- package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +2 -2
- package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +28 -14
- package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/contextview/browser/contextMenuHandler.js +17 -4
- package/esm/vs/platform/contextview/browser/contextMenuHandler.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextMenuService.js +1 -1
- package/esm/vs/platform/contextview/browser/contextMenuService.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextView.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextViewService.js +7 -2
- package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
- package/esm/vs/platform/editor/common/editor.js +17 -0
- package/esm/vs/platform/editor/common/editor.js.map +1 -1
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +6 -3
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +38 -6
- package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +32 -5
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
- package/esm/vs/platform/keybinding/common/keybindingResolver.js +1 -1
- package/esm/vs/platform/keybinding/common/keybindingResolver.js.map +1 -1
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +11 -8
- package/esm/vs/platform/markers/common/markerService.js.map +1 -1
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/markers/common/markers.js.map +1 -1
- package/esm/vs/platform/notification/common/notification.js.map +1 -1
- package/esm/vs/platform/notification/common/notificationMessage.js +37 -0
- package/esm/vs/platform/notification/common/notificationMessage.js.map +1 -0
- package/esm/vs/platform/opener/common/opener.js.map +1 -1
- package/esm/vs/platform/progress/common/progress.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +33 -2
- package/esm/vs/platform/quickinput/browser/quickAccess.js +7 -4
- package/esm/vs/platform/quickinput/browser/quickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +65 -15
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +96 -90
- package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputService.js +5 -7
- package/esm/vs/platform/quickinput/browser/quickInputService.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
- package/esm/vs/platform/quickinput/common/quickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/esm/vs/platform/storage/common/storage.js.map +1 -1
- package/esm/vs/platform/theme/common/colorRegistry.js +1 -0
- package/esm/vs/platform/theme/common/colorRegistry.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +11 -3
- package/esm/vs/platform/theme/common/colorUtils.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -9
- package/esm/vs/platform/theme/common/colors/chartsColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/confettiColors.js +14 -0
- package/esm/vs/platform/theme/common/colors/confettiColors.js.map +1 -0
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
- package/esm/vs/platform/theme/common/colors/inputColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
- package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +133 -98
- package/package.json +3 -3
- package/version.txt +1 -1
|
@@ -26,7 +26,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
26
26
|
'editor.codeActionWidget.showHeaders': {
|
|
27
27
|
type: 'boolean',
|
|
28
28
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
29
|
-
description: nls.localize(
|
|
29
|
+
description: nls.localize(918, "Enable/disable showing group headers in the Code Action menu."),
|
|
30
30
|
default: true,
|
|
31
31
|
},
|
|
32
32
|
}
|
|
@@ -37,7 +37,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
37
37
|
'editor.codeActionWidget.includeNearbyQuickFixes': {
|
|
38
38
|
type: 'boolean',
|
|
39
39
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
40
|
-
description: nls.localize(
|
|
40
|
+
description: nls.localize(919, "Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),
|
|
41
41
|
default: true,
|
|
42
42
|
},
|
|
43
43
|
}
|
|
@@ -48,7 +48,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
48
48
|
'editor.codeActions.triggerOnFocusChange': {
|
|
49
49
|
type: 'boolean',
|
|
50
50
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
51
|
-
markdownDescription: nls.localize(
|
|
51
|
+
markdownDescription: nls.localize(920, 'Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.', '`#editor.codeActionsOnSave#`', '`#files.autoSave#`', '`afterDelay`', '`always`'),
|
|
52
52
|
default: false,
|
|
53
53
|
},
|
|
54
54
|
}
|
|
@@ -287,7 +287,7 @@ let CodeActionController = class CodeActionController extends Disposable {
|
|
|
287
287
|
const diagnostic = diagnostics[0];
|
|
288
288
|
if (diagnostic.startLineNumber && diagnostic.startColumn) {
|
|
289
289
|
const selectionText = this._editor.getModel()?.getWordAtPosition({ lineNumber: diagnostic.startLineNumber, column: diagnostic.startColumn })?.word;
|
|
290
|
-
aria.status(localize(
|
|
290
|
+
aria.status(localize(921, "Context: {0} at line {1} and column {2}.", selectionText, diagnostic.startLineNumber, diagnostic.startColumn));
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
}
|
|
@@ -330,7 +330,7 @@ let CodeActionController = class CodeActionController extends Disposable {
|
|
|
330
330
|
if (options.includeDisabledActions && actions.validActions.length > 0 && actions.allActions.length !== actions.validActions.length) {
|
|
331
331
|
resultActions.push(this._showDisabled ? {
|
|
332
332
|
id: 'hideMoreActions',
|
|
333
|
-
label: localize(
|
|
333
|
+
label: localize(922, 'Hide Disabled'),
|
|
334
334
|
enabled: true,
|
|
335
335
|
tooltip: '',
|
|
336
336
|
class: undefined,
|
|
@@ -340,7 +340,7 @@ let CodeActionController = class CodeActionController extends Disposable {
|
|
|
340
340
|
}
|
|
341
341
|
} : {
|
|
342
342
|
id: 'showMoreActions',
|
|
343
|
-
label: localize(
|
|
343
|
+
label: localize(923, 'Show Disabled'),
|
|
344
344
|
enabled: true,
|
|
345
345
|
tooltip: '',
|
|
346
346
|
class: undefined,
|
|
@@ -8,15 +8,15 @@ import { CodeActionKind } from '../common/types.js';
|
|
|
8
8
|
import '../../symbolIcons/browser/symbolIcons.js'; // The codicon symbol colors are defined here and must be loaded to get colors
|
|
9
9
|
import { localize } from '../../../../nls.js';
|
|
10
10
|
import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';
|
|
11
|
-
const uncategorizedCodeActionGroup = Object.freeze({ kind: HierarchicalKind.Empty, title: localize(
|
|
11
|
+
const uncategorizedCodeActionGroup = Object.freeze({ kind: HierarchicalKind.Empty, title: localize(924, 'More Actions...') });
|
|
12
12
|
const codeActionGroups = Object.freeze([
|
|
13
|
-
{ kind: CodeActionKind.QuickFix, title: localize(
|
|
14
|
-
{ kind: CodeActionKind.RefactorExtract, title: localize(
|
|
15
|
-
{ kind: CodeActionKind.RefactorInline, title: localize(
|
|
16
|
-
{ kind: CodeActionKind.RefactorRewrite, title: localize(
|
|
17
|
-
{ kind: CodeActionKind.RefactorMove, title: localize(
|
|
18
|
-
{ kind: CodeActionKind.SurroundWith, title: localize(
|
|
19
|
-
{ kind: CodeActionKind.Source, title: localize(
|
|
13
|
+
{ kind: CodeActionKind.QuickFix, title: localize(925, 'Quick Fix') },
|
|
14
|
+
{ kind: CodeActionKind.RefactorExtract, title: localize(926, 'Extract'), icon: Codicon.wrench },
|
|
15
|
+
{ kind: CodeActionKind.RefactorInline, title: localize(927, 'Inline'), icon: Codicon.wrench },
|
|
16
|
+
{ kind: CodeActionKind.RefactorRewrite, title: localize(928, 'Rewrite'), icon: Codicon.wrench },
|
|
17
|
+
{ kind: CodeActionKind.RefactorMove, title: localize(929, 'Move'), icon: Codicon.wrench },
|
|
18
|
+
{ kind: CodeActionKind.SurroundWith, title: localize(930, 'Surround With'), icon: Codicon.surroundWith },
|
|
19
|
+
{ kind: CodeActionKind.Source, title: localize(931, 'Source Action'), icon: Codicon.symbolFile },
|
|
20
20
|
uncategorizedCodeActionGroup,
|
|
21
21
|
]);
|
|
22
22
|
export function toMenuItems(inputCodeActions, showHeaders, keybindingResolver) {
|
|
@@ -172,7 +172,7 @@ export class CodeActionModel extends Disposable {
|
|
|
172
172
|
const model = this._editor.getModel();
|
|
173
173
|
if (model
|
|
174
174
|
&& this._registry.has(model)
|
|
175
|
-
&& !this._editor.getOption(
|
|
175
|
+
&& !this._editor.getOption(106 /* EditorOption.readOnly */)) {
|
|
176
176
|
const supportedActions = this._registry.all(model).flatMap(provider => provider.providedCodeActionKinds ?? []);
|
|
177
177
|
this._supportedCodeActions.set(supportedActions.join(' '));
|
|
178
178
|
const oracle = new CodeActionOracle(this._editor, this._markerService, trigger => {
|
|
@@ -29,11 +29,11 @@ import * as nls from '../../../../nls.js';
|
|
|
29
29
|
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
|
|
30
30
|
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
|
|
31
31
|
import { Range } from '../../../common/core/range.js';
|
|
32
|
-
const GUTTER_LIGHTBULB_ICON = registerIcon('gutter-lightbulb', Codicon.lightBulb, nls.localize(
|
|
33
|
-
const GUTTER_LIGHTBULB_AUTO_FIX_ICON = registerIcon('gutter-lightbulb-auto-fix', Codicon.lightbulbAutofix, nls.localize(
|
|
34
|
-
const GUTTER_LIGHTBULB_AIFIX_ICON = registerIcon('gutter-lightbulb-sparkle', Codicon.lightbulbSparkle, nls.localize(
|
|
35
|
-
const GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON = registerIcon('gutter-lightbulb-aifix-auto-fix', Codicon.lightbulbSparkleAutofix, nls.localize(
|
|
36
|
-
const GUTTER_SPARKLE_FILLED_ICON = registerIcon('gutter-lightbulb-sparkle-filled', Codicon.sparkleFilled, nls.localize(
|
|
32
|
+
const GUTTER_LIGHTBULB_ICON = registerIcon('gutter-lightbulb', Codicon.lightBulb, nls.localize(932, 'Icon which spawns code actions menu from the gutter when there is no space in the editor.'));
|
|
33
|
+
const GUTTER_LIGHTBULB_AUTO_FIX_ICON = registerIcon('gutter-lightbulb-auto-fix', Codicon.lightbulbAutofix, nls.localize(933, 'Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.'));
|
|
34
|
+
const GUTTER_LIGHTBULB_AIFIX_ICON = registerIcon('gutter-lightbulb-sparkle', Codicon.lightbulbSparkle, nls.localize(934, 'Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.'));
|
|
35
|
+
const GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON = registerIcon('gutter-lightbulb-aifix-auto-fix', Codicon.lightbulbSparkleAutofix, nls.localize(935, 'Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.'));
|
|
36
|
+
const GUTTER_SPARKLE_FILLED_ICON = registerIcon('gutter-lightbulb-sparkle-filled', Codicon.sparkleFilled, nls.localize(936, 'Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.'));
|
|
37
37
|
var LightBulbState;
|
|
38
38
|
(function (LightBulbState) {
|
|
39
39
|
LightBulbState.Hidden = { type: 0 /* Type.Hidden */ };
|
|
@@ -76,16 +76,16 @@ export function computeLightBulbInfo(actions, trigger, preferredKbLabel, quickFi
|
|
|
76
76
|
}
|
|
77
77
|
let title;
|
|
78
78
|
if (autoRun) {
|
|
79
|
-
title = nls.localize(
|
|
79
|
+
title = nls.localize(937, "Run: {0}", actions.validActions[0].action.title);
|
|
80
80
|
}
|
|
81
81
|
else if (actions.hasAutoFix && preferredKbLabel) {
|
|
82
|
-
title = nls.localize(
|
|
82
|
+
title = nls.localize(938, "Show Code Actions. Preferred Quick Fix Available ({0})", preferredKbLabel);
|
|
83
83
|
}
|
|
84
84
|
else if (!actions.hasAutoFix && quickFixKbLabel) {
|
|
85
|
-
title = nls.localize(
|
|
85
|
+
title = nls.localize(939, "Show Code Actions ({0})", quickFixKbLabel);
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
title = nls.localize(
|
|
88
|
+
title = nls.localize(940, "Show Code Actions");
|
|
89
89
|
}
|
|
90
90
|
return { actions, trigger, icon, autoRun, title, isGutter: forGutter };
|
|
91
91
|
}
|
|
@@ -405,7 +405,7 @@ registerEditorAction(class ShowLensesInCurrentLine extends EditorAction {
|
|
|
405
405
|
super({
|
|
406
406
|
id: 'codelens.showLensesInCurrentLine',
|
|
407
407
|
precondition: EditorContextKeys.hasCodeLensProvider,
|
|
408
|
-
label: localize2(
|
|
408
|
+
label: localize2(942, "Show CodeLens Commands for Current Line"),
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
async run(accessor, editor) {
|
|
@@ -440,7 +440,7 @@ registerEditorAction(class ShowLensesInCurrentLine extends EditorAction {
|
|
|
440
440
|
}
|
|
441
441
|
const item = await quickInputService.pick(items, {
|
|
442
442
|
canPickMany: false,
|
|
443
|
-
placeHolder: localize(
|
|
443
|
+
placeHolder: localize(941, "Select a command")
|
|
444
444
|
});
|
|
445
445
|
if (!item) {
|
|
446
446
|
// Nothing picked
|
|
@@ -43,15 +43,9 @@ let ColorDetector = class ColorDetector extends Disposable {
|
|
|
43
43
|
this._colorDatas = new Map();
|
|
44
44
|
this._decoratorLimitReporter = this._register(new DecoratorLimitReporter());
|
|
45
45
|
this._colorDecorationClassRefs = this._register(new DisposableStore());
|
|
46
|
+
this._hasDecoratorSizeProperties = false;
|
|
46
47
|
this._colorDecoratorIds = this._editor.createDecorationsCollection();
|
|
47
48
|
this._ruleFactory = this._register(new DynamicCssRules(this._editor));
|
|
48
|
-
const editorDomNode = this._editor.getContainerDomNode();
|
|
49
|
-
editorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorWidth', `${ColorDetector_1.colorDecoratorInnerWidthInEm}em`);
|
|
50
|
-
editorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorMargin', `${ColorDetector_1.colorDecoratorMarginInEm}em`);
|
|
51
|
-
this._register(toDisposable(() => {
|
|
52
|
-
editorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorWidth');
|
|
53
|
-
editorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorMargin');
|
|
54
|
-
}));
|
|
55
49
|
this._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector_1.RECOMPUTE_TIME });
|
|
56
50
|
this._register(_editor.onDidChangeModel(() => {
|
|
57
51
|
this._isColorDecoratorsEnabled = this.isEnabled();
|
|
@@ -62,9 +56,9 @@ let ColorDetector = class ColorDetector extends Disposable {
|
|
|
62
56
|
this._register(_editor.onDidChangeConfiguration((e) => {
|
|
63
57
|
const prevIsEnabled = this._isColorDecoratorsEnabled;
|
|
64
58
|
this._isColorDecoratorsEnabled = this.isEnabled();
|
|
65
|
-
this._defaultColorDecoratorsEnablement = this._editor.getOption(
|
|
59
|
+
this._defaultColorDecoratorsEnablement = this._editor.getOption(171 /* EditorOption.defaultColorDecorators */);
|
|
66
60
|
const updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(27 /* EditorOption.colorDecoratorsLimit */);
|
|
67
|
-
const updatedDefaultColorDecoratorsSetting = e.hasChanged(
|
|
61
|
+
const updatedDefaultColorDecoratorsSetting = e.hasChanged(171 /* EditorOption.defaultColorDecorators */);
|
|
68
62
|
if (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {
|
|
69
63
|
if (this._isColorDecoratorsEnabled) {
|
|
70
64
|
this.updateColors();
|
|
@@ -77,7 +71,7 @@ let ColorDetector = class ColorDetector extends Disposable {
|
|
|
77
71
|
this._timeoutTimer = null;
|
|
78
72
|
this._computePromise = null;
|
|
79
73
|
this._isColorDecoratorsEnabled = this.isEnabled();
|
|
80
|
-
this._defaultColorDecoratorsEnablement = this._editor.getOption(
|
|
74
|
+
this._defaultColorDecoratorsEnablement = this._editor.getOption(171 /* EditorOption.defaultColorDecorators */);
|
|
81
75
|
this.updateColors();
|
|
82
76
|
}
|
|
83
77
|
isEnabled() {
|
|
@@ -207,8 +201,29 @@ let ColorDetector = class ColorDetector extends Disposable {
|
|
|
207
201
|
}
|
|
208
202
|
const limited = limit < colorData.length ? limit : false;
|
|
209
203
|
this._decoratorLimitReporter.update(colorData.length, limited);
|
|
204
|
+
if (decorations.length > 0) {
|
|
205
|
+
this.ensureDecoratorSizeProperties();
|
|
206
|
+
}
|
|
210
207
|
this._colorDecoratorIds.set(decorations);
|
|
211
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Custom properties are inherited, so setting them on the editor container restyles every
|
|
211
|
+
* rendered line. This contribution is created after the first render, so only pay that cost
|
|
212
|
+
* once the editor actually shows color decorators.
|
|
213
|
+
*/
|
|
214
|
+
ensureDecoratorSizeProperties() {
|
|
215
|
+
if (this._hasDecoratorSizeProperties) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
this._hasDecoratorSizeProperties = true;
|
|
219
|
+
const editorDomNode = this._editor.getContainerDomNode();
|
|
220
|
+
editorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorWidth', `${ColorDetector_1.colorDecoratorInnerWidthInEm}em`);
|
|
221
|
+
editorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorMargin', `${ColorDetector_1.colorDecoratorMarginInEm}em`);
|
|
222
|
+
this._register(toDisposable(() => {
|
|
223
|
+
editorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorWidth');
|
|
224
|
+
editorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorMargin');
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
212
227
|
removeAllDecorations() {
|
|
213
228
|
this._editor.removeDecorations(this._decorationsIds);
|
|
214
229
|
this._decorationsIds = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorDetector.ts","vs/editor/contrib/colorPicker/browser/colorDetector.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAqB,uBAAuB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAGtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAA+B,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACnI,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,SAAS,EAAc,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAEnG,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAG5D,IAAM,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,+BAA+B,CAAA;GA9BrB,aAAa,CA2PzB;;AAED,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAAtD;;QACS,iBAAY,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,OAAO,EAAQ,CAAC,CAAC;QAEnD,cAAS,GAAW,CAAC,CAAC;QACtB,aAAQ,GAAmB,KAAK,CAAC;IAQ1C,CAAC;IAPO,MAAM,CAAC,QAAgB,EAAE,OAAuB;QACtD,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS,IAAI,OAAO,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC9D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1B,CAAC;IACF,CAAC;CACD","file":"colorDetector.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tprivate static readonly colorDecoratorInnerWidthInEm = 0.8;\n\tprivate static readonly colorDecoratorMarginInEm = 0.2;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tconst editorDomNode = this._editor.getContainerDomNode();\n\t\teditorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorWidth', `${ColorDetector.colorDecoratorInnerWidthInEm}em`);\n\t\teditorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorMargin', `${ColorDetector.colorDecoratorMarginInEm}em`);\n\t\tthis._register(toDisposable(() => {\n\t\t\teditorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorWidth');\n\t\t\teditorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorMargin');\n\t\t}));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\tthis.removeAllDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\t\tconst widthInEm = ColorDetector.colorDecoratorInnerWidthInEm + 2 * ColorDetector.colorDecoratorMarginInEm;\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker,\n\t\t\t\t\t\twidthInEm,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tprivate static readonly colorDecoratorInnerWidthInEm = 0.8;\n\tprivate static readonly colorDecoratorMarginInEm = 0.2;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tconst editorDomNode = this._editor.getContainerDomNode();\n\t\teditorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorWidth', `${ColorDetector.colorDecoratorInnerWidthInEm}em`);\n\t\teditorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorMargin', `${ColorDetector.colorDecoratorMarginInEm}em`);\n\t\tthis._register(toDisposable(() => {\n\t\t\teditorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorWidth');\n\t\t\teditorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorMargin');\n\t\t}));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\tthis.removeAllDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\t\tconst widthInEm = ColorDetector.colorDecoratorInnerWidthInEm + 2 * ColorDetector.colorDecoratorMarginInEm;\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker,\n\t\t\t\t\t\twidthInEm,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorDetector.ts","vs/editor/contrib/colorPicker/browser/colorDetector.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAqB,uBAAuB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,KAAK,EAAE,MAAM,+B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/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tprivate static readonly colorDecoratorInnerWidthInEm = 0.8;\n\tprivate static readonly colorDecoratorMarginInEm = 0.2;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\tthis.removeAllDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\t\tconst widthInEm = ColorDetector.colorDecoratorInnerWidthInEm + 2 * ColorDetector.colorDecoratorMarginInEm;\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker,\n\t\t\t\t\t\twidthInEm,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tif (decorations.length > 0) {\n\t\t\tthis.ensureDecoratorSizeProperties();\n\t\t}\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate _hasDecoratorSizeProperties = false;\n\n\t/**\n\t * Custom properties are inherited, so setting them on the editor container restyles every\n\t * rendered line. This contribution is created after the first render, so only pay that cost\n\t * once the editor actually shows color decorators.\n\t */\n\tprivate ensureDecoratorSizeProperties(): void {\n\t\tif (this._hasDecoratorSizeProperties) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasDecoratorSizeProperties = true;\n\t\tconst editorDomNode = this._editor.getContainerDomNode();\n\t\teditorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorWidth', `${ColorDetector.colorDecoratorInnerWidthInEm}em`);\n\t\teditorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorMargin', `${ColorDetector.colorDecoratorMarginInEm}em`);\n\t\tthis._register(toDisposable(() => {\n\t\t\teditorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorWidth');\n\t\t\teditorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorMargin');\n\t\t}));\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tprivate static readonly colorDecoratorInnerWidthInEm = 0.8;\n\tprivate static readonly colorDecoratorMarginInEm = 0.2;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\tthis.removeAllDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\t\tconst widthInEm = ColorDetector.colorDecoratorInnerWidthInEm + 2 * ColorDetector.colorDecoratorMarginInEm;\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker,\n\t\t\t\t\t\twidthInEm,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tif (decorations.length > 0) {\n\t\t\tthis.ensureDecoratorSizeProperties();\n\t\t}\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate _hasDecoratorSizeProperties = false;\n\n\t/**\n\t * Custom properties are inherited, so setting them on the editor container restyles every\n\t * rendered line. This contribution is created after the first render, so only pay that cost\n\t * once the editor actually shows color decorators.\n\t */\n\tprivate ensureDecoratorSizeProperties(): void {\n\t\tif (this._hasDecoratorSizeProperties) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasDecoratorSizeProperties = true;\n\t\tconst editorDomNode = this._editor.getContainerDomNode();\n\t\teditorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorWidth', `${ColorDetector.colorDecoratorInnerWidthInEm}em`);\n\t\teditorDomNode.style.setProperty('--vscode-colorPicker-colorDecoratorMargin', `${ColorDetector.colorDecoratorMarginInEm}em`);\n\t\tthis._register(toDisposable(() => {\n\t\t\teditorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorWidth');\n\t\t\teditorDomNode.style.removeProperty('--vscode-colorPicker-colorDecoratorMargin');\n\t\t}));\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n"]}
|
package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js
CHANGED
|
@@ -22,7 +22,7 @@ export class CloseButton extends Disposable {
|
|
|
22
22
|
const innerDiv = document.createElement('div');
|
|
23
23
|
innerDiv.classList.add('close-button-inner-div');
|
|
24
24
|
dom.append(this._button, innerDiv);
|
|
25
|
-
const closeButton = dom.append(innerDiv, $('.button' + ThemeIcon.asCSSSelector(registerIcon('color-picker-close', Codicon.close, localize(
|
|
25
|
+
const closeButton = dom.append(innerDiv, $('.button' + ThemeIcon.asCSSSelector(registerIcon('color-picker-close', Codicon.close, localize(943, 'Icon to close the color picker')))));
|
|
26
26
|
closeButton.classList.add('close-icon');
|
|
27
27
|
this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => {
|
|
28
28
|
this._onClicked.fire();
|
|
@@ -22,7 +22,7 @@ export class ColorPickerHeader extends Disposable {
|
|
|
22
22
|
dom.append(this._pickedColorNode, $('span.codicon.codicon-color-mode'));
|
|
23
23
|
this._pickedColorPresentation = dom.append(this._pickedColorNode, document.createElement('span'));
|
|
24
24
|
this._pickedColorPresentation.classList.add('picked-color-presentation');
|
|
25
|
-
const tooltip = localize(
|
|
25
|
+
const tooltip = localize(944, "Click to toggle color options (rgb/hsl/hex)");
|
|
26
26
|
this._pickedColorNode.setAttribute('title', tooltip);
|
|
27
27
|
this._originalColorNode = dom.append(this._domNode, $('.original-color'));
|
|
28
28
|
this._originalColorNode.style.backgroundColor = Color.Format.CSS.format(this.model.originalColor) || '';
|
package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js
CHANGED
|
@@ -17,7 +17,7 @@ export class HoverColorPickerContribution extends Disposable {
|
|
|
17
17
|
super.dispose();
|
|
18
18
|
}
|
|
19
19
|
onMouseDown(mouseEvent) {
|
|
20
|
-
const colorDecoratorsActivatedOn = this._editor.getOption(
|
|
20
|
+
const colorDecoratorsActivatedOn = this._editor.getOption(172 /* EditorOption.colorDecoratorsActivatedOn */);
|
|
21
21
|
if (colorDecoratorsActivatedOn !== 'click' && colorDecoratorsActivatedOn !== 'clickAndHover') {
|
|
22
22
|
return;
|
|
23
23
|
}
|
package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js
CHANGED
|
@@ -78,7 +78,7 @@ let HoverColorPickerParticipant = class HoverColorPickerParticipant {
|
|
|
78
78
|
return [];
|
|
79
79
|
}
|
|
80
80
|
_isValidRequest(source) {
|
|
81
|
-
const decoratorActivatedOn = this._editor.getOption(
|
|
81
|
+
const decoratorActivatedOn = this._editor.getOption(172 /* EditorOption.colorDecoratorsActivatedOn */);
|
|
82
82
|
switch (source) {
|
|
83
83
|
case 0 /* HoverStartSource.Mouse */:
|
|
84
84
|
return decoratorActivatedOn === 'hover' || decoratorActivatedOn === 'clickAndHover';
|
|
@@ -99,7 +99,7 @@ let HoverColorPickerParticipant = class HoverColorPickerParticipant {
|
|
|
99
99
|
const colorHover = hoverParts[0];
|
|
100
100
|
const editorModel = editor.getModel();
|
|
101
101
|
const model = colorHover.model;
|
|
102
|
-
this._colorPicker = disposables.add(new ColorPickerWidget(context.fragment, model, editor.getOption(
|
|
102
|
+
this._colorPicker = disposables.add(new ColorPickerWidget(context.fragment, model, editor.getOption(167 /* EditorOption.pixelRatio */), this._themeService, "hover" /* ColorPickerWidgetType.Hover */));
|
|
103
103
|
let editorUpdatedByColorPicker = false;
|
|
104
104
|
let range = new Range(colorHover.range.startLineNumber, colorHover.range.startColumn, colorHover.range.endLineNumber, colorHover.range.endColumn);
|
|
105
105
|
disposables.add(model.onColorFlushed(async (color) => {
|
|
@@ -127,7 +127,7 @@ let HoverColorPickerParticipant = class HoverColorPickerParticipant {
|
|
|
127
127
|
return new RenderedHoverParts([renderedHoverPart]);
|
|
128
128
|
}
|
|
129
129
|
getAccessibleContent(hoverPart) {
|
|
130
|
-
return nls.localize(
|
|
130
|
+
return nls.localize(945, 'There is a color picker here.');
|
|
131
131
|
}
|
|
132
132
|
handleResize() {
|
|
133
133
|
this._colorPicker?.layout();
|
|
@@ -12,15 +12,15 @@ export class ShowOrFocusStandaloneColorPicker extends EditorAction2 {
|
|
|
12
12
|
super({
|
|
13
13
|
id: 'editor.action.showOrFocusStandaloneColorPicker',
|
|
14
14
|
title: {
|
|
15
|
-
...localize2(
|
|
16
|
-
mnemonicTitle: localize(
|
|
15
|
+
...localize2(947, "Show or Focus Standalone Color Picker"),
|
|
16
|
+
mnemonicTitle: localize(946, "&&Show or Focus Standalone Color Picker"),
|
|
17
17
|
},
|
|
18
18
|
precondition: undefined,
|
|
19
19
|
menu: [
|
|
20
20
|
{ id: MenuId.CommandPalette },
|
|
21
21
|
],
|
|
22
22
|
metadata: {
|
|
23
|
-
description: localize2(
|
|
23
|
+
description: localize2(948, "Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors."),
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
}
|
|
@@ -32,7 +32,7 @@ export class HideStandaloneColorPicker extends EditorAction {
|
|
|
32
32
|
constructor() {
|
|
33
33
|
super({
|
|
34
34
|
id: 'editor.action.hideColorPicker',
|
|
35
|
-
label: localize2(
|
|
35
|
+
label: localize2(949, "Hide the Color Picker"),
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,7 +44,7 @@ export class HideStandaloneColorPicker extends EditorAction {
|
|
|
44
44
|
weight: 100 /* KeybindingWeight.EditorContrib */
|
|
45
45
|
},
|
|
46
46
|
metadata: {
|
|
47
|
-
description: localize2(
|
|
47
|
+
description: localize2(950, "Hide the standalone color picker."),
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -56,7 +56,7 @@ export class InsertColorWithStandaloneColorPicker extends EditorAction {
|
|
|
56
56
|
constructor() {
|
|
57
57
|
super({
|
|
58
58
|
id: 'editor.action.insertColorWithStandaloneColorPicker',
|
|
59
|
-
label: localize2(
|
|
59
|
+
label: localize2(951, "Insert Color with Standalone Color Picker"),
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
@@ -68,7 +68,7 @@ export class InsertColorWithStandaloneColorPicker extends EditorAction {
|
|
|
68
68
|
weight: 100 /* KeybindingWeight.EditorContrib */
|
|
69
69
|
},
|
|
70
70
|
metadata: {
|
|
71
|
-
description: localize2(
|
|
71
|
+
description: localize2(952, "Insert hex/rgb/hsl colors with the focused standalone color picker."),
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
}
|
|
@@ -37,7 +37,7 @@ export class StandaloneColorPickerRenderedParts extends Disposable {
|
|
|
37
37
|
const editorModel = editor.getModel();
|
|
38
38
|
const colorPickerModel = colorHover.model;
|
|
39
39
|
this.color = colorHover.model.color;
|
|
40
|
-
this.colorPicker = this._register(new ColorPickerWidget(context.fragment, colorPickerModel, editor.getOption(
|
|
40
|
+
this.colorPicker = this._register(new ColorPickerWidget(context.fragment, colorPickerModel, editor.getOption(167 /* EditorOption.pixelRatio */), themeService, "standalone" /* ColorPickerWidgetType.Standalone */));
|
|
41
41
|
this._register(colorPickerModel.onColorFlushed((color) => {
|
|
42
42
|
this.color = color;
|
|
43
43
|
}));
|
|
@@ -56,7 +56,7 @@ class ToggleCommentLineAction extends CommentLineAction {
|
|
|
56
56
|
constructor() {
|
|
57
57
|
super(0 /* Type.Toggle */, {
|
|
58
58
|
id: 'editor.action.commentLine',
|
|
59
|
-
label: nls.localize2(
|
|
59
|
+
label: nls.localize2(955, "Toggle Line Comment"),
|
|
60
60
|
precondition: EditorContextKeys.writable,
|
|
61
61
|
kbOpts: {
|
|
62
62
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -66,7 +66,7 @@ class ToggleCommentLineAction extends CommentLineAction {
|
|
|
66
66
|
menuOpts: {
|
|
67
67
|
menuId: MenuId.MenubarEditMenu,
|
|
68
68
|
group: '5_insert',
|
|
69
|
-
title: nls.localize(
|
|
69
|
+
title: nls.localize(953, "&&Toggle Line Comment"),
|
|
70
70
|
order: 1
|
|
71
71
|
},
|
|
72
72
|
canTriggerInlineEdits: true,
|
|
@@ -77,7 +77,7 @@ class AddLineCommentAction extends CommentLineAction {
|
|
|
77
77
|
constructor() {
|
|
78
78
|
super(1 /* Type.ForceAdd */, {
|
|
79
79
|
id: 'editor.action.addCommentLine',
|
|
80
|
-
label: nls.localize2(
|
|
80
|
+
label: nls.localize2(956, "Add Line Comment"),
|
|
81
81
|
precondition: EditorContextKeys.writable,
|
|
82
82
|
kbOpts: {
|
|
83
83
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -92,7 +92,7 @@ class RemoveLineCommentAction extends CommentLineAction {
|
|
|
92
92
|
constructor() {
|
|
93
93
|
super(2 /* Type.ForceRemove */, {
|
|
94
94
|
id: 'editor.action.removeCommentLine',
|
|
95
|
-
label: nls.localize2(
|
|
95
|
+
label: nls.localize2(957, "Remove Line Comment"),
|
|
96
96
|
precondition: EditorContextKeys.writable,
|
|
97
97
|
kbOpts: {
|
|
98
98
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -107,7 +107,7 @@ class BlockCommentAction extends EditorAction {
|
|
|
107
107
|
constructor() {
|
|
108
108
|
super({
|
|
109
109
|
id: 'editor.action.blockComment',
|
|
110
|
-
label: nls.localize2(
|
|
110
|
+
label: nls.localize2(958, "Toggle Block Comment"),
|
|
111
111
|
precondition: EditorContextKeys.writable,
|
|
112
112
|
kbOpts: {
|
|
113
113
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -118,7 +118,7 @@ class BlockCommentAction extends EditorAction {
|
|
|
118
118
|
menuOpts: {
|
|
119
119
|
menuId: MenuId.MenubarEditMenu,
|
|
120
120
|
group: '5_insert',
|
|
121
|
-
title: nls.localize(
|
|
121
|
+
title: nls.localize(954, "Toggle &&Block Comment"),
|
|
122
122
|
order: 2
|
|
123
123
|
},
|
|
124
124
|
canTriggerInlineEdits: true,
|