monaco-editor-core 0.55.1 → 0.56.0-dev-20251122
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 +29 -8
- package/esm/vs/base/browser/dom.js +31 -34
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +0 -1
- package/esm/vs/base/browser/keyboardEvent.js +3 -3
- package/esm/vs/base/browser/keyboardEvent.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +5 -2
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/pixelRatio.js +5 -5
- package/esm/vs/base/browser/pixelRatio.js.map +1 -1
- package/esm/vs/base/browser/trustedTypes.js +1 -1
- package/esm/vs/base/browser/trustedTypes.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.js +3 -0
- package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +7 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hoverWidget.css +0 -13
- package/esm/vs/base/browser/ui/inputbox/inputBox.js +7 -0
- package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
- package/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css +4 -2
- package/esm/vs/base/browser/ui/list/listView.js +7 -2
- package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
- package/esm/vs/base/browser/ui/list/rowCache.js +1 -4
- package/esm/vs/base/browser/ui/list/rowCache.js.map +1 -1
- package/esm/vs/base/browser/ui/menu/menu.js +14 -12
- package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBox.js +4 -0
- package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.css +12 -32
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +8 -18
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +41 -14
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +11 -0
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +1 -0
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/dataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
- package/esm/vs/base/common/arrays.js +10 -0
- package/esm/vs/base/common/arrays.js.map +1 -1
- package/esm/vs/base/common/async.js +34 -0
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/buffer.js +1 -1
- package/esm/vs/base/common/buffer.js.map +1 -1
- package/esm/vs/base/common/cancellation.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +3 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/collections.js.map +1 -1
- package/esm/vs/base/common/equals.js.map +1 -1
- package/esm/vs/base/common/event.js +32 -15
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/filters.js +22 -3
- package/esm/vs/base/common/filters.js.map +1 -1
- package/esm/vs/base/common/hotReload.js +2 -2
- package/esm/vs/base/common/hotReload.js.map +1 -1
- package/esm/vs/base/common/iterator.js +1 -1
- package/esm/vs/base/common/iterator.js.map +1 -1
- package/esm/vs/base/common/keyCodes.js +7 -6
- package/esm/vs/base/common/keyCodes.js.map +1 -1
- package/esm/vs/base/common/linkedList.js.map +1 -1
- package/esm/vs/base/common/map.js +8 -5
- package/esm/vs/base/common/map.js.map +1 -1
- package/esm/vs/base/common/marked/marked.js +0 -1
- package/esm/vs/base/common/network.js +26 -1
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/normalization.js +19 -6
- package/esm/vs/base/common/normalization.js.map +1 -1
- package/esm/vs/base/common/observableInternal/debugLocation.js +1 -2
- package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
- package/esm/vs/base/common/observableInternal/debugName.js +0 -1
- package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +4 -4
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js +38 -10
- package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/baseObservable.js +3 -3
- package/esm/vs/base/common/observableInternal/observables/baseObservable.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +1 -4
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/utils/utils.js +46 -5
- package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
- package/esm/vs/base/common/path.js +1 -0
- package/esm/vs/base/common/path.js.map +1 -1
- package/esm/vs/base/common/strings.js +27 -19
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/base/common/worker/webWorker.js +10 -7
- package/esm/vs/base/common/worker/webWorker.js.map +1 -1
- package/esm/vs/editor/browser/config/elementSizeObserver.js +5 -5
- package/esm/vs/editor/browser/config/elementSizeObserver.js.map +1 -1
- package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
- package/esm/vs/editor/browser/config/migrateOptions.js +6 -0
- package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
- package/esm/vs/editor/browser/config/tabFocus.js +4 -2
- package/esm/vs/editor/browser/config/tabFocus.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -0
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/coreCommands.js +1 -2
- package/esm/vs/editor/browser/coreCommands.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +32 -1
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/services/contribution.js +9 -0
- package/esm/vs/editor/browser/services/contribution.js.map +1 -0
- package/esm/vs/editor/browser/services/editorWorkerService.js +27 -14
- package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
- package/esm/vs/editor/browser/services/openerService.js +5 -1
- package/esm/vs/editor/browser/services/openerService.js.map +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
- package/esm/vs/editor/browser/view/renderingContext.js +1 -1
- package/esm/vs/editor/browser/view/renderingContext.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +10 -3
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +3 -4
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js +1 -1
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +1 -1
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +4 -2
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js +1 -3
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js +2 -1
- package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +6 -18
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +0 -7
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +7 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js.map +1 -1
- package/esm/vs/editor/common/commands/replaceCommand.js +2 -2
- package/esm/vs/editor/common/commands/replaceCommand.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +374 -360
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/2d/rect.js +7 -0
- package/esm/vs/editor/common/core/2d/rect.js.map +1 -1
- package/esm/vs/editor/common/core/2d/size.js +20 -0
- package/esm/vs/editor/common/core/2d/size.js.map +1 -0
- package/esm/vs/editor/common/core/editorColorRegistry.js +69 -68
- package/esm/vs/editor/common/core/editorColorRegistry.js.map +1 -1
- package/esm/vs/editor/common/core/ranges/offsetRange.js +9 -0
- package/esm/vs/editor/common/core/ranges/offsetRange.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/editorContextKeys.js +47 -47
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/services/languagesAssociations.js +6 -8
- package/esm/vs/editor/common/services/languagesAssociations.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -10
- package/esm/vs/editor/common/standaloneStrings.js.map +1 -1
- package/esm/vs/editor/common/textModelEditSource.js +1 -1
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- 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 +17 -17
- 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/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelens.js.map +1 -1
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/codelens/browser/codelensController.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/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +14 -0
- package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- 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/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +17 -17
- package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/find/browser/findWidgetSearchHistory.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/replaceWidgetHistory.js.map +1 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- 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/format.js +21 -6
- package/esm/vs/editor/contrib/format/browser/format.js.map +1 -1
- 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/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- 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 +5 -10
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +11 -6
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.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/hoverUtils.js +24 -0
- package/esm/vs/editor/contrib/hover/browser/hoverUtils.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- 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/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +18 -16
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +42 -37
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +54 -43
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +74 -48
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +8 -36
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js +10 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +105 -119
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +8 -36
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js +95 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +17 -9
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +428 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +290 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js +103 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js +32 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +44 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +10 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +181 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -0
- 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 -31
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- 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/quickAccess/browser/editorNavigationQuickAccess.js +2 -2
- package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +18 -13
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +12 -12
- package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- 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/stickyScrollWidget.js +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.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 +29 -29
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +4 -4
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/esm/vs/editor/editor.all.js +1 -0
- package/esm/vs/editor/editor.all.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +9 -5
- package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js +22 -2
- package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +39 -0
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -0
- package/esm/vs/editor/standalone/browser/standaloneEditor.js +2 -1
- package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +3 -21
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneWebWorker.js +4 -4
- package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +7 -0
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +7 -9
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +2 -0
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configuration.js +5 -4
- package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationModels.js +21 -10
- package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +3 -3
- package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +17 -8
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/list/browser/listService.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +51 -39
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +9 -3
- 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 +35 -14
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +4 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.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/quickInputTreeController.js +78 -39
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +21 -8
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
- package/esm/vs/platform/telemetry/common/gdprTypings.js.map +1 -1
- package/esm/vs/platform/telemetry/common/telemetry.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/editorColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- 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 +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/miscColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- 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/webWorker/browser/webWorkerDescriptor.js +12 -0
- package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js.map +1 -0
- package/esm/vs/platform/webWorker/browser/webWorkerService.js +7 -0
- package/esm/vs/platform/webWorker/browser/webWorkerService.js.map +1 -0
- package/esm/vs/{base/browser/webWorkerFactory.js → platform/webWorker/browser/webWorkerServiceImpl.js} +47 -66
- package/esm/vs/platform/webWorker/browser/webWorkerServiceImpl.js.map +1 -0
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +9 -5
- package/package.json +2 -2
- package/esm/vs/base/browser/webWorkerFactory.js.map +0 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +0 -82
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js.map +0 -1
|
@@ -32,7 +32,7 @@ function announceCursorChange(previousCursorState, cursorState) {
|
|
|
32
32
|
const cursorDiff = cursorState.filter(cs => !previousCursorState.find(pcs => pcs.equals(cs)));
|
|
33
33
|
if (cursorDiff.length >= 1) {
|
|
34
34
|
const cursorPositions = cursorDiff.map(cs => `line ${cs.viewState.position.lineNumber} column ${cs.viewState.position.column}`).join(', ');
|
|
35
|
-
const msg = cursorDiff.length === 1 ? nls.localize(
|
|
35
|
+
const msg = cursorDiff.length === 1 ? nls.localize(1294, "Cursor added: {0}", cursorPositions) : nls.localize(1295, "Cursors added: {0}", cursorPositions);
|
|
36
36
|
status(msg);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -40,7 +40,7 @@ export class InsertCursorAbove extends EditorAction {
|
|
|
40
40
|
constructor() {
|
|
41
41
|
super({
|
|
42
42
|
id: 'editor.action.insertCursorAbove',
|
|
43
|
-
label: nls.localize2(
|
|
43
|
+
label: nls.localize2(1304, "Add Cursor Above"),
|
|
44
44
|
precondition: undefined,
|
|
45
45
|
kbOpts: {
|
|
46
46
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -54,7 +54,7 @@ export class InsertCursorAbove extends EditorAction {
|
|
|
54
54
|
menuOpts: {
|
|
55
55
|
menuId: MenuId.MenubarSelectionMenu,
|
|
56
56
|
group: '3_multi',
|
|
57
|
-
title: nls.localize(
|
|
57
|
+
title: nls.localize(1296, "&&Add Cursor Above"),
|
|
58
58
|
order: 2
|
|
59
59
|
}
|
|
60
60
|
});
|
|
@@ -82,7 +82,7 @@ export class InsertCursorBelow extends EditorAction {
|
|
|
82
82
|
constructor() {
|
|
83
83
|
super({
|
|
84
84
|
id: 'editor.action.insertCursorBelow',
|
|
85
|
-
label: nls.localize2(
|
|
85
|
+
label: nls.localize2(1305, "Add Cursor Below"),
|
|
86
86
|
precondition: undefined,
|
|
87
87
|
kbOpts: {
|
|
88
88
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -96,7 +96,7 @@ export class InsertCursorBelow extends EditorAction {
|
|
|
96
96
|
menuOpts: {
|
|
97
97
|
menuId: MenuId.MenubarSelectionMenu,
|
|
98
98
|
group: '3_multi',
|
|
99
|
-
title: nls.localize(
|
|
99
|
+
title: nls.localize(1297, "A&&dd Cursor Below"),
|
|
100
100
|
order: 3
|
|
101
101
|
}
|
|
102
102
|
});
|
|
@@ -124,7 +124,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
|
|
|
124
124
|
constructor() {
|
|
125
125
|
super({
|
|
126
126
|
id: 'editor.action.insertCursorAtEndOfEachLineSelected',
|
|
127
|
-
label: nls.localize2(
|
|
127
|
+
label: nls.localize2(1306, "Add Cursors to Line Ends"),
|
|
128
128
|
precondition: undefined,
|
|
129
129
|
kbOpts: {
|
|
130
130
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -134,7 +134,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
|
|
|
134
134
|
menuOpts: {
|
|
135
135
|
menuId: MenuId.MenubarSelectionMenu,
|
|
136
136
|
group: '3_multi',
|
|
137
|
-
title: nls.localize(
|
|
137
|
+
title: nls.localize(1298, "Add C&&ursors to Line Ends"),
|
|
138
138
|
order: 4
|
|
139
139
|
}
|
|
140
140
|
});
|
|
@@ -171,7 +171,7 @@ class InsertCursorAtEndOfLineSelected extends EditorAction {
|
|
|
171
171
|
constructor() {
|
|
172
172
|
super({
|
|
173
173
|
id: 'editor.action.addCursorsToBottom',
|
|
174
|
-
label: nls.localize2(
|
|
174
|
+
label: nls.localize2(1307, "Add Cursors to Bottom"),
|
|
175
175
|
precondition: undefined
|
|
176
176
|
});
|
|
177
177
|
}
|
|
@@ -197,7 +197,7 @@ class InsertCursorAtTopOfLineSelected extends EditorAction {
|
|
|
197
197
|
constructor() {
|
|
198
198
|
super({
|
|
199
199
|
id: 'editor.action.addCursorsToTop',
|
|
200
|
-
label: nls.localize2(
|
|
200
|
+
label: nls.localize2(1308, "Add Cursors to Top"),
|
|
201
201
|
precondition: undefined
|
|
202
202
|
});
|
|
203
203
|
}
|
|
@@ -574,7 +574,7 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
|
|
|
574
574
|
constructor() {
|
|
575
575
|
super({
|
|
576
576
|
id: 'editor.action.addSelectionToNextFindMatch',
|
|
577
|
-
label: nls.localize2(
|
|
577
|
+
label: nls.localize2(1309, "Add Selection to Next Find Match"),
|
|
578
578
|
precondition: undefined,
|
|
579
579
|
kbOpts: {
|
|
580
580
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -584,7 +584,7 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
|
|
|
584
584
|
menuOpts: {
|
|
585
585
|
menuId: MenuId.MenubarSelectionMenu,
|
|
586
586
|
group: '3_multi',
|
|
587
|
-
title: nls.localize(
|
|
587
|
+
title: nls.localize(1299, "Add &&Next Occurrence"),
|
|
588
588
|
order: 5
|
|
589
589
|
}
|
|
590
590
|
});
|
|
@@ -597,12 +597,12 @@ export class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionC
|
|
|
597
597
|
constructor() {
|
|
598
598
|
super({
|
|
599
599
|
id: 'editor.action.addSelectionToPreviousFindMatch',
|
|
600
|
-
label: nls.localize2(
|
|
600
|
+
label: nls.localize2(1310, "Add Selection to Previous Find Match"),
|
|
601
601
|
precondition: undefined,
|
|
602
602
|
menuOpts: {
|
|
603
603
|
menuId: MenuId.MenubarSelectionMenu,
|
|
604
604
|
group: '3_multi',
|
|
605
|
-
title: nls.localize(
|
|
605
|
+
title: nls.localize(1300, "Add P&&revious Occurrence"),
|
|
606
606
|
order: 6
|
|
607
607
|
}
|
|
608
608
|
});
|
|
@@ -615,7 +615,7 @@ export class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionCont
|
|
|
615
615
|
constructor() {
|
|
616
616
|
super({
|
|
617
617
|
id: 'editor.action.moveSelectionToNextFindMatch',
|
|
618
|
-
label: nls.localize2(
|
|
618
|
+
label: nls.localize2(1311, "Move Last Selection to Next Find Match"),
|
|
619
619
|
precondition: undefined,
|
|
620
620
|
kbOpts: {
|
|
621
621
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -632,7 +632,7 @@ export class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelection
|
|
|
632
632
|
constructor() {
|
|
633
633
|
super({
|
|
634
634
|
id: 'editor.action.moveSelectionToPreviousFindMatch',
|
|
635
|
-
label: nls.localize2(
|
|
635
|
+
label: nls.localize2(1312, "Move Last Selection to Previous Find Match"),
|
|
636
636
|
precondition: undefined
|
|
637
637
|
});
|
|
638
638
|
}
|
|
@@ -644,7 +644,7 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
|
|
|
644
644
|
constructor() {
|
|
645
645
|
super({
|
|
646
646
|
id: 'editor.action.selectHighlights',
|
|
647
|
-
label: nls.localize2(
|
|
647
|
+
label: nls.localize2(1313, "Select All Occurrences of Find Match"),
|
|
648
648
|
precondition: undefined,
|
|
649
649
|
kbOpts: {
|
|
650
650
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -654,7 +654,7 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
|
|
|
654
654
|
menuOpts: {
|
|
655
655
|
menuId: MenuId.MenubarSelectionMenu,
|
|
656
656
|
group: '3_multi',
|
|
657
|
-
title: nls.localize(
|
|
657
|
+
title: nls.localize(1301, "Select All &&Occurrences"),
|
|
658
658
|
order: 7
|
|
659
659
|
}
|
|
660
660
|
});
|
|
@@ -667,7 +667,7 @@ export class CompatChangeAll extends MultiCursorSelectionControllerAction {
|
|
|
667
667
|
constructor() {
|
|
668
668
|
super({
|
|
669
669
|
id: 'editor.action.changeAll',
|
|
670
|
-
label: nls.localize2(
|
|
670
|
+
label: nls.localize2(1314, "Change All Occurrences"),
|
|
671
671
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.editorTextFocus),
|
|
672
672
|
kbOpts: {
|
|
673
673
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -925,9 +925,9 @@ export class FocusNextCursor extends EditorAction {
|
|
|
925
925
|
constructor() {
|
|
926
926
|
super({
|
|
927
927
|
id: 'editor.action.focusNextCursor',
|
|
928
|
-
label: nls.localize2(
|
|
928
|
+
label: nls.localize2(1315, "Focus Next Cursor"),
|
|
929
929
|
metadata: {
|
|
930
|
-
description: nls.localize(
|
|
930
|
+
description: nls.localize(1302, "Focuses the next cursor"),
|
|
931
931
|
args: [],
|
|
932
932
|
},
|
|
933
933
|
precondition: undefined
|
|
@@ -957,9 +957,9 @@ export class FocusPreviousCursor extends EditorAction {
|
|
|
957
957
|
constructor() {
|
|
958
958
|
super({
|
|
959
959
|
id: 'editor.action.focusPreviousCursor',
|
|
960
|
-
label: nls.localize2(
|
|
960
|
+
label: nls.localize2(1316, "Focus Previous Cursor"),
|
|
961
961
|
metadata: {
|
|
962
|
-
description: nls.localize(
|
|
962
|
+
description: nls.localize(1303, "Focuses the previous cursor"),
|
|
963
963
|
args: [],
|
|
964
964
|
},
|
|
965
965
|
precondition: undefined
|
|
@@ -67,7 +67,7 @@ export class TriggerParameterHintsAction extends EditorAction {
|
|
|
67
67
|
constructor() {
|
|
68
68
|
super({
|
|
69
69
|
id: 'editor.action.triggerParameterHints',
|
|
70
|
-
label: nls.localize2(
|
|
70
|
+
label: nls.localize2(1317, "Trigger Parameter Hints"),
|
|
71
71
|
precondition: EditorContextKeys.hasSignatureHelpProvider,
|
|
72
72
|
kbOpts: {
|
|
73
73
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -30,8 +30,8 @@ import { listHighlightForeground, registerColor } from '../../../../platform/the
|
|
|
30
30
|
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
|
|
31
31
|
import { ThemeIcon } from '../../../../base/common/themables.js';
|
|
32
32
|
const $ = dom.$;
|
|
33
|
-
const parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, nls.localize(
|
|
34
|
-
const parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, nls.localize(
|
|
33
|
+
const parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, nls.localize(1318, 'Icon for show next parameter hint.'));
|
|
34
|
+
const parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, nls.localize(1319, 'Icon for show previous parameter hint.'));
|
|
35
35
|
let ParameterHintsWidget = class ParameterHintsWidget extends Disposable {
|
|
36
36
|
static { ParameterHintsWidget_1 = this; }
|
|
37
37
|
static { this.ID = 'editor.widget.parameterHintsWidget'; }
|
|
@@ -206,7 +206,7 @@ let ParameterHintsWidget = class ParameterHintsWidget extends Disposable {
|
|
|
206
206
|
// Select method gets called on every user type while parameter hints are visible.
|
|
207
207
|
// We do not want to spam the user with same announcements, so we only announce if the current parameter changed.
|
|
208
208
|
if (this.announcedLabel !== labelToAnnounce) {
|
|
209
|
-
aria.alert(nls.localize(
|
|
209
|
+
aria.alert(nls.localize(1320, "{0}, hint", labelToAnnounce));
|
|
210
210
|
this.announcedLabel = labelToAnnounce;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
@@ -305,5 +305,5 @@ ParameterHintsWidget = ParameterHintsWidget_1 = __decorate([
|
|
|
305
305
|
__param(3, IMarkdownRendererService)
|
|
306
306
|
], ParameterHintsWidget);
|
|
307
307
|
export { ParameterHintsWidget };
|
|
308
|
-
registerColor('editorHoverWidget.highlightForeground', listHighlightForeground, nls.localize(
|
|
308
|
+
registerColor('editorHoverWidget.highlightForeground', listHighlightForeground, nls.localize(1321, 'Foreground color of the active item in the parameter hint.'));
|
|
309
309
|
//# sourceMappingURL=parameterHintsWidget.js.map
|
|
@@ -53,7 +53,7 @@ registerSingleton(IPeekViewService, class {
|
|
|
53
53
|
}, 1 /* InstantiationType.Delayed */);
|
|
54
54
|
export var PeekContext;
|
|
55
55
|
(function (PeekContext) {
|
|
56
|
-
PeekContext.inPeekEditor = new RawContextKey('inReferenceSearchEditor', true, nls.localize(
|
|
56
|
+
PeekContext.inPeekEditor = new RawContextKey('inReferenceSearchEditor', true, nls.localize(1322, "Whether the current code editor is embedded inside peek"));
|
|
57
57
|
PeekContext.notInPeekEditor = PeekContext.inPeekEditor.toNegated();
|
|
58
58
|
})(PeekContext || (PeekContext = {}));
|
|
59
59
|
let PeekContextController = class PeekContextController {
|
|
@@ -149,7 +149,7 @@ let PeekViewWidget = class PeekViewWidget extends ZoneWidget {
|
|
|
149
149
|
this._actionbarWidget = new ActionBar(actionsContainer, actionBarOptions);
|
|
150
150
|
this._disposables.add(this._actionbarWidget);
|
|
151
151
|
if (!noCloseAction) {
|
|
152
|
-
this._actionbarWidget.push(this._disposables.add(new Action('peekview.close', nls.localize(
|
|
152
|
+
this._actionbarWidget.push(this._disposables.add(new Action('peekview.close', nls.localize(1323, "Close"), ThemeIcon.asClassName(Codicon.close), true, () => {
|
|
153
153
|
this.dispose();
|
|
154
154
|
return Promise.resolve();
|
|
155
155
|
})), { label: false, icon: true });
|
|
@@ -216,20 +216,20 @@ PeekViewWidget = __decorate([
|
|
|
216
216
|
__param(2, IInstantiationService)
|
|
217
217
|
], PeekViewWidget);
|
|
218
218
|
export { PeekViewWidget };
|
|
219
|
-
export const peekViewTitleBackground = registerColor('peekViewTitle.background', { dark: '#252526', light: '#F3F3F3', hcDark: Color.black, hcLight: Color.white }, nls.localize(
|
|
220
|
-
export const peekViewTitleForeground = registerColor('peekViewTitleLabel.foreground', { dark: Color.white, light: Color.black, hcDark: Color.white, hcLight: editorForeground }, nls.localize(
|
|
221
|
-
export const peekViewTitleInfoForeground = registerColor('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#616161', hcDark: '#FFFFFF99', hcLight: '#292929' }, nls.localize(
|
|
222
|
-
export const peekViewBorder = registerColor('peekView.border', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize(
|
|
223
|
-
export const peekViewResultsBackground = registerColor('peekViewResult.background', { dark: '#252526', light: '#F3F3F3', hcDark: Color.black, hcLight: Color.white }, nls.localize(
|
|
224
|
-
export const peekViewResultsMatchForeground = registerColor('peekViewResult.lineForeground', { dark: '#bbbbbb', light: '#646465', hcDark: Color.white, hcLight: editorForeground }, nls.localize(
|
|
225
|
-
export const peekViewResultsFileForeground = registerColor('peekViewResult.fileForeground', { dark: Color.white, light: '#1E1E1E', hcDark: Color.white, hcLight: editorForeground }, nls.localize(
|
|
226
|
-
export const peekViewResultsSelectionBackground = registerColor('peekViewResult.selectionBackground', { dark: '#3399ff33', light: '#3399ff33', hcDark: null, hcLight: null }, nls.localize(
|
|
227
|
-
export const peekViewResultsSelectionForeground = registerColor('peekViewResult.selectionForeground', { dark: Color.white, light: '#6C6C6C', hcDark: Color.white, hcLight: editorForeground }, nls.localize(
|
|
228
|
-
export const peekViewEditorBackground = registerColor('peekViewEditor.background', { dark: '#001F33', light: '#F2F8FC', hcDark: Color.black, hcLight: Color.white }, nls.localize(
|
|
229
|
-
export const peekViewEditorGutterBackground = registerColor('peekViewEditorGutter.background', peekViewEditorBackground, nls.localize(
|
|
230
|
-
export const peekViewEditorStickyScrollBackground = registerColor('peekViewEditorStickyScroll.background', peekViewEditorBackground, nls.localize(
|
|
231
|
-
export const peekViewEditorStickyScrollGutterBackground = registerColor('peekViewEditorStickyScrollGutter.background', peekViewEditorBackground, nls.localize(
|
|
232
|
-
export const peekViewResultsMatchHighlight = registerColor('peekViewResult.matchHighlightBackground', { dark: '#ea5c004d', light: '#ea5c004d', hcDark: null, hcLight: null }, nls.localize(
|
|
233
|
-
export const peekViewEditorMatchHighlight = registerColor('peekViewEditor.matchHighlightBackground', { dark: '#ff8f0099', light: '#f5d802de', hcDark: null, hcLight: null }, nls.localize(
|
|
234
|
-
export const peekViewEditorMatchHighlightBorder = registerColor('peekViewEditor.matchHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(
|
|
219
|
+
export const peekViewTitleBackground = registerColor('peekViewTitle.background', { dark: '#252526', light: '#F3F3F3', hcDark: Color.black, hcLight: Color.white }, nls.localize(1324, 'Background color of the peek view title area.'));
|
|
220
|
+
export const peekViewTitleForeground = registerColor('peekViewTitleLabel.foreground', { dark: Color.white, light: Color.black, hcDark: Color.white, hcLight: editorForeground }, nls.localize(1325, 'Color of the peek view title.'));
|
|
221
|
+
export const peekViewTitleInfoForeground = registerColor('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#616161', hcDark: '#FFFFFF99', hcLight: '#292929' }, nls.localize(1326, 'Color of the peek view title info.'));
|
|
222
|
+
export const peekViewBorder = registerColor('peekView.border', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize(1327, 'Color of the peek view borders and arrow.'));
|
|
223
|
+
export const peekViewResultsBackground = registerColor('peekViewResult.background', { dark: '#252526', light: '#F3F3F3', hcDark: Color.black, hcLight: Color.white }, nls.localize(1328, 'Background color of the peek view result list.'));
|
|
224
|
+
export const peekViewResultsMatchForeground = registerColor('peekViewResult.lineForeground', { dark: '#bbbbbb', light: '#646465', hcDark: Color.white, hcLight: editorForeground }, nls.localize(1329, 'Foreground color for line nodes in the peek view result list.'));
|
|
225
|
+
export const peekViewResultsFileForeground = registerColor('peekViewResult.fileForeground', { dark: Color.white, light: '#1E1E1E', hcDark: Color.white, hcLight: editorForeground }, nls.localize(1330, 'Foreground color for file nodes in the peek view result list.'));
|
|
226
|
+
export const peekViewResultsSelectionBackground = registerColor('peekViewResult.selectionBackground', { dark: '#3399ff33', light: '#3399ff33', hcDark: null, hcLight: null }, nls.localize(1331, 'Background color of the selected entry in the peek view result list.'));
|
|
227
|
+
export const peekViewResultsSelectionForeground = registerColor('peekViewResult.selectionForeground', { dark: Color.white, light: '#6C6C6C', hcDark: Color.white, hcLight: editorForeground }, nls.localize(1332, 'Foreground color of the selected entry in the peek view result list.'));
|
|
228
|
+
export const peekViewEditorBackground = registerColor('peekViewEditor.background', { dark: '#001F33', light: '#F2F8FC', hcDark: Color.black, hcLight: Color.white }, nls.localize(1333, 'Background color of the peek view editor.'));
|
|
229
|
+
export const peekViewEditorGutterBackground = registerColor('peekViewEditorGutter.background', peekViewEditorBackground, nls.localize(1334, 'Background color of the gutter in the peek view editor.'));
|
|
230
|
+
export const peekViewEditorStickyScrollBackground = registerColor('peekViewEditorStickyScroll.background', peekViewEditorBackground, nls.localize(1335, 'Background color of sticky scroll in the peek view editor.'));
|
|
231
|
+
export const peekViewEditorStickyScrollGutterBackground = registerColor('peekViewEditorStickyScrollGutter.background', peekViewEditorBackground, nls.localize(1336, 'Background color of the gutter part of sticky scroll in the peek view editor.'));
|
|
232
|
+
export const peekViewResultsMatchHighlight = registerColor('peekViewResult.matchHighlightBackground', { dark: '#ea5c004d', light: '#ea5c004d', hcDark: null, hcLight: null }, nls.localize(1337, 'Match highlight color in the peek view result list.'));
|
|
233
|
+
export const peekViewEditorMatchHighlight = registerColor('peekViewEditor.matchHighlightBackground', { dark: '#ff8f0099', light: '#f5d802de', hcDark: null, hcLight: null }, nls.localize(1338, 'Match highlight color in the peek view editor.'));
|
|
234
|
+
export const peekViewEditorMatchHighlightBorder = registerColor('peekViewEditor.matchHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(1339, 'Match highlight border in the peek view editor.'));
|
|
235
235
|
//# sourceMappingURL=peekView.js.map
|
|
@@ -10,5 +10,5 @@ import { registerColor } from '../../../../platform/theme/common/colorUtils.js';
|
|
|
10
10
|
import { PlaceholderTextContribution } from './placeholderTextContribution.js';
|
|
11
11
|
import { wrapInReloadableClass1 } from '../../../../platform/observable/common/wrapInReloadableClass.js';
|
|
12
12
|
registerEditorContribution(PlaceholderTextContribution.ID, wrapInReloadableClass1(() => PlaceholderTextContribution), 0 /* EditorContributionInstantiation.Eager */);
|
|
13
|
-
registerColor('editor.placeholder.foreground', ghostTextForeground, localize(
|
|
13
|
+
registerColor('editor.placeholder.foreground', ghostTextForeground, localize(1340, 'Foreground color of the placeholder text in the editor.'));
|
|
14
14
|
//# sourceMappingURL=placeholderText.contribution.js.map
|
|
@@ -88,8 +88,8 @@ export class AbstractEditorNavigationQuickAccessProvider {
|
|
|
88
88
|
if (!options.preserveFocus) {
|
|
89
89
|
editor.focus();
|
|
90
90
|
}
|
|
91
|
-
const model =
|
|
92
|
-
if (model
|
|
91
|
+
const model = this.getModel(editor);
|
|
92
|
+
if (model) {
|
|
93
93
|
status(`${model.getLineContent(options.range.startLineNumber)}`);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts","vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,eAAe,EAAe,iBAAiB,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mC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;QAC7C,CAAC;IACF,CAAC;CAGD","file":"editorNavigationQuickAccess.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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { createSingleCallFunction } from '../../../../base/common/functional.js';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { getCodeEditor, isDiffEditor } from '../../../browser/editorBrowser.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { IDiffEditor, IEditor, ScrollType } from '../../../common/editorCommon.js';\nimport { IModelDeltaDecoration, ITextModel, OverviewRulerLane } from '../../../common/model.js';\nimport { overviewRulerRangeHighlight } from '../../../common/core/editorColorRegistry.js';\nimport { IQuickAccessProvider, IQuickAccessProviderRunOptions } from '../../../../platform/quickinput/common/quickAccess.js';\nimport { IKeyMods, IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { status } from '../../../../base/browser/ui/aria/aria.js';\nimport { TextEditorSelectionSource } from '../../../../platform/editor/common/editor.js';\n\ninterface IEditorLineDecoration {\n\treadonly rangeHighlightId: string;\n\treadonly overviewRulerDecorationId: string;\n}\n\nexport interface IEditorNavigationQuickAccessOptions {\n\tcanAcceptInBackground?: boolean;\n}\n\nexport interface IQuickAccessTextEditorContext {\n\n\t/**\n\t * The current active editor.\n\t */\n\treadonly editor: IEditor;\n\n\t/**\n\t * If defined, allows to restore the original view state\n\t * the text editor had before quick access opened.\n\t */\n\trestoreViewState?: () => void;\n}\n\n/**\n * A reusable quick access provider for the editor with support\n * for adding decorations for navigating in the currently active file\n * (for example \"Go to line\", \"Go to symbol\").\n */\nexport abstract class AbstractEditorNavigationQuickAccessProvider implements IQuickAccessProvider {\n\n\tconstructor(protected options?: IEditorNavigationQuickAccessOptions) { }\n\n\t//#region Provider methods\n\n\tprovide(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Apply options if any\n\t\tpicker.canAcceptInBackground = !!this.options?.canAcceptInBackground;\n\n\t\t// Disable filtering & sorting, we control the results\n\t\tpicker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false;\n\n\t\t// Provide based on current active editor\n\t\tconst pickerDisposable = disposables.add(new MutableDisposable());\n\t\tpickerDisposable.value = this.doProvide(picker, token, runOptions);\n\n\t\t// Re-create whenever the active editor changes\n\t\tdisposables.add(this.onDidActiveTextEditorControlChange(() => {\n\n\t\t\t// Clear old\n\t\t\tpickerDisposable.value = undefined;\n\n\t\t\t// Add new\n\t\t\tpickerDisposable.value = this.doProvide(picker, token);\n\t\t}));\n\n\t\treturn disposables;\n\t}\n\n\tprivate doProvide(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// With text control\n\t\tconst editor = this.activeTextEditorControl;\n\t\tif (editor && this.canProvideWithTextEditor(editor)) {\n\t\t\tconst context: IQuickAccessTextEditorContext = { editor };\n\n\t\t\t// Restore any view state if this picker was closed\n\t\t\t// without actually going to a line\n\t\t\tconst codeEditor = getCodeEditor(editor);\n\t\t\tif (codeEditor) {\n\n\t\t\t\t// Remember view state and update it when the cursor position\n\t\t\t\t// changes even later because it could be that the user has\n\t\t\t\t// configured quick access to remain open when focus is lost and\n\t\t\t\t// we always want to restore the current location.\n\t\t\t\tlet lastKnownEditorViewState = editor.saveViewState() ?? undefined;\n\t\t\t\tdisposables.add(codeEditor.onDidChangeCursorPosition(() => {\n\t\t\t\t\tlastKnownEditorViewState = editor.saveViewState() ?? undefined;\n\t\t\t\t}));\n\n\t\t\t\tcontext.restoreViewState = () => {\n\t\t\t\t\tif (lastKnownEditorViewState && editor === this.activeTextEditorControl) {\n\t\t\t\t\t\teditor.restoreViewState(lastKnownEditorViewState);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tdisposables.add(createSingleCallFunction(token.onCancellationRequested)(() => context.restoreViewState?.()));\n\t\t\t}\n\n\t\t\t// Clean up decorations on dispose\n\t\t\tdisposables.add(toDisposable(() => this.clearDecorations(editor)));\n\n\t\t\t// Ask subclass for entries\n\t\t\tdisposables.add(this.provideWithTextEditor(context, picker, token, runOptions));\n\t\t}\n\n\t\t// Without text control\n\t\telse {\n\t\t\tdisposables.add(this.provideWithoutTextEditor(picker, token));\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\t/**\n\t * Subclasses to implement if they can operate on the text editor.\n\t */\n\tprotected canProvideWithTextEditor(editor: IEditor): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when an editor is active.\n\t */\n\tprotected abstract provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable;\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when no editor is active.\n\t */\n\tprotected abstract provideWithoutTextEditor(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken): IDisposable;\n\n\tprotected gotoLocation({ editor }: IQuickAccessTextEditorContext, options: { range: IRange; keyMods: IKeyMods; forceSideBySide?: boolean; preserveFocus?: boolean }): void {\n\t\teditor.setSelection(options.range, TextEditorSelectionSource.JUMP);\n\t\teditor.revealRangeInCenter(options.range, ScrollType.Smooth);\n\t\tif (!options.preserveFocus) {\n\t\t\teditor.focus();\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tif (model && 'getLineContent' in model) {\n\t\t\tstatus(`${model.getLineContent(options.range.startLineNumber)}`);\n\t\t}\n\t}\n\n\tprotected getModel(editor: IEditor | IDiffEditor): ITextModel | undefined {\n\t\treturn isDiffEditor(editor) ?\n\t\t\teditor.getModel()?.modified :\n\t\t\teditor.getModel() as ITextModel;\n\t}\n\n\t//#endregion\n\n\n\t//#region Editor access\n\n\t/**\n\t * Subclasses to provide an event when the active editor control changes.\n\t */\n\tprotected abstract readonly onDidActiveTextEditorControlChange: Event<void>;\n\n\t/**\n\t * Subclasses to provide the current active editor control.\n\t */\n\tprotected abstract activeTextEditorControl: IEditor | undefined;\n\n\t//#endregion\n\n\n\t//#region Decorations Utils\n\n\tprivate rangeHighlightDecorationId: IEditorLineDecoration | undefined = undefined;\n\n\taddDecorations(editor: IEditor, range: IRange): void {\n\t\teditor.changeDecorations(changeAccessor => {\n\n\t\t\t// Reset old decorations if any\n\t\t\tconst deleteDecorations: string[] = [];\n\t\t\tif (this.rangeHighlightDecorationId) {\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.overviewRulerDecorationId);\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId);\n\n\t\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t\t}\n\n\t\t\t// Add new decorations for the range\n\t\t\tconst newDecorations: IModelDeltaDecoration[] = [\n\n\t\t\t\t// highlight the entire line on the range\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight',\n\t\t\t\t\t\tclassName: 'rangeHighlight',\n\t\t\t\t\t\tisWholeLine: true\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// also add overview ruler highlight\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight-overview',\n\t\t\t\t\t\toverviewRuler: {\n\t\t\t\t\t\t\tcolor: themeColorFromId(overviewRulerRangeHighlight),\n\t\t\t\t\t\t\tposition: OverviewRulerLane.Full\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t];\n\n\t\t\tconst [rangeHighlightId, overviewRulerDecorationId] = changeAccessor.deltaDecorations(deleteDecorations, newDecorations);\n\n\t\t\tthis.rangeHighlightDecorationId = { rangeHighlightId, overviewRulerDecorationId };\n\t\t});\n\t}\n\n\tclearDecorations(editor: IEditor): void {\n\t\tconst rangeHighlightDecorationId = this.rangeHighlightDecorationId;\n\t\tif (rangeHighlightDecorationId) {\n\t\t\teditor.changeDecorations(changeAccessor => {\n\t\t\t\tchangeAccessor.deltaDecorations([\n\t\t\t\t\trangeHighlightDecorationId.overviewRulerDecorationId,\n\t\t\t\t\trangeHighlightDecorationId.rangeHighlightId\n\t\t\t\t], []);\n\t\t\t});\n\n\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t}\n\t}\n\n\t//#endregion\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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { createSingleCallFunction } from '../../../../base/common/functional.js';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { getCodeEditor, isDiffEditor } from '../../../browser/editorBrowser.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { IDiffEditor, IEditor, ScrollType } from '../../../common/editorCommon.js';\nimport { IModelDeltaDecoration, ITextModel, OverviewRulerLane } from '../../../common/model.js';\nimport { overviewRulerRangeHighlight } from '../../../common/core/editorColorRegistry.js';\nimport { IQuickAccessProvider, IQuickAccessProviderRunOptions } from '../../../../platform/quickinput/common/quickAccess.js';\nimport { IKeyMods, IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { status } from '../../../../base/browser/ui/aria/aria.js';\nimport { TextEditorSelectionSource } from '../../../../platform/editor/common/editor.js';\n\ninterface IEditorLineDecoration {\n\treadonly rangeHighlightId: string;\n\treadonly overviewRulerDecorationId: string;\n}\n\nexport interface IEditorNavigationQuickAccessOptions {\n\tcanAcceptInBackground?: boolean;\n}\n\nexport interface IQuickAccessTextEditorContext {\n\n\t/**\n\t * The current active editor.\n\t */\n\treadonly editor: IEditor;\n\n\t/**\n\t * If defined, allows to restore the original view state\n\t * the text editor had before quick access opened.\n\t */\n\trestoreViewState?: () => void;\n}\n\n/**\n * A reusable quick access provider for the editor with support\n * for adding decorations for navigating in the currently active file\n * (for example \"Go to line\", \"Go to symbol\").\n */\nexport abstract class AbstractEditorNavigationQuickAccessProvider implements IQuickAccessProvider {\n\n\tconstructor(protected options?: IEditorNavigationQuickAccessOptions) { }\n\n\t//#region Provider methods\n\n\tprovide(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Apply options if any\n\t\tpicker.canAcceptInBackground = !!this.options?.canAcceptInBackground;\n\n\t\t// Disable filtering & sorting, we control the results\n\t\tpicker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false;\n\n\t\t// Provide based on current active editor\n\t\tconst pickerDisposable = disposables.add(new MutableDisposable());\n\t\tpickerDisposable.value = this.doProvide(picker, token, runOptions);\n\n\t\t// Re-create whenever the active editor changes\n\t\tdisposables.add(this.onDidActiveTextEditorControlChange(() => {\n\n\t\t\t// Clear old\n\t\t\tpickerDisposable.value = undefined;\n\n\t\t\t// Add new\n\t\t\tpickerDisposable.value = this.doProvide(picker, token);\n\t\t}));\n\n\t\treturn disposables;\n\t}\n\n\tprivate doProvide(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// With text control\n\t\tconst editor = this.activeTextEditorControl;\n\t\tif (editor && this.canProvideWithTextEditor(editor)) {\n\t\t\tconst context: IQuickAccessTextEditorContext = { editor };\n\n\t\t\t// Restore any view state if this picker was closed\n\t\t\t// without actually going to a line\n\t\t\tconst codeEditor = getCodeEditor(editor);\n\t\t\tif (codeEditor) {\n\n\t\t\t\t// Remember view state and update it when the cursor position\n\t\t\t\t// changes even later because it could be that the user has\n\t\t\t\t// configured quick access to remain open when focus is lost and\n\t\t\t\t// we always want to restore the current location.\n\t\t\t\tlet lastKnownEditorViewState = editor.saveViewState() ?? undefined;\n\t\t\t\tdisposables.add(codeEditor.onDidChangeCursorPosition(() => {\n\t\t\t\t\tlastKnownEditorViewState = editor.saveViewState() ?? undefined;\n\t\t\t\t}));\n\n\t\t\t\tcontext.restoreViewState = () => {\n\t\t\t\t\tif (lastKnownEditorViewState && editor === this.activeTextEditorControl) {\n\t\t\t\t\t\teditor.restoreViewState(lastKnownEditorViewState);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tdisposables.add(createSingleCallFunction(token.onCancellationRequested)(() => context.restoreViewState?.()));\n\t\t\t}\n\n\t\t\t// Clean up decorations on dispose\n\t\t\tdisposables.add(toDisposable(() => this.clearDecorations(editor)));\n\n\t\t\t// Ask subclass for entries\n\t\t\tdisposables.add(this.provideWithTextEditor(context, picker, token, runOptions));\n\t\t}\n\n\t\t// Without text control\n\t\telse {\n\t\t\tdisposables.add(this.provideWithoutTextEditor(picker, token));\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\t/**\n\t * Subclasses to implement if they can operate on the text editor.\n\t */\n\tprotected canProvideWithTextEditor(editor: IEditor): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when an editor is active.\n\t */\n\tprotected abstract provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable;\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when no editor is active.\n\t */\n\tprotected abstract provideWithoutTextEditor(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken): IDisposable;\n\n\tprotected gotoLocation({ editor }: IQuickAccessTextEditorContext, options: { range: IRange; keyMods: IKeyMods; forceSideBySide?: boolean; preserveFocus?: boolean }): void {\n\t\teditor.setSelection(options.range, TextEditorSelectionSource.JUMP);\n\t\teditor.revealRangeInCenter(options.range, ScrollType.Smooth);\n\t\tif (!options.preserveFocus) {\n\t\t\teditor.focus();\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tif (model && 'getLineContent' in model) {\n\t\t\tstatus(`${model.getLineContent(options.range.startLineNumber)}`);\n\t\t}\n\t}\n\n\tprotected getModel(editor: IEditor | IDiffEditor): ITextModel | undefined {\n\t\treturn isDiffEditor(editor) ?\n\t\t\teditor.getModel()?.modified :\n\t\t\teditor.getModel() as ITextModel;\n\t}\n\n\t//#endregion\n\n\n\t//#region Editor access\n\n\t/**\n\t * Subclasses to provide an event when the active editor control changes.\n\t */\n\tprotected abstract readonly onDidActiveTextEditorControlChange: Event<void>;\n\n\t/**\n\t * Subclasses to provide the current active editor control.\n\t */\n\tprotected abstract activeTextEditorControl: IEditor | undefined;\n\n\t//#endregion\n\n\n\t//#region Decorations Utils\n\n\tprivate rangeHighlightDecorationId: IEditorLineDecoration | undefined = undefined;\n\n\taddDecorations(editor: IEditor, range: IRange): void {\n\t\teditor.changeDecorations(changeAccessor => {\n\n\t\t\t// Reset old decorations if any\n\t\t\tconst deleteDecorations: string[] = [];\n\t\t\tif (this.rangeHighlightDecorationId) {\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.overviewRulerDecorationId);\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId);\n\n\t\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t\t}\n\n\t\t\t// Add new decorations for the range\n\t\t\tconst newDecorations: IModelDeltaDecoration[] = [\n\n\t\t\t\t// highlight the entire line on the range\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight',\n\t\t\t\t\t\tclassName: 'rangeHighlight',\n\t\t\t\t\t\tisWholeLine: true\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// also add overview ruler highlight\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight-overview',\n\t\t\t\t\t\toverviewRuler: {\n\t\t\t\t\t\t\tcolor: themeColorFromId(overviewRulerRangeHighlight),\n\t\t\t\t\t\t\tposition: OverviewRulerLane.Full\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t];\n\n\t\t\tconst [rangeHighlightId, overviewRulerDecorationId] = changeAccessor.deltaDecorations(deleteDecorations, newDecorations);\n\n\t\t\tthis.rangeHighlightDecorationId = { rangeHighlightId, overviewRulerDecorationId };\n\t\t});\n\t}\n\n\tclearDecorations(editor: IEditor): void {\n\t\tconst rangeHighlightDecorationId = this.rangeHighlightDecorationId;\n\t\tif (rangeHighlightDecorationId) {\n\t\t\teditor.changeDecorations(changeAccessor => {\n\t\t\t\tchangeAccessor.deltaDecorations([\n\t\t\t\t\trangeHighlightDecorationId.overviewRulerDecorationId,\n\t\t\t\t\trangeHighlightDecorationId.rangeHighlightId\n\t\t\t\t], []);\n\t\t\t});\n\n\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t}\n\t}\n\n\t//#endregion\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts","vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,wBAAwB,EAAE,MAAM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ACpD,0BAA0B,CAAC,gBAAgB;iBAC3C,EAAE,EAAE,CAAC,CAAC;YACR,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,0BAA0B,GAAG,SAAS,CAAC;QAC7C,CAAC;IACF,CAAC;CAGD","file":"editorNavigationQuickAccess.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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { createSingleCallFunction } from '../../../../base/common/functional.js';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { getCodeEditor, isDiffEditor } from '../../../browser/editorBrowser.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { IDiffEditor, IEditor, ScrollType } from '../../../common/editorCommon.js';\nimport { IModelDeltaDecoration, ITextModel, OverviewRulerLane } from '../../../common/model.js';\nimport { overviewRulerRangeHighlight } from '../../../common/core/editorColorRegistry.js';\nimport { IQuickAccessProvider, IQuickAccessProviderRunOptions } from '../../../../platform/quickinput/common/quickAccess.js';\nimport { IKeyMods, IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { status } from '../../../../base/browser/ui/aria/aria.js';\nimport { TextEditorSelectionSource } from '../../../../platform/editor/common/editor.js';\n\ninterface IEditorLineDecoration {\n\treadonly rangeHighlightId: string;\n\treadonly overviewRulerDecorationId: string;\n}\n\nexport interface IEditorNavigationQuickAccessOptions {\n\tcanAcceptInBackground?: boolean;\n}\n\nexport interface IQuickAccessTextEditorContext {\n\n\t/**\n\t * The current active editor.\n\t */\n\treadonly editor: IEditor;\n\n\t/**\n\t * If defined, allows to restore the original view state\n\t * the text editor had before quick access opened.\n\t */\n\trestoreViewState?: () => void;\n}\n\n/**\n * A reusable quick access provider for the editor with support\n * for adding decorations for navigating in the currently active file\n * (for example \"Go to line\", \"Go to symbol\").\n */\nexport abstract class AbstractEditorNavigationQuickAccessProvider implements IQuickAccessProvider {\n\n\tconstructor(protected options?: IEditorNavigationQuickAccessOptions) { }\n\n\t//#region Provider methods\n\n\tprovide(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Apply options if any\n\t\tpicker.canAcceptInBackground = !!this.options?.canAcceptInBackground;\n\n\t\t// Disable filtering & sorting, we control the results\n\t\tpicker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false;\n\n\t\t// Provide based on current active editor\n\t\tconst pickerDisposable = disposables.add(new MutableDisposable());\n\t\tpickerDisposable.value = this.doProvide(picker, token, runOptions);\n\n\t\t// Re-create whenever the active editor changes\n\t\tdisposables.add(this.onDidActiveTextEditorControlChange(() => {\n\n\t\t\t// Clear old\n\t\t\tpickerDisposable.value = undefined;\n\n\t\t\t// Add new\n\t\t\tpickerDisposable.value = this.doProvide(picker, token);\n\t\t}));\n\n\t\treturn disposables;\n\t}\n\n\tprivate doProvide(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// With text control\n\t\tconst editor = this.activeTextEditorControl;\n\t\tif (editor && this.canProvideWithTextEditor(editor)) {\n\t\t\tconst context: IQuickAccessTextEditorContext = { editor };\n\n\t\t\t// Restore any view state if this picker was closed\n\t\t\t// without actually going to a line\n\t\t\tconst codeEditor = getCodeEditor(editor);\n\t\t\tif (codeEditor) {\n\n\t\t\t\t// Remember view state and update it when the cursor position\n\t\t\t\t// changes even later because it could be that the user has\n\t\t\t\t// configured quick access to remain open when focus is lost and\n\t\t\t\t// we always want to restore the current location.\n\t\t\t\tlet lastKnownEditorViewState = editor.saveViewState() ?? undefined;\n\t\t\t\tdisposables.add(codeEditor.onDidChangeCursorPosition(() => {\n\t\t\t\t\tlastKnownEditorViewState = editor.saveViewState() ?? undefined;\n\t\t\t\t}));\n\n\t\t\t\tcontext.restoreViewState = () => {\n\t\t\t\t\tif (lastKnownEditorViewState && editor === this.activeTextEditorControl) {\n\t\t\t\t\t\teditor.restoreViewState(lastKnownEditorViewState);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tdisposables.add(createSingleCallFunction(token.onCancellationRequested)(() => context.restoreViewState?.()));\n\t\t\t}\n\n\t\t\t// Clean up decorations on dispose\n\t\t\tdisposables.add(toDisposable(() => this.clearDecorations(editor)));\n\n\t\t\t// Ask subclass for entries\n\t\t\tdisposables.add(this.provideWithTextEditor(context, picker, token, runOptions));\n\t\t}\n\n\t\t// Without text control\n\t\telse {\n\t\t\tdisposables.add(this.provideWithoutTextEditor(picker, token));\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\t/**\n\t * Subclasses to implement if they can operate on the text editor.\n\t */\n\tprotected canProvideWithTextEditor(editor: IEditor): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when an editor is active.\n\t */\n\tprotected abstract provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable;\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when no editor is active.\n\t */\n\tprotected abstract provideWithoutTextEditor(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken): IDisposable;\n\n\tprotected gotoLocation({ editor }: IQuickAccessTextEditorContext, options: { range: IRange; keyMods: IKeyMods; forceSideBySide?: boolean; preserveFocus?: boolean }): void {\n\t\teditor.setSelection(options.range, TextEditorSelectionSource.JUMP);\n\t\teditor.revealRangeInCenter(options.range, ScrollType.Smooth);\n\t\tif (!options.preserveFocus) {\n\t\t\teditor.focus();\n\t\t}\n\n\t\tconst model = this.getModel(editor);\n\t\tif (model) {\n\t\t\tstatus(`${model.getLineContent(options.range.startLineNumber)}`);\n\t\t}\n\t}\n\n\tprotected getModel(editor: IEditor | IDiffEditor): ITextModel | undefined {\n\t\treturn isDiffEditor(editor) ?\n\t\t\teditor.getModel()?.modified :\n\t\t\teditor.getModel() as ITextModel;\n\t}\n\n\t//#endregion\n\n\n\t//#region Editor access\n\n\t/**\n\t * Subclasses to provide an event when the active editor control changes.\n\t */\n\tprotected abstract readonly onDidActiveTextEditorControlChange: Event<void>;\n\n\t/**\n\t * Subclasses to provide the current active editor control.\n\t */\n\tprotected abstract activeTextEditorControl: IEditor | undefined;\n\n\t//#endregion\n\n\n\t//#region Decorations Utils\n\n\tprivate rangeHighlightDecorationId: IEditorLineDecoration | undefined = undefined;\n\n\taddDecorations(editor: IEditor, range: IRange): void {\n\t\teditor.changeDecorations(changeAccessor => {\n\n\t\t\t// Reset old decorations if any\n\t\t\tconst deleteDecorations: string[] = [];\n\t\t\tif (this.rangeHighlightDecorationId) {\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.overviewRulerDecorationId);\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId);\n\n\t\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t\t}\n\n\t\t\t// Add new decorations for the range\n\t\t\tconst newDecorations: IModelDeltaDecoration[] = [\n\n\t\t\t\t// highlight the entire line on the range\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight',\n\t\t\t\t\t\tclassName: 'rangeHighlight',\n\t\t\t\t\t\tisWholeLine: true\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// also add overview ruler highlight\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight-overview',\n\t\t\t\t\t\toverviewRuler: {\n\t\t\t\t\t\t\tcolor: themeColorFromId(overviewRulerRangeHighlight),\n\t\t\t\t\t\t\tposition: OverviewRulerLane.Full\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t];\n\n\t\t\tconst [rangeHighlightId, overviewRulerDecorationId] = changeAccessor.deltaDecorations(deleteDecorations, newDecorations);\n\n\t\t\tthis.rangeHighlightDecorationId = { rangeHighlightId, overviewRulerDecorationId };\n\t\t});\n\t}\n\n\tclearDecorations(editor: IEditor): void {\n\t\tconst rangeHighlightDecorationId = this.rangeHighlightDecorationId;\n\t\tif (rangeHighlightDecorationId) {\n\t\t\teditor.changeDecorations(changeAccessor => {\n\t\t\t\tchangeAccessor.deltaDecorations([\n\t\t\t\t\trangeHighlightDecorationId.overviewRulerDecorationId,\n\t\t\t\t\trangeHighlightDecorationId.rangeHighlightId\n\t\t\t\t], []);\n\t\t\t});\n\n\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t}\n\t}\n\n\t//#endregion\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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { createSingleCallFunction } from '../../../../base/common/functional.js';\nimport { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { getCodeEditor, isDiffEditor } from '../../../browser/editorBrowser.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { IDiffEditor, IEditor, ScrollType } from '../../../common/editorCommon.js';\nimport { IModelDeltaDecoration, ITextModel, OverviewRulerLane } from '../../../common/model.js';\nimport { overviewRulerRangeHighlight } from '../../../common/core/editorColorRegistry.js';\nimport { IQuickAccessProvider, IQuickAccessProviderRunOptions } from '../../../../platform/quickinput/common/quickAccess.js';\nimport { IKeyMods, IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';\nimport { themeColorFromId } from '../../../../platform/theme/common/themeService.js';\nimport { status } from '../../../../base/browser/ui/aria/aria.js';\nimport { TextEditorSelectionSource } from '../../../../platform/editor/common/editor.js';\n\ninterface IEditorLineDecoration {\n\treadonly rangeHighlightId: string;\n\treadonly overviewRulerDecorationId: string;\n}\n\nexport interface IEditorNavigationQuickAccessOptions {\n\tcanAcceptInBackground?: boolean;\n}\n\nexport interface IQuickAccessTextEditorContext {\n\n\t/**\n\t * The current active editor.\n\t */\n\treadonly editor: IEditor;\n\n\t/**\n\t * If defined, allows to restore the original view state\n\t * the text editor had before quick access opened.\n\t */\n\trestoreViewState?: () => void;\n}\n\n/**\n * A reusable quick access provider for the editor with support\n * for adding decorations for navigating in the currently active file\n * (for example \"Go to line\", \"Go to symbol\").\n */\nexport abstract class AbstractEditorNavigationQuickAccessProvider implements IQuickAccessProvider {\n\n\tconstructor(protected options?: IEditorNavigationQuickAccessOptions) { }\n\n\t//#region Provider methods\n\n\tprovide(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Apply options if any\n\t\tpicker.canAcceptInBackground = !!this.options?.canAcceptInBackground;\n\n\t\t// Disable filtering & sorting, we control the results\n\t\tpicker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false;\n\n\t\t// Provide based on current active editor\n\t\tconst pickerDisposable = disposables.add(new MutableDisposable());\n\t\tpickerDisposable.value = this.doProvide(picker, token, runOptions);\n\n\t\t// Re-create whenever the active editor changes\n\t\tdisposables.add(this.onDidActiveTextEditorControlChange(() => {\n\n\t\t\t// Clear old\n\t\t\tpickerDisposable.value = undefined;\n\n\t\t\t// Add new\n\t\t\tpickerDisposable.value = this.doProvide(picker, token);\n\t\t}));\n\n\t\treturn disposables;\n\t}\n\n\tprivate doProvide(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\n\t\t// With text control\n\t\tconst editor = this.activeTextEditorControl;\n\t\tif (editor && this.canProvideWithTextEditor(editor)) {\n\t\t\tconst context: IQuickAccessTextEditorContext = { editor };\n\n\t\t\t// Restore any view state if this picker was closed\n\t\t\t// without actually going to a line\n\t\t\tconst codeEditor = getCodeEditor(editor);\n\t\t\tif (codeEditor) {\n\n\t\t\t\t// Remember view state and update it when the cursor position\n\t\t\t\t// changes even later because it could be that the user has\n\t\t\t\t// configured quick access to remain open when focus is lost and\n\t\t\t\t// we always want to restore the current location.\n\t\t\t\tlet lastKnownEditorViewState = editor.saveViewState() ?? undefined;\n\t\t\t\tdisposables.add(codeEditor.onDidChangeCursorPosition(() => {\n\t\t\t\t\tlastKnownEditorViewState = editor.saveViewState() ?? undefined;\n\t\t\t\t}));\n\n\t\t\t\tcontext.restoreViewState = () => {\n\t\t\t\t\tif (lastKnownEditorViewState && editor === this.activeTextEditorControl) {\n\t\t\t\t\t\teditor.restoreViewState(lastKnownEditorViewState);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tdisposables.add(createSingleCallFunction(token.onCancellationRequested)(() => context.restoreViewState?.()));\n\t\t\t}\n\n\t\t\t// Clean up decorations on dispose\n\t\t\tdisposables.add(toDisposable(() => this.clearDecorations(editor)));\n\n\t\t\t// Ask subclass for entries\n\t\t\tdisposables.add(this.provideWithTextEditor(context, picker, token, runOptions));\n\t\t}\n\n\t\t// Without text control\n\t\telse {\n\t\t\tdisposables.add(this.provideWithoutTextEditor(picker, token));\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\t/**\n\t * Subclasses to implement if they can operate on the text editor.\n\t */\n\tprotected canProvideWithTextEditor(editor: IEditor): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when an editor is active.\n\t */\n\tprotected abstract provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable;\n\n\t/**\n\t * Subclasses to implement to provide picks for the picker when no editor is active.\n\t */\n\tprotected abstract provideWithoutTextEditor(picker: IQuickPick<IQuickPickItem, { useSeparators: true }>, token: CancellationToken): IDisposable;\n\n\tprotected gotoLocation({ editor }: IQuickAccessTextEditorContext, options: { range: IRange; keyMods: IKeyMods; forceSideBySide?: boolean; preserveFocus?: boolean }): void {\n\t\teditor.setSelection(options.range, TextEditorSelectionSource.JUMP);\n\t\teditor.revealRangeInCenter(options.range, ScrollType.Smooth);\n\t\tif (!options.preserveFocus) {\n\t\t\teditor.focus();\n\t\t}\n\n\t\tconst model = this.getModel(editor);\n\t\tif (model) {\n\t\t\tstatus(`${model.getLineContent(options.range.startLineNumber)}`);\n\t\t}\n\t}\n\n\tprotected getModel(editor: IEditor | IDiffEditor): ITextModel | undefined {\n\t\treturn isDiffEditor(editor) ?\n\t\t\teditor.getModel()?.modified :\n\t\t\teditor.getModel() as ITextModel;\n\t}\n\n\t//#endregion\n\n\n\t//#region Editor access\n\n\t/**\n\t * Subclasses to provide an event when the active editor control changes.\n\t */\n\tprotected abstract readonly onDidActiveTextEditorControlChange: Event<void>;\n\n\t/**\n\t * Subclasses to provide the current active editor control.\n\t */\n\tprotected abstract activeTextEditorControl: IEditor | undefined;\n\n\t//#endregion\n\n\n\t//#region Decorations Utils\n\n\tprivate rangeHighlightDecorationId: IEditorLineDecoration | undefined = undefined;\n\n\taddDecorations(editor: IEditor, range: IRange): void {\n\t\teditor.changeDecorations(changeAccessor => {\n\n\t\t\t// Reset old decorations if any\n\t\t\tconst deleteDecorations: string[] = [];\n\t\t\tif (this.rangeHighlightDecorationId) {\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.overviewRulerDecorationId);\n\t\t\t\tdeleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId);\n\n\t\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t\t}\n\n\t\t\t// Add new decorations for the range\n\t\t\tconst newDecorations: IModelDeltaDecoration[] = [\n\n\t\t\t\t// highlight the entire line on the range\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight',\n\t\t\t\t\t\tclassName: 'rangeHighlight',\n\t\t\t\t\t\tisWholeLine: true\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// also add overview ruler highlight\n\t\t\t\t{\n\t\t\t\t\trange,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'quick-access-range-highlight-overview',\n\t\t\t\t\t\toverviewRuler: {\n\t\t\t\t\t\t\tcolor: themeColorFromId(overviewRulerRangeHighlight),\n\t\t\t\t\t\t\tposition: OverviewRulerLane.Full\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t];\n\n\t\t\tconst [rangeHighlightId, overviewRulerDecorationId] = changeAccessor.deltaDecorations(deleteDecorations, newDecorations);\n\n\t\t\tthis.rangeHighlightDecorationId = { rangeHighlightId, overviewRulerDecorationId };\n\t\t});\n\t}\n\n\tclearDecorations(editor: IEditor): void {\n\t\tconst rangeHighlightDecorationId = this.rangeHighlightDecorationId;\n\t\tif (rangeHighlightDecorationId) {\n\t\t\teditor.changeDecorations(changeAccessor => {\n\t\t\t\tchangeAccessor.deltaDecorations([\n\t\t\t\t\trangeHighlightDecorationId.overviewRulerDecorationId,\n\t\t\t\t\trangeHighlightDecorationId.rangeHighlightId\n\t\t\t\t], []);\n\t\t\t});\n\n\t\t\tthis.rangeHighlightDecorationId = undefined;\n\t\t}\n\t}\n\n\t//#endregion\n}\n"]}
|
|
@@ -11,7 +11,8 @@ import { asCssVariable } from '../../../../platform/theme/common/colorUtils.js';
|
|
|
11
11
|
import { getCodeEditor } from '../../../browser/editorBrowser.js';
|
|
12
12
|
import { AbstractEditorNavigationQuickAccessProvider } from './editorNavigationQuickAccess.js';
|
|
13
13
|
export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider {
|
|
14
|
-
static { this.
|
|
14
|
+
static { this.GO_TO_LINE_PREFIX = ':'; }
|
|
15
|
+
static { this.GO_TO_OFFSET_PREFIX = '::'; }
|
|
15
16
|
static { this.ZERO_BASED_OFFSET_STORAGE_KEY = 'gotoLine.useZeroBasedOffset'; }
|
|
16
17
|
constructor() {
|
|
17
18
|
super({ canAcceptInBackground: true });
|
|
@@ -23,7 +24,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
23
24
|
this.storageService.store(AbstractGotoLineQuickAccessProvider.ZERO_BASED_OFFSET_STORAGE_KEY, value, -1 /* StorageScope.APPLICATION */, 0 /* StorageTarget.USER */);
|
|
24
25
|
}
|
|
25
26
|
provideWithoutTextEditor(picker) {
|
|
26
|
-
const label = localize(
|
|
27
|
+
const label = localize(1341, "Open a text editor first to go to a line or an offset.");
|
|
27
28
|
picker.items = [{ label }];
|
|
28
29
|
picker.ariaLabel = label;
|
|
29
30
|
return Disposable.None;
|
|
@@ -46,7 +47,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
46
47
|
}));
|
|
47
48
|
// React to picker changes
|
|
48
49
|
const updatePickerAndEditor = () => {
|
|
49
|
-
const inputText = picker.value.trim().substring(AbstractGotoLineQuickAccessProvider.
|
|
50
|
+
const inputText = picker.value.trim().substring(AbstractGotoLineQuickAccessProvider.GO_TO_LINE_PREFIX.length);
|
|
50
51
|
const { inOffsetMode, lineNumber, column, label } = this.parsePosition(editor, inputText);
|
|
51
52
|
// Show toggle only when input text starts with '::'.
|
|
52
53
|
toggle.visible = !!inOffsetMode;
|
|
@@ -57,7 +58,11 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
57
58
|
label,
|
|
58
59
|
}];
|
|
59
60
|
// ARIA Label
|
|
60
|
-
|
|
61
|
+
const cursor = editor.getPosition() ?? { lineNumber: 1, column: 1 };
|
|
62
|
+
picker.ariaLabel = localize(1342, "Current position: line {0}, column {1}. {2}", cursor.lineNumber, cursor.column, label);
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
61
66
|
// Clear decorations for invalid range
|
|
62
67
|
if (!lineNumber) {
|
|
63
68
|
this.clearDecorations(editor);
|
|
@@ -71,7 +76,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
71
76
|
};
|
|
72
77
|
// Add a toggle to switch between 1- and 0-based offsets.
|
|
73
78
|
const toggle = new Toggle({
|
|
74
|
-
title: localize(
|
|
79
|
+
title: localize(1343, "Use Zero-Based Offset"),
|
|
75
80
|
icon: Codicon.indexZero,
|
|
76
81
|
isChecked: this.useZeroBasedOffset,
|
|
77
82
|
inputActiveOptionBorder: asCssVariable(inputActiveOptionBorder),
|
|
@@ -109,7 +114,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
109
114
|
const model = this.getModel(editor);
|
|
110
115
|
if (!model) {
|
|
111
116
|
return {
|
|
112
|
-
label: localize(
|
|
117
|
+
label: localize(1344, "Open a text editor first to go to a line or an offset.")
|
|
113
118
|
};
|
|
114
119
|
}
|
|
115
120
|
// Support ::<offset> notation to navigate to a specific offset in the model.
|
|
@@ -121,8 +126,8 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
121
126
|
return {
|
|
122
127
|
inOffsetMode: true,
|
|
123
128
|
label: this.useZeroBasedOffset ?
|
|
124
|
-
localize(
|
|
125
|
-
localize(
|
|
129
|
+
localize(1345, "Type a character position to go to (from 0 to {0}).", maxOffset - 1) :
|
|
130
|
+
localize(1346, "Type a character position to go to (from 1 to {0}).", maxOffset)
|
|
126
131
|
};
|
|
127
132
|
}
|
|
128
133
|
else {
|
|
@@ -139,7 +144,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
139
144
|
return {
|
|
140
145
|
...pos,
|
|
141
146
|
inOffsetMode: true,
|
|
142
|
-
label: localize(
|
|
147
|
+
label: localize(1347, "Press 'Enter' to go to line {0} at column {1}.", pos.lineNumber, pos.column)
|
|
143
148
|
};
|
|
144
149
|
}
|
|
145
150
|
}
|
|
@@ -150,7 +155,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
150
155
|
let lineNumber = parseInt(parts[0]?.trim(), 10);
|
|
151
156
|
if (parts.length < 1 || isNaN(lineNumber)) {
|
|
152
157
|
return {
|
|
153
|
-
label: localize(
|
|
158
|
+
label: localize(1348, "Type a line number to go to (from 1 to {0}).", maxLine)
|
|
154
159
|
};
|
|
155
160
|
}
|
|
156
161
|
// Handle negative line numbers and clip to valid range.
|
|
@@ -163,8 +168,8 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
163
168
|
lineNumber,
|
|
164
169
|
column: 1,
|
|
165
170
|
label: parts.length < 2 ?
|
|
166
|
-
localize(
|
|
167
|
-
localize(
|
|
171
|
+
localize(1349, "Press 'Enter' to go to line {0} or enter colon : to add a column number.", lineNumber) :
|
|
172
|
+
localize(1350, "Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).", lineNumber, maxColumn)
|
|
168
173
|
};
|
|
169
174
|
}
|
|
170
175
|
// Handle negative column numbers and clip to valid range.
|
|
@@ -173,7 +178,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
173
178
|
return {
|
|
174
179
|
lineNumber,
|
|
175
180
|
column,
|
|
176
|
-
label: localize(
|
|
181
|
+
label: localize(1351, "Press 'Enter' to go to line {0} at column {1}.", lineNumber, column)
|
|
177
182
|
};
|
|
178
183
|
}
|
|
179
184
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.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AAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;YACvE,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;YAExD,MAAM,SAAS,GAAG,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACrD,IAAI,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YAC5C,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;gBACvC,OAAO;oBACN,UAAU;oBACV,MAAM,EAAE,CAAC;oBACT,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;wBACxB,QAAQ,CAAC,IAA2B,EAAE,oEAAoE,EAAE,UAAU,CAAC,CAAC,CAAC;wBACzH,QAAQ,CAAC,IAAuB,EAAE,2EAA2E,EAAE,UAAU,EAAE,SAAS,CAAC;iBACtI,CAAC;YACH,CAAC;YAED,0DAA0D;YAC1D,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC;YACnD,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;YAElD,OAAO;gBACN,UAAU;gBACV,MAAM;gBACN,KAAK,EAAE,QAAQ,CAAC,IAAuB,EAAE,gDAAgD,EAAE,UAAU,EAAE,MAAM,CAAC;aAC9G,CAAC;QACH,CAAC;IACF,CAAC","file":"gotoLineQuickAccess.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 { Toggle } from '../../../../base/browser/ui/toggle/toggle.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../nls.js';\nimport { IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';\nimport { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';\nimport { inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from '../../../../platform/theme/common/colors/inputColors.js';\nimport { asCssVariable } from '../../../../platform/theme/common/colorUtils.js';\nimport { getCodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../common/config/editorOptions.js';\nimport { IPosition } from '../../../common/core/position.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { IEditor, ScrollType } from '../../../common/editorCommon.js';\nimport { AbstractEditorNavigationQuickAccessProvider, IQuickAccessTextEditorContext } from './editorNavigationQuickAccess.js';\n\ninterface IGotoLineQuickPickItem extends IQuickPickItem, Partial<IPosition> { }\n\nexport abstract class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider {\n\n\tstatic readonly PREFIX = ':';\n\tprivate static readonly ZERO_BASED_OFFSET_STORAGE_KEY = 'gotoLine.useZeroBasedOffset';\n\n\tconstructor() {\n\t\tsuper({ canAcceptInBackground: true });\n\t}\n\n\tprotected abstract readonly storageService: IStorageService;\n\n\tprivate get useZeroBasedOffset() {\n\t\treturn this.storageService.getBoolean(\n\t\t\tAbstractGotoLineQuickAccessProvider.ZERO_BASED_OFFSET_STORAGE_KEY,\n\t\t\tStorageScope.APPLICATION,\n\t\t\tfalse);\n\t}\n\n\tprivate set useZeroBasedOffset(value: boolean) {\n\t\tthis.storageService.store(\n\t\t\tAbstractGotoLineQuickAccessProvider.ZERO_BASED_OFFSET_STORAGE_KEY,\n\t\t\tvalue,\n\t\t\tStorageScope.APPLICATION,\n\t\t\tStorageTarget.USER);\n\t}\n\n\tprotected provideWithoutTextEditor(picker: IQuickPick<IGotoLineQuickPickItem, { useSeparators: true }>): IDisposable {\n\t\tconst label = localize('cannotRunGotoLine', \"Open a text editor first to go to a line.\");\n\n\t\tpicker.items = [{ label }];\n\t\tpicker.ariaLabel = label;\n\n\t\treturn Disposable.None;\n\t}\n\n\tprotected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IGotoLineQuickPickItem, { useSeparators: true }>, token: CancellationToken): IDisposable {\n\t\tconst editor = context.editor;\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Goto line once picked\n\t\tdisposables.add(picker.onDidAccept(event => {\n\t\t\tconst [item] = picker.selectedItems;\n\t\t\tif (item) {\n\t\t\t\tif (!item.lineNumber) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.gotoLocation(context, { range: this.toRange(item.lineNumber, item.column), keyMods: picker.keyMods, preserveFocus: event.inBackground });\n\n\t\t\t\tif (!event.inBackground) {\n\t\t\t\t\tpicker.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// React to picker changes\n\t\tconst updatePickerAndEditor = () => {\n\t\t\tconst inputText = picker.value.trim().substring(AbstractGotoLineQuickAccessProvider.PREFIX.length);\n\t\t\tconst { inOffsetMode, lineNumber, column, label } = this.parsePosition(editor, inputText);\n\n\t\t\t// Show toggle only when input text starts with '::'.\n\t\t\ttoggle.visible = !!inOffsetMode;\n\n\t\t\t// Picker\n\t\t\tpicker.items = [{\n\t\t\t\tlineNumber,\n\t\t\t\tcolumn,\n\t\t\t\tlabel,\n\t\t\t}];\n\n\t\t\t// ARIA Label\n\t\t\tpicker.ariaLabel = label;\n\n\t\t\t// Clear decorations for invalid range\n\t\t\tif (!lineNumber) {\n\t\t\t\tthis.clearDecorations(editor);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Reveal\n\t\t\tconst range = this.toRange(lineNumber, column);\n\t\t\teditor.revealRangeInCenter(range, ScrollType.Smooth);\n\n\t\t\t// Decorate\n\t\t\tthis.addDecorations(editor, range);\n\t\t};\n\n\t\t// Add a toggle to switch between 1- and 0-based offsets.\n\t\tconst toggle = new Toggle({\n\t\t\ttitle: localize('gotoLineToggle', \"Use Zero-Based Offset\"),\n\t\t\ticon: Codicon.indexZero,\n\t\t\tisChecked: this.useZeroBasedOffset,\n\t\t\tinputActiveOptionBorder: asCssVariable(inputActiveOptionBorder),\n\t\t\tinputActiveOptionForeground: asCssVariable(inputActiveOptionForeground),\n\t\t\tinputActiveOptionBackground: asCssVariable(inputActiveOptionBackground)\n\t\t});\n\n\t\tdisposables.add(\n\t\t\ttoggle.onChange(() => {\n\t\t\t\tthis.useZeroBasedOffset = !this.useZeroBasedOffset;\n\t\t\t\tupdatePickerAndEditor();\n\t\t\t}));\n\n\t\tpicker.toggles = [toggle];\n\n\t\tupdatePickerAndEditor();\n\t\tdisposables.add(picker.onDidChangeValue(() => updatePickerAndEditor()));\n\n\t\t// Adjust line number visibility as needed\n\t\tconst codeEditor = getCodeEditor(editor);\n\t\tif (codeEditor) {\n\t\t\tconst options = codeEditor.getOptions();\n\t\t\tconst lineNumbers = options.get(EditorOption.lineNumbers);\n\t\t\tif (lineNumbers.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tcodeEditor.updateOptions({ lineNumbers: 'on' });\n\n\t\t\t\tdisposables.add(toDisposable(() => codeEditor.updateOptions({ lineNumbers: 'relative' })));\n\t\t\t}\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\tprivate toRange(lineNumber = 1, column = 1): IRange {\n\t\treturn {\n\t\t\tstartLineNumber: lineNumber,\n\t\t\tstartColumn: column,\n\t\t\tendLineNumber: lineNumber,\n\t\t\tendColumn: column\n\t\t};\n\t}\n\n\tprotected parsePosition(editor: IEditor, value: string): Partial<IPosition> & { inOffsetMode?: boolean; label: string } {\n\t\tconst model = this.getModel(editor);\n\t\tif (!model) {\n\t\t\treturn {\n\t\t\t\tlabel: localize('gotoLine.noEditor', \"Open a text editor first to go to a line.\")\n\t\t\t};\n\t\t}\n\n\t\t// Support ::<offset> notation to navigate to a specific offset in the model.\n\t\tif (value.startsWith(':')) {\n\t\t\tlet offset = parseInt(value.substring(1), 10);\n\t\t\tconst maxOffset = model.getValueLength();\n\t\t\tif (isNaN(offset)) {\n\t\t\t\t// No valid offset specified.\n\t\t\t\treturn {\n\t\t\t\t\tinOffsetMode: true,\n\t\t\t\t\tlabel: this.useZeroBasedOffset ?\n\t\t\t\t\t\tlocalize('gotoLine.offsetPromptZero', \"Type a character position to go to (from 0 to {0}).\", maxOffset - 1) :\n\t\t\t\t\t\tlocalize('gotoLine.offsetPrompt', \"Type a character position to go to (from 1 to {0}).\", maxOffset)\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst reverse = offset < 0;\n\t\t\t\tif (!this.useZeroBasedOffset) {\n\t\t\t\t\t// Convert 1-based offset to model's 0-based.\n\t\t\t\t\toffset -= Math.sign(offset);\n\t\t\t\t}\n\t\t\t\tif (reverse) {\n\t\t\t\t\t// Offset from the end of the buffer\n\t\t\t\t\toffset += maxOffset;\n\t\t\t\t}\n\t\t\t\tconst pos = model.getPositionAt(offset);\n\t\t\t\treturn {\n\t\t\t\t\t...pos,\n\t\t\t\t\tinOffsetMode: true,\n\t\t\t\t\tlabel: localize('gotoLine.goToPosition', \"Press 'Enter' to go to line {0} at column {1}.\", pos.lineNumber, pos.column)\n\t\t\t\t};\n\t\t\t}\n\t\t} else {\n\t\t\t// Support line-col formats of `line,col`, `line:col`, `line#col`\n\t\t\tconst parts = value.split(/,|:|#/);\n\n\t\t\tconst maxLine = model.getLineCount();\n\t\t\tlet lineNumber = parseInt(parts[0]?.trim(), 10);\n\t\t\tif (parts.length < 1 || isNaN(lineNumber)) {\n\t\t\t\treturn {\n\t\t\t\t\tlabel: localize('gotoLine.linePrompt', \"Type a line number to go to (from 1 to {0}).\", maxLine)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Handle negative line numbers and clip to valid range.\n\t\t\tlineNumber = lineNumber >= 0 ? lineNumber : (maxLine + 1) + lineNumber;\n\t\t\tlineNumber = Math.min(Math.max(1, lineNumber), maxLine);\n\n\t\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\t\tlet column = parseInt(parts[1]?.trim(), 10);\n\t\t\tif (parts.length < 2 || isNaN(column)) {\n\t\t\t\treturn {\n\t\t\t\t\tlineNumber,\n\t\t\t\t\tcolumn: 1,\n\t\t\t\t\tlabel: parts.length < 2 ?\n\t\t\t\t\t\tlocalize('gotoLine.lineColumnPrompt', \"Press 'Enter' to go to line {0} or enter : to add a column number.\", lineNumber) :\n\t\t\t\t\t\tlocalize('gotoLine.columnPrompt', \"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).\", lineNumber, maxColumn)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Handle negative column numbers and clip to valid range.\n\t\t\tcolumn = column >= 0 ? column : maxColumn + column;\n\t\t\tcolumn = Math.min(Math.max(1, column), maxColumn);\n\n\t\t\treturn {\n\t\t\t\tlineNumber,\n\t\t\t\tcolumn,\n\t\t\t\tlabel: localize('gotoLine.goToPosition', \"Press 'Enter' to go to line {0} at column {1}.\", lineNumber, column)\n\t\t\t};\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAC9G,OAAO,EAAE,QAAQ,EA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ceRoot":"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 { Toggle } from '../../../../base/browser/ui/toggle/toggle.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../nls.js';\nimport { IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';\nimport { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';\nimport { inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from '../../../../platform/theme/common/colors/inputColors.js';\nimport { asCssVariable } from '../../../../platform/theme/common/colorUtils.js';\nimport { getCodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../common/config/editorOptions.js';\nimport { IPosition } from '../../../common/core/position.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { IEditor, ScrollType } from '../../../common/editorCommon.js';\nimport { AbstractEditorNavigationQuickAccessProvider, IQuickAccessTextEditorContext } from './editorNavigationQuickAccess.js';\n\ninterface IGotoLineQuickPickItem extends IQuickPickItem, Partial<IPosition> { }\n\nexport abstract class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider {\n\n\tstatic readonly GO_TO_LINE_PREFIX = ':';\n\tstatic readonly GO_TO_OFFSET_PREFIX = '::';\n\tprivate static readonly ZERO_BASED_OFFSET_STORAGE_KEY = 'gotoLine.useZeroBasedOffset';\n\n\tconstructor() {\n\t\tsuper({ canAcceptInBackground: true });\n\t}\n\n\tprotected abstract readonly storageService: IStorageService;\n\n\tprivate get useZeroBasedOffset() {\n\t\treturn this.storageService.getBoolean(\n\t\t\tAbstractGotoLineQuickAccessProvider.ZERO_BASED_OFFSET_STORAGE_KEY,\n\t\t\tStorageScope.APPLICATION,\n\t\t\tfalse);\n\t}\n\n\tprivate set useZeroBasedOffset(value: boolean) {\n\t\tthis.storageService.store(\n\t\t\tAbstractGotoLineQuickAccessProvider.ZERO_BASED_OFFSET_STORAGE_KEY,\n\t\t\tvalue,\n\t\t\tStorageScope.APPLICATION,\n\t\t\tStorageTarget.USER);\n\t}\n\n\tprotected provideWithoutTextEditor(picker: IQuickPick<IGotoLineQuickPickItem, { useSeparators: true }>): IDisposable {\n\t\tconst label = localize('gotoLine.noEditor', \"Open a text editor first to go to a line or an offset.\");\n\n\t\tpicker.items = [{ label }];\n\t\tpicker.ariaLabel = label;\n\n\t\treturn Disposable.None;\n\t}\n\n\tprotected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IGotoLineQuickPickItem, { useSeparators: true }>, token: CancellationToken): IDisposable {\n\t\tconst editor = context.editor;\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Goto line once picked\n\t\tdisposables.add(picker.onDidAccept(event => {\n\t\t\tconst [item] = picker.selectedItems;\n\t\t\tif (item) {\n\t\t\t\tif (!item.lineNumber) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.gotoLocation(context, { range: this.toRange(item.lineNumber, item.column), keyMods: picker.keyMods, preserveFocus: event.inBackground });\n\n\t\t\t\tif (!event.inBackground) {\n\t\t\t\t\tpicker.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// React to picker changes\n\t\tconst updatePickerAndEditor = () => {\n\t\t\tconst inputText = picker.value.trim().substring(AbstractGotoLineQuickAccessProvider.GO_TO_LINE_PREFIX.length);\n\t\t\tconst { inOffsetMode, lineNumber, column, label } = this.parsePosition(editor, inputText);\n\n\t\t\t// Show toggle only when input text starts with '::'.\n\t\t\ttoggle.visible = !!inOffsetMode;\n\n\t\t\t// Picker\n\t\t\tpicker.items = [{\n\t\t\t\tlineNumber,\n\t\t\t\tcolumn,\n\t\t\t\tlabel,\n\t\t\t}];\n\n\t\t\t// ARIA Label\n\t\t\tconst cursor = editor.getPosition() ?? { lineNumber: 1, column: 1 };\n\t\t\tpicker.ariaLabel = localize(\n\t\t\t\t{\n\t\t\t\t\tkey: 'gotoLine.ariaLabel',\n\t\t\t\t\tcomment: ['{0} is the line number, {1} is the column number, {2} is instructions for typing in the Go To Line picker']\n\t\t\t\t},\n\t\t\t\t\"Current position: line {0}, column {1}. {2}\", cursor.lineNumber, cursor.column, label\n\t\t\t);\n\n\t\t\t// Clear decorations for invalid range\n\t\t\tif (!lineNumber) {\n\t\t\t\tthis.clearDecorations(editor);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Reveal\n\t\t\tconst range = this.toRange(lineNumber, column);\n\t\t\teditor.revealRangeInCenter(range, ScrollType.Smooth);\n\n\t\t\t// Decorate\n\t\t\tthis.addDecorations(editor, range);\n\t\t};\n\n\t\t// Add a toggle to switch between 1- and 0-based offsets.\n\t\tconst toggle = new Toggle({\n\t\t\ttitle: localize('gotoLineToggle', \"Use Zero-Based Offset\"),\n\t\t\ticon: Codicon.indexZero,\n\t\t\tisChecked: this.useZeroBasedOffset,\n\t\t\tinputActiveOptionBorder: asCssVariable(inputActiveOptionBorder),\n\t\t\tinputActiveOptionForeground: asCssVariable(inputActiveOptionForeground),\n\t\t\tinputActiveOptionBackground: asCssVariable(inputActiveOptionBackground)\n\t\t});\n\n\t\tdisposables.add(\n\t\t\ttoggle.onChange(() => {\n\t\t\t\tthis.useZeroBasedOffset = !this.useZeroBasedOffset;\n\t\t\t\tupdatePickerAndEditor();\n\t\t\t}));\n\n\t\tpicker.toggles = [toggle];\n\n\t\tupdatePickerAndEditor();\n\t\tdisposables.add(picker.onDidChangeValue(() => updatePickerAndEditor()));\n\n\t\t// Adjust line number visibility as needed\n\t\tconst codeEditor = getCodeEditor(editor);\n\t\tif (codeEditor) {\n\t\t\tconst options = codeEditor.getOptions();\n\t\t\tconst lineNumbers = options.get(EditorOption.lineNumbers);\n\t\t\tif (lineNumbers.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tcodeEditor.updateOptions({ lineNumbers: 'on' });\n\n\t\t\t\tdisposables.add(toDisposable(() => codeEditor.updateOptions({ lineNumbers: 'relative' })));\n\t\t\t}\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\tprivate toRange(lineNumber = 1, column = 1): IRange {\n\t\treturn {\n\t\t\tstartLineNumber: lineNumber,\n\t\t\tstartColumn: column,\n\t\t\tendLineNumber: lineNumber,\n\t\t\tendColumn: column\n\t\t};\n\t}\n\n\tprotected parsePosition(editor: IEditor, value: string): Partial<IPosition> & { inOffsetMode?: boolean; label: string } {\n\t\tconst model = this.getModel(editor);\n\t\tif (!model) {\n\t\t\treturn {\n\t\t\t\tlabel: localize('gotoLine.noEditor', \"Open a text editor first to go to a line or an offset.\")\n\t\t\t};\n\t\t}\n\n\t\t// Support ::<offset> notation to navigate to a specific offset in the model.\n\t\tif (value.startsWith(':')) {\n\t\t\tlet offset = parseInt(value.substring(1), 10);\n\t\t\tconst maxOffset = model.getValueLength();\n\t\t\tif (isNaN(offset)) {\n\t\t\t\t// No valid offset specified.\n\t\t\t\treturn {\n\t\t\t\t\tinOffsetMode: true,\n\t\t\t\t\tlabel: this.useZeroBasedOffset ?\n\t\t\t\t\t\tlocalize('gotoLine.offsetPromptZero', \"Type a character position to go to (from 0 to {0}).\", maxOffset - 1) :\n\t\t\t\t\t\tlocalize('gotoLine.offsetPrompt', \"Type a character position to go to (from 1 to {0}).\", maxOffset)\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst reverse = offset < 0;\n\t\t\t\tif (!this.useZeroBasedOffset) {\n\t\t\t\t\t// Convert 1-based offset to model's 0-based.\n\t\t\t\t\toffset -= Math.sign(offset);\n\t\t\t\t}\n\t\t\t\tif (reverse) {\n\t\t\t\t\t// Offset from the end of the buffer\n\t\t\t\t\toffset += maxOffset;\n\t\t\t\t}\n\t\t\t\tconst pos = model.getPositionAt(offset);\n\t\t\t\treturn {\n\t\t\t\t\t...pos,\n\t\t\t\t\tinOffsetMode: true,\n\t\t\t\t\tlabel: localize('gotoLine.goToPosition', \"Press 'Enter' to go to line {0} at column {1}.\", pos.lineNumber, pos.column)\n\t\t\t\t};\n\t\t\t}\n\t\t} else {\n\t\t\t// Support line-col formats of `line,col`, `line:col`, `line#col`\n\t\t\tconst parts = value.split(/,|:|#/);\n\n\t\t\tconst maxLine = model.getLineCount();\n\t\t\tlet lineNumber = parseInt(parts[0]?.trim(), 10);\n\t\t\tif (parts.length < 1 || isNaN(lineNumber)) {\n\t\t\t\treturn {\n\t\t\t\t\tlabel: localize('gotoLine.linePrompt', \"Type a line number to go to (from 1 to {0}).\", maxLine)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Handle negative line numbers and clip to valid range.\n\t\t\tlineNumber = lineNumber >= 0 ? lineNumber : (maxLine + 1) + lineNumber;\n\t\t\tlineNumber = Math.min(Math.max(1, lineNumber), maxLine);\n\n\t\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\t\tlet column = parseInt(parts[1]?.trim(), 10);\n\t\t\tif (parts.length < 2 || isNaN(column)) {\n\t\t\t\treturn {\n\t\t\t\t\tlineNumber,\n\t\t\t\t\tcolumn: 1,\n\t\t\t\t\tlabel: parts.length < 2 ?\n\t\t\t\t\t\tlocalize('gotoLine.lineColumnPrompt', \"Press 'Enter' to go to line {0} or enter colon : to add a column number.\", lineNumber) :\n\t\t\t\t\t\tlocalize('gotoLine.columnPrompt', \"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).\", lineNumber, maxColumn)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Handle negative column numbers and clip to valid range.\n\t\t\tcolumn = column >= 0 ? column : maxColumn + column;\n\t\t\tcolumn = Math.min(Math.max(1, column), maxColumn);\n\n\t\t\treturn {\n\t\t\t\tlineNumber,\n\t\t\t\tcolumn,\n\t\t\t\tlabel: localize('gotoLine.goToPosition', \"Press 'Enter' to go to line {0} at column {1}.\", lineNumber, column)\n\t\t\t};\n\t\t}\n\t}\n}\n"]}
|