@codingame/monaco-vscode-api 6.0.3 → 7.0.0
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/README.md +93 -73
- package/api.js +1 -1
- package/debugProtocol.d.ts +10 -1
- package/extensions.d.ts +2 -0
- package/missing-services.js +21 -2
- package/package.json +9 -9
- package/service-override/extensions.d.ts +1 -2
- package/services.js +4 -2
- package/vscode/src/vs/base/browser/dnd.js +1 -1
- package/vscode/src/vs/base/browser/dom.js +116 -5
- package/vscode/src/vs/base/browser/domObservable.js +16 -0
- package/vscode/src/vs/base/browser/markdownRenderer.js +5 -3
- package/vscode/src/vs/base/browser/trustedTypes.js +1 -2
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +1 -1
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.js +1 -1
- package/vscode/src/vs/base/browser/ui/button/button.js +2 -2
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +1 -4
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +1 -1
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -1
- package/vscode/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hover.d.ts +32 -16
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate.d.ts +2 -2
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js +2 -2
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.js +2 -0
- package/vscode/src/vs/base/browser/ui/iconLabel/iconLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/iconLabel/simpleIconLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +1 -1
- package/vscode/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/list/listView.js +3 -5
- package/vscode/src/vs/base/browser/ui/list/rowCache.js +1 -8
- package/vscode/src/vs/base/browser/ui/sash/sash.js +1 -1
- package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.js +7 -11
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.js +1 -1
- package/vscode/src/vs/base/browser/ui/table/tableWidget.js +1 -1
- package/vscode/src/vs/base/browser/ui/toggle/toggle.js +1 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +8 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +2 -3
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/asyncDataTree.js +0 -3
- package/vscode/src/vs/base/common/assert.js +1 -1
- package/vscode/src/vs/base/common/collections.js +49 -1
- package/vscode/src/vs/base/common/equals.js +55 -5
- package/vscode/src/vs/base/common/errors.js +14 -1
- package/vscode/src/vs/base/common/event.js +2 -1
- package/vscode/src/vs/base/common/history.js +7 -4
- package/vscode/src/vs/base/common/iterator.js +9 -1
- package/vscode/src/vs/base/common/map.d.ts +41 -0
- package/vscode/src/vs/base/common/numbers.js +18 -1
- package/vscode/src/vs/base/common/observableInternal/api.js +11 -0
- package/vscode/src/vs/base/common/observableInternal/autorun.js +18 -1
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +8 -1
- package/vscode/src/vs/base/common/observableInternal/base.js +2 -5
- package/vscode/src/vs/base/common/observableInternal/derived.js +13 -3
- package/vscode/src/vs/base/common/observableInternal/lazyObservableValue.js +109 -0
- package/vscode/src/vs/base/common/observableInternal/promise.js +3 -0
- package/vscode/src/vs/base/common/observableInternal/utils.d.ts +7 -0
- package/vscode/src/vs/base/common/observableInternal/utils.js +64 -12
- package/vscode/src/vs/base/common/prefixTree.d.ts +52 -0
- package/vscode/src/vs/base/common/product.d.ts +1 -0
- package/vscode/src/vs/base/parts/ipc/common/ipc.js +1 -1
- package/vscode/src/vs/editor/browser/config/charWidthReader.js +1 -1
- package/vscode/src/vs/editor/browser/controller/textAreaHandler.js +1 -1
- package/vscode/src/vs/editor/browser/coreCommands.js +2 -1
- package/vscode/src/vs/editor/browser/observableCodeEditor.js +230 -0
- package/vscode/src/vs/editor/browser/services/abstractCodeEditorService.js +1 -1
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.js +26 -26
- package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +2 -2
- package/vscode/src/vs/editor/browser/view/domLineBreaksComputer.js +1 -1
- package/vscode/src/vs/editor/browser/view/viewLayer.js +4 -12
- package/vscode/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +15 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +8 -8
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +4 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +14 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/registrations.contribution.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.js +3 -3
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +2 -2
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/colors.js +1 -1
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +5 -0
- package/vscode/src/vs/editor/common/config/editorOptions.js +83 -65
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +43 -43
- package/vscode/src/vs/editor/common/cursor/cursor.js +3 -2
- package/vscode/src/vs/editor/common/cursor/cursorTypeEditOperations.js +911 -0
- package/vscode/src/vs/editor/common/cursor/cursorTypeOperations.js +36 -799
- package/vscode/src/vs/editor/common/cursor/cursorWordOperations.js +6 -5
- package/vscode/src/vs/editor/common/languageFeatureRegistry.d.ts +1 -0
- package/vscode/src/vs/editor/common/languageFeatureRegistry.js +3 -0
- package/vscode/src/vs/editor/common/languages/autoIndent.js +23 -1
- package/vscode/src/vs/editor/common/languages.d.ts +20 -3
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js +6 -6
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js +19 -0
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js +3 -0
- package/vscode/src/vs/editor/common/model/textModel.js +6 -2
- package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +5 -5
- package/vscode/src/vs/editor/common/model.d.ts +4 -0
- package/vscode/src/vs/editor/common/services/getIconClasses.js +1 -1
- package/vscode/src/vs/editor/common/services/semanticTokensProviderStyling.js +2 -15
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +63 -62
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +11 -8
- package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +2 -17
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +18 -5
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.js +55 -27
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +7 -4
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +1 -1
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +103 -47
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +18 -10
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +2 -4
- package/vscode/src/vs/editor/contrib/folding/browser/folding.css.js +1 -1
- package/vscode/src/vs/editor/contrib/folding/browser/folding.js +33 -13
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +12 -7
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverController.js +161 -185
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +321 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.js +4 -1
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverTypes.js +6 -21
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidget.js +39 -40
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +55 -46
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +12 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverController.js +15 -9
- package/vscode/src/vs/editor/contrib/hover/browser/hoverTypes.js +11 -1
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +141 -93
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +24 -7
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +36 -1
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +5 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +25 -12
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +88 -118
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +34 -33
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.js +11 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.js +10 -19
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.js +45 -27
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.js +4 -4
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/commands.js +126 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/consts.js +9 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution.js +9 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsController.js +82 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsModel.js +240 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.css.js +4 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.js +322 -0
- package/vscode/src/vs/editor/contrib/inlineProgress/browser/inlineProgress.js +8 -4
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +3 -2
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +2 -2
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +60 -0
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.css.js +4 -0
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +38 -20
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +3 -0
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.js +10 -32
- package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +23 -138
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +3 -0
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +5 -5
- package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +13 -12
- package/vscode/src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.js +3 -3
- package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +21 -0
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +5 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +1 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +27 -6
- package/vscode/src/vs/platform/actions/browser/floatingMenu.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.css.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +33 -3
- package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -0
- package/vscode/src/vs/platform/actions/common/actions.js +3 -0
- package/vscode/src/vs/platform/actions/common/menuService.js +3 -2
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +1 -1
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.d.ts +7 -5
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +109 -13
- package/vscode/src/vs/platform/diagnostics/common/diagnostics.d.ts +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +12 -6
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.service.d.ts +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +20 -10
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +46 -8
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -1
- package/vscode/src/vs/platform/extensions/common/extensions.js +12 -3
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +368 -0
- package/vscode/src/vs/platform/files/common/watcher.js +21 -24
- package/vscode/src/vs/platform/list/browser/listService.js +2 -1
- package/vscode/src/vs/platform/observable/common/platformObservableUtils.js +2 -2
- package/vscode/src/vs/platform/opener/browser/link.js +1 -1
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +1 -1
- package/vscode/src/vs/platform/remote/common/remoteExtensionsScanner.service.d.ts +0 -2
- package/vscode/src/vs/platform/request/common/request.js +18 -8
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +2 -6
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.d.ts +8 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.d.ts +1 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.js +25 -5
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +1 -1
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +6 -6
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +35 -35
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/menuColors.js +4 -4
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +5 -5
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +1 -1
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +5 -5
- package/vscode/src/vs/platform/tunnel/common/tunnel.js +4 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +75 -19
- package/vscode/src/vs/platform/window/common/window.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +32 -25
- package/vscode/src/vs/workbench/api/common/extHost.common.services.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +5 -11
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +5 -15
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +2 -5
- package/vscode/src/vs/workbench/api/common/extHostComments.js +9 -3
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +32 -22
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +109 -40
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +46 -0
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +84 -35
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +50 -41
- package/vscode/src/vs/workbench/api/common/extHostSearch.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSecrets.js +11 -8
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +7 -6
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +63 -70
- package/vscode/src/vs/workbench/api/common/extHostTextEditors.js +5 -3
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +75 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +29 -4
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +127 -107
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +33 -21
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +23 -6
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +3 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
- package/vscode/src/vs/workbench/browser/web.api.js +8 -0
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +199 -194
- package/vscode/src/vs/workbench/common/configuration.js +1 -1
- package/vscode/src/vs/workbench/common/contributions.js +8 -1
- package/vscode/src/vs/workbench/common/editor.js +5 -1
- package/vscode/src/vs/workbench/common/theme.js +79 -454
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +221 -239
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatConfirmationWidget.js → chatContentParts/chatConfirmationWidget.js} +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +131 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatWarningContentPart.js +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatContentParts/media}/chatConfirmationWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +91 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +292 -1019
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownRenderer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +22 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +61 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +23 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -16
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +1 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +7 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +2 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +2 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +8 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +1 -1
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +14 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +8 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +19 -16
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +13 -12
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +19 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +9 -4
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +10 -5
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +4 -4
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +235 -173
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +17 -5
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +62 -44
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +114 -107
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.js +33 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +71 -101
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +38 -43
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -33
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +3 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +49 -86
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +60 -71
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatContentWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +116 -113
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +6 -10
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +1 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +12 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +7 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +88 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +1 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +39 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +12 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +40 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +27 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +14 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +43 -46
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +12 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +19 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +16 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +11 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +12 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +9 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +37 -36
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +18 -8
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +14 -5
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +17 -22
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +7 -10
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +7 -27
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +3 -4
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +4 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +13 -37
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.d.ts +88 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +48 -31
- package/vscode/src/vs/workbench/contrib/testing/common/testId.d.ts +115 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.d.ts +226 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.d.ts +319 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +2 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.js +21 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +7 -8
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +3 -3
- package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +10 -5
- package/vscode/src/vs/workbench/services/editor/common/customEditorLabelService.js +54 -21
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +1 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +5 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensions.service.d.ts +3 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +59 -41
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +1 -1
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +3 -2
- package/vscode/src/vs/workbench/services/host/browser/host.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/language/common/languageService.js +7 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +1 -1
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +2 -2
- package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +2 -2
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.d.ts +2 -2
- package/vscode/src/vs/workbench/services/textfile/common/encoding.js +69 -26
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +23 -4
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.d.ts +5 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +12 -5
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +38 -19
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.service.d.ts +2 -1
- package/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts +0 -196
- package/vscode-dts/vscode.proposed.attributableCoverage.d.ts +28 -10
- package/vscode-dts/vscode.proposed.authGetSessions.d.ts +30 -22
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +17 -8
- package/vscode-dts/vscode.proposed.chatVariableResolver.d.ts +0 -9
- package/vscode-dts/vscode.proposed.commentReveal.d.ts +32 -0
- package/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts +10 -0
- package/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts +1 -1
- package/vscode-dts/vscode.proposed.fileComments.d.ts +12 -53
- package/vscode-dts/vscode.proposed.fileSearchProvider.d.ts +6 -0
- package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +6 -0
- package/vscode-dts/vscode.proposed.lmTools.d.ts +91 -0
- package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +1 -1
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +10 -6
- package/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts +38 -13
- package/vscode/src/vs/editor/browser/observableUtilities.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProviderFactory.service.js +0 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +0 -122
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import { CharCode } from '../../../base/common/charCode.js';
|
|
2
|
-
import { onUnexpectedError } from '../../../base/common/errors.js';
|
|
3
|
-
import { splitLines, lastNonWhitespaceIndex, getLeadingWhitespace, firstNonWhitespaceIndex } from '../../../base/common/strings.js';
|
|
4
|
-
import { ReplaceCommand, ReplaceCommandWithOffsetCursorState, ReplaceCommandWithoutChangingPosition, ReplaceCommandThatPreservesSelection } from '../commands/replaceCommand.js';
|
|
5
1
|
import { ShiftCommand } from '../commands/shiftCommand.js';
|
|
6
|
-
import {
|
|
7
|
-
import { EditOperationResult, EditOperationType
|
|
8
|
-
import {
|
|
9
|
-
import { Range } from '../core/range.js';
|
|
10
|
-
import { Position } from '../core/position.js';
|
|
11
|
-
import { IndentAction } from '../languages/languageConfiguration.js';
|
|
12
|
-
import { getIndentationAtPosition } from '../languages/languageConfigurationRegistry.js';
|
|
13
|
-
import { EditorAutoIndentStrategy } from '../config/editorOptions.js';
|
|
14
|
-
import { createScopedLineTokens } from '../languages/supports.js';
|
|
15
|
-
import { getInheritIndentForLine, getIndentForEnter, getIndentActionForType } from '../languages/autoIndent.js';
|
|
16
|
-
import { getEnterAction } from '../languages/enterAction.js';
|
|
2
|
+
import { CompositionSurroundSelectionCommand } from '../commands/surroundSelectionCommand.js';
|
|
3
|
+
import { isQuote, EditOperationResult, EditOperationType } from '../cursorCommon.js';
|
|
4
|
+
import { shiftIndent, unshiftIndent, PasteOperation, TabOperation, CompositionOperation, shouldSurroundChar, AutoClosingOvertypeWithInterceptorsOperation, AutoClosingOpenCharTypeOperation, EnterOperation, AutoIndentOperation, AutoClosingOvertypeOperation, SurroundSelectionOperation, InterceptorElectricCharOperation, SimpleCharacterTypeOperation, TypeWithoutInterceptorsOperation } from './cursorTypeEditOperations.js';
|
|
17
5
|
class TypeOperations {
|
|
18
6
|
static indent(config, model, selections) {
|
|
19
7
|
if (model === null || selections === null) {
|
|
@@ -47,634 +35,19 @@ class TypeOperations {
|
|
|
47
35
|
return commands;
|
|
48
36
|
}
|
|
49
37
|
static shiftIndent(config, indentation, count) {
|
|
50
|
-
|
|
51
|
-
return ShiftCommand.shiftIndent(indentation, indentation.length + count, config.tabSize, config.indentSize, config.insertSpaces);
|
|
38
|
+
return shiftIndent(config, indentation, count);
|
|
52
39
|
}
|
|
53
40
|
static unshiftIndent(config, indentation, count) {
|
|
54
|
-
|
|
55
|
-
return ShiftCommand.unshiftIndent(indentation, indentation.length + count, config.tabSize, config.indentSize, config.insertSpaces);
|
|
56
|
-
}
|
|
57
|
-
static _distributedPaste(config, model, selections, text) {
|
|
58
|
-
const commands = [];
|
|
59
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
60
|
-
commands[i] = ( new ReplaceCommand(selections[i], text[i]));
|
|
61
|
-
}
|
|
62
|
-
return ( new EditOperationResult(EditOperationType.Other, commands, {
|
|
63
|
-
shouldPushStackElementBefore: true,
|
|
64
|
-
shouldPushStackElementAfter: true
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
static _simplePaste(config, model, selections, text, pasteOnNewLine) {
|
|
68
|
-
const commands = [];
|
|
69
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
70
|
-
const selection = selections[i];
|
|
71
|
-
const position = selection.getPosition();
|
|
72
|
-
if (pasteOnNewLine && !selection.isEmpty()) {
|
|
73
|
-
pasteOnNewLine = false;
|
|
74
|
-
}
|
|
75
|
-
if (pasteOnNewLine && text.indexOf('\n') !== text.length - 1) {
|
|
76
|
-
pasteOnNewLine = false;
|
|
77
|
-
}
|
|
78
|
-
if (pasteOnNewLine) {
|
|
79
|
-
const typeSelection = ( new Range(position.lineNumber, 1, position.lineNumber, 1));
|
|
80
|
-
commands[i] = ( new ReplaceCommandThatPreservesSelection(typeSelection, text, selection, true));
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
commands[i] = ( new ReplaceCommand(selection, text));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return ( new EditOperationResult(EditOperationType.Other, commands, {
|
|
87
|
-
shouldPushStackElementBefore: true,
|
|
88
|
-
shouldPushStackElementAfter: true
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
static _distributePasteToCursors(config, selections, text, pasteOnNewLine, multicursorText) {
|
|
92
|
-
if (pasteOnNewLine) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
if (selections.length === 1) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
if (multicursorText && multicursorText.length === selections.length) {
|
|
99
|
-
return multicursorText;
|
|
100
|
-
}
|
|
101
|
-
if (config.multiCursorPaste === 'spread') {
|
|
102
|
-
if (text.charCodeAt(text.length - 1) === CharCode.LineFeed) {
|
|
103
|
-
text = text.substr(0, text.length - 1);
|
|
104
|
-
}
|
|
105
|
-
if (text.charCodeAt(text.length - 1) === CharCode.CarriageReturn) {
|
|
106
|
-
text = text.substr(0, text.length - 1);
|
|
107
|
-
}
|
|
108
|
-
const lines = splitLines(text);
|
|
109
|
-
if (lines.length === selections.length) {
|
|
110
|
-
return lines;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return null;
|
|
41
|
+
return unshiftIndent(config, indentation, count);
|
|
114
42
|
}
|
|
115
43
|
static paste(config, model, selections, text, pasteOnNewLine, multicursorText) {
|
|
116
|
-
|
|
117
|
-
if (distributedPaste) {
|
|
118
|
-
selections = selections.sort(Range.compareRangesUsingStarts);
|
|
119
|
-
return this._distributedPaste(config, model, selections, distributedPaste);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
return this._simplePaste(config, model, selections, text, pasteOnNewLine);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
static _goodIndentForLine(config, model, lineNumber) {
|
|
126
|
-
let action = null;
|
|
127
|
-
let indentation = '';
|
|
128
|
-
const expectedIndentAction = getInheritIndentForLine(config.autoIndent, model, lineNumber, false, config.languageConfigurationService);
|
|
129
|
-
if (expectedIndentAction) {
|
|
130
|
-
action = expectedIndentAction.action;
|
|
131
|
-
indentation = expectedIndentAction.indentation;
|
|
132
|
-
}
|
|
133
|
-
else if (lineNumber > 1) {
|
|
134
|
-
let lastLineNumber;
|
|
135
|
-
for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {
|
|
136
|
-
const lineText = model.getLineContent(lastLineNumber);
|
|
137
|
-
const nonWhitespaceIdx = lastNonWhitespaceIndex(lineText);
|
|
138
|
-
if (nonWhitespaceIdx >= 0) {
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (lastLineNumber < 1) {
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
const maxColumn = model.getLineMaxColumn(lastLineNumber);
|
|
146
|
-
const expectedEnterAction = getEnterAction(config.autoIndent, model, ( new Range(lastLineNumber, maxColumn, lastLineNumber, maxColumn)), config.languageConfigurationService);
|
|
147
|
-
if (expectedEnterAction) {
|
|
148
|
-
indentation = expectedEnterAction.indentation + expectedEnterAction.appendText;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
if (action) {
|
|
152
|
-
if (action === IndentAction.Indent) {
|
|
153
|
-
indentation = TypeOperations.shiftIndent(config, indentation);
|
|
154
|
-
}
|
|
155
|
-
if (action === IndentAction.Outdent) {
|
|
156
|
-
indentation = TypeOperations.unshiftIndent(config, indentation);
|
|
157
|
-
}
|
|
158
|
-
indentation = config.normalizeIndentation(indentation);
|
|
159
|
-
}
|
|
160
|
-
if (!indentation) {
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
return indentation;
|
|
164
|
-
}
|
|
165
|
-
static _replaceJumpToNextIndent(config, model, selection, insertsAutoWhitespace) {
|
|
166
|
-
let typeText = '';
|
|
167
|
-
const position = selection.getStartPosition();
|
|
168
|
-
if (config.insertSpaces) {
|
|
169
|
-
const visibleColumnFromColumn = config.visibleColumnFromColumn(model, position);
|
|
170
|
-
const indentSize = config.indentSize;
|
|
171
|
-
const spacesCnt = indentSize - (visibleColumnFromColumn % indentSize);
|
|
172
|
-
for (let i = 0; i < spacesCnt; i++) {
|
|
173
|
-
typeText += ' ';
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
typeText = '\t';
|
|
178
|
-
}
|
|
179
|
-
return ( new ReplaceCommand(selection, typeText, insertsAutoWhitespace));
|
|
44
|
+
return PasteOperation.getEdits(config, model, selections, text, pasteOnNewLine, multicursorText);
|
|
180
45
|
}
|
|
181
46
|
static tab(config, model, selections) {
|
|
182
|
-
|
|
183
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
184
|
-
const selection = selections[i];
|
|
185
|
-
if (selection.isEmpty()) {
|
|
186
|
-
const lineText = model.getLineContent(selection.startLineNumber);
|
|
187
|
-
if (/^\s*$/.test(lineText) && model.tokenization.isCheapToTokenize(selection.startLineNumber)) {
|
|
188
|
-
let goodIndent = this._goodIndentForLine(config, model, selection.startLineNumber);
|
|
189
|
-
goodIndent = goodIndent || '\t';
|
|
190
|
-
const possibleTypeText = config.normalizeIndentation(goodIndent);
|
|
191
|
-
if (!lineText.startsWith(possibleTypeText)) {
|
|
192
|
-
commands[i] = ( new ReplaceCommand(( new Range(
|
|
193
|
-
selection.startLineNumber,
|
|
194
|
-
1,
|
|
195
|
-
selection.startLineNumber,
|
|
196
|
-
lineText.length + 1
|
|
197
|
-
)), possibleTypeText, true));
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
commands[i] = this._replaceJumpToNextIndent(config, model, selection, true);
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
if (selection.startLineNumber === selection.endLineNumber) {
|
|
205
|
-
const lineMaxColumn = model.getLineMaxColumn(selection.startLineNumber);
|
|
206
|
-
if (selection.startColumn !== 1 || selection.endColumn !== lineMaxColumn) {
|
|
207
|
-
commands[i] = this._replaceJumpToNextIndent(config, model, selection, false);
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
commands[i] = ( new ShiftCommand(selection, {
|
|
212
|
-
isUnshift: false,
|
|
213
|
-
tabSize: config.tabSize,
|
|
214
|
-
indentSize: config.indentSize,
|
|
215
|
-
insertSpaces: config.insertSpaces,
|
|
216
|
-
useTabStops: config.useTabStops,
|
|
217
|
-
autoIndent: config.autoIndent
|
|
218
|
-
}, config.languageConfigurationService));
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return commands;
|
|
47
|
+
return TabOperation.getCommands(config, model, selections);
|
|
222
48
|
}
|
|
223
49
|
static compositionType(prevEditOperationType, config, model, selections, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta) {
|
|
224
|
-
|
|
225
|
-
selection => this._compositionType(model, selection, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta)
|
|
226
|
-
));
|
|
227
|
-
return ( new EditOperationResult(EditOperationType.TypingOther, commands, {
|
|
228
|
-
shouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, EditOperationType.TypingOther),
|
|
229
|
-
shouldPushStackElementAfter: false
|
|
230
|
-
}));
|
|
231
|
-
}
|
|
232
|
-
static _compositionType(model, selection, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta) {
|
|
233
|
-
if (!selection.isEmpty()) {
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
const pos = selection.getPosition();
|
|
237
|
-
const startColumn = Math.max(1, pos.column - replacePrevCharCnt);
|
|
238
|
-
const endColumn = Math.min(model.getLineMaxColumn(pos.lineNumber), pos.column + replaceNextCharCnt);
|
|
239
|
-
const range = ( new Range(pos.lineNumber, startColumn, pos.lineNumber, endColumn));
|
|
240
|
-
const oldText = model.getValueInRange(range);
|
|
241
|
-
if (oldText === text && positionDelta === 0) {
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
return ( new ReplaceCommandWithOffsetCursorState(range, text, 0, positionDelta));
|
|
245
|
-
}
|
|
246
|
-
static _typeCommand(range, text, keepPosition) {
|
|
247
|
-
if (keepPosition) {
|
|
248
|
-
return ( new ReplaceCommandWithoutChangingPosition(range, text, true));
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
return ( new ReplaceCommand(range, text, true));
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
static _enter(config, model, keepPosition, range) {
|
|
255
|
-
if (config.autoIndent === EditorAutoIndentStrategy.None) {
|
|
256
|
-
return TypeOperations._typeCommand(range, '\n', keepPosition);
|
|
257
|
-
}
|
|
258
|
-
if (!model.tokenization.isCheapToTokenize(range.getStartPosition().lineNumber) || config.autoIndent === EditorAutoIndentStrategy.Keep) {
|
|
259
|
-
const lineText = model.getLineContent(range.startLineNumber);
|
|
260
|
-
const indentation = getLeadingWhitespace(lineText).substring(0, range.startColumn - 1);
|
|
261
|
-
return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(indentation), keepPosition);
|
|
262
|
-
}
|
|
263
|
-
const r = getEnterAction(config.autoIndent, model, range, config.languageConfigurationService);
|
|
264
|
-
if (r) {
|
|
265
|
-
if (r.indentAction === IndentAction.None) {
|
|
266
|
-
return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(r.indentation + r.appendText), keepPosition);
|
|
267
|
-
}
|
|
268
|
-
else if (r.indentAction === IndentAction.Indent) {
|
|
269
|
-
return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(r.indentation + r.appendText), keepPosition);
|
|
270
|
-
}
|
|
271
|
-
else if (r.indentAction === IndentAction.IndentOutdent) {
|
|
272
|
-
const normalIndent = config.normalizeIndentation(r.indentation);
|
|
273
|
-
const increasedIndent = config.normalizeIndentation(r.indentation + r.appendText);
|
|
274
|
-
const typeText = '\n' + increasedIndent + '\n' + normalIndent;
|
|
275
|
-
if (keepPosition) {
|
|
276
|
-
return ( new ReplaceCommandWithoutChangingPosition(range, typeText, true));
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
return ( new ReplaceCommandWithOffsetCursorState(range, typeText, -1, increasedIndent.length - normalIndent.length, true));
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
else if (r.indentAction === IndentAction.Outdent) {
|
|
283
|
-
const actualIndentation = TypeOperations.unshiftIndent(config, r.indentation);
|
|
284
|
-
return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(actualIndentation + r.appendText), keepPosition);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
const lineText = model.getLineContent(range.startLineNumber);
|
|
288
|
-
const indentation = getLeadingWhitespace(lineText).substring(0, range.startColumn - 1);
|
|
289
|
-
if (config.autoIndent >= EditorAutoIndentStrategy.Full) {
|
|
290
|
-
const ir = getIndentForEnter(config.autoIndent, model, range, {
|
|
291
|
-
unshiftIndent: (indent) => {
|
|
292
|
-
return TypeOperations.unshiftIndent(config, indent);
|
|
293
|
-
},
|
|
294
|
-
shiftIndent: (indent) => {
|
|
295
|
-
return TypeOperations.shiftIndent(config, indent);
|
|
296
|
-
},
|
|
297
|
-
normalizeIndentation: (indent) => {
|
|
298
|
-
return config.normalizeIndentation(indent);
|
|
299
|
-
}
|
|
300
|
-
}, config.languageConfigurationService);
|
|
301
|
-
if (ir) {
|
|
302
|
-
let oldEndViewColumn = config.visibleColumnFromColumn(model, range.getEndPosition());
|
|
303
|
-
const oldEndColumn = range.endColumn;
|
|
304
|
-
const newLineContent = model.getLineContent(range.endLineNumber);
|
|
305
|
-
const firstNonWhitespace = firstNonWhitespaceIndex(newLineContent);
|
|
306
|
-
if (firstNonWhitespace >= 0) {
|
|
307
|
-
range = range.setEndPosition(range.endLineNumber, Math.max(range.endColumn, firstNonWhitespace + 1));
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
range = range.setEndPosition(range.endLineNumber, model.getLineMaxColumn(range.endLineNumber));
|
|
311
|
-
}
|
|
312
|
-
if (keepPosition) {
|
|
313
|
-
return ( new ReplaceCommandWithoutChangingPosition(range, '\n' + config.normalizeIndentation(ir.afterEnter), true));
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
let offset = 0;
|
|
317
|
-
if (oldEndColumn <= firstNonWhitespace + 1) {
|
|
318
|
-
if (!config.insertSpaces) {
|
|
319
|
-
oldEndViewColumn = Math.ceil(oldEndViewColumn / config.indentSize);
|
|
320
|
-
}
|
|
321
|
-
offset = Math.min(oldEndViewColumn + 1 - config.normalizeIndentation(ir.afterEnter).length - 1, 0);
|
|
322
|
-
}
|
|
323
|
-
return ( new ReplaceCommandWithOffsetCursorState(range, '\n' + config.normalizeIndentation(ir.afterEnter), 0, offset, true));
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(indentation), keepPosition);
|
|
328
|
-
}
|
|
329
|
-
static _isAutoIndentType(config, model, selections) {
|
|
330
|
-
if (config.autoIndent < EditorAutoIndentStrategy.Full) {
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
334
|
-
if (!model.tokenization.isCheapToTokenize(selections[i].getEndPosition().lineNumber)) {
|
|
335
|
-
return false;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
return true;
|
|
339
|
-
}
|
|
340
|
-
static _runAutoIndentType(config, model, range, ch) {
|
|
341
|
-
const currentIndentation = getIndentationAtPosition(model, range.startLineNumber, range.startColumn);
|
|
342
|
-
const actualIndentation = getIndentActionForType(config.autoIndent, model, range, ch, {
|
|
343
|
-
shiftIndent: (indentation) => {
|
|
344
|
-
return TypeOperations.shiftIndent(config, indentation);
|
|
345
|
-
},
|
|
346
|
-
unshiftIndent: (indentation) => {
|
|
347
|
-
return TypeOperations.unshiftIndent(config, indentation);
|
|
348
|
-
},
|
|
349
|
-
}, config.languageConfigurationService);
|
|
350
|
-
if (actualIndentation === null) {
|
|
351
|
-
return null;
|
|
352
|
-
}
|
|
353
|
-
if (actualIndentation !== config.normalizeIndentation(currentIndentation)) {
|
|
354
|
-
const firstNonWhitespace = model.getLineFirstNonWhitespaceColumn(range.startLineNumber);
|
|
355
|
-
if (firstNonWhitespace === 0) {
|
|
356
|
-
return TypeOperations._typeCommand(( new Range(range.startLineNumber, 1, range.endLineNumber, range.endColumn)), config.normalizeIndentation(actualIndentation) + ch, false);
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
return TypeOperations._typeCommand(( new Range(range.startLineNumber, 1, range.endLineNumber, range.endColumn)), config.normalizeIndentation(actualIndentation) +
|
|
360
|
-
model.getLineContent(range.startLineNumber).substring(firstNonWhitespace - 1, range.startColumn - 1) + ch, false);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
return null;
|
|
364
|
-
}
|
|
365
|
-
static _isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch) {
|
|
366
|
-
if (config.autoClosingOvertype === 'never') {
|
|
367
|
-
return false;
|
|
368
|
-
}
|
|
369
|
-
if (!( config.autoClosingPairs.autoClosingPairsCloseSingleChar.has(ch))) {
|
|
370
|
-
return false;
|
|
371
|
-
}
|
|
372
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
373
|
-
const selection = selections[i];
|
|
374
|
-
if (!selection.isEmpty()) {
|
|
375
|
-
return false;
|
|
376
|
-
}
|
|
377
|
-
const position = selection.getPosition();
|
|
378
|
-
const lineText = model.getLineContent(position.lineNumber);
|
|
379
|
-
const afterCharacter = lineText.charAt(position.column - 1);
|
|
380
|
-
if (afterCharacter !== ch) {
|
|
381
|
-
return false;
|
|
382
|
-
}
|
|
383
|
-
const chIsQuote = isQuote(ch);
|
|
384
|
-
const beforeCharacter = position.column > 2 ? lineText.charCodeAt(position.column - 2) : CharCode.Null;
|
|
385
|
-
if (beforeCharacter === CharCode.Backslash && chIsQuote) {
|
|
386
|
-
return false;
|
|
387
|
-
}
|
|
388
|
-
if (config.autoClosingOvertype === 'auto') {
|
|
389
|
-
let found = false;
|
|
390
|
-
for (let j = 0, lenJ = autoClosedCharacters.length; j < lenJ; j++) {
|
|
391
|
-
const autoClosedCharacter = autoClosedCharacters[j];
|
|
392
|
-
if (position.lineNumber === autoClosedCharacter.startLineNumber && position.column === autoClosedCharacter.startColumn) {
|
|
393
|
-
found = true;
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
if (!found) {
|
|
398
|
-
return false;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
return true;
|
|
403
|
-
}
|
|
404
|
-
static _runAutoClosingOvertype(prevEditOperationType, config, model, selections, ch) {
|
|
405
|
-
const commands = [];
|
|
406
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
407
|
-
const selection = selections[i];
|
|
408
|
-
const position = selection.getPosition();
|
|
409
|
-
const typeSelection = ( new Range(
|
|
410
|
-
position.lineNumber,
|
|
411
|
-
position.column,
|
|
412
|
-
position.lineNumber,
|
|
413
|
-
position.column + 1
|
|
414
|
-
));
|
|
415
|
-
commands[i] = ( new ReplaceCommand(typeSelection, ch));
|
|
416
|
-
}
|
|
417
|
-
return ( new EditOperationResult(EditOperationType.TypingOther, commands, {
|
|
418
|
-
shouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, EditOperationType.TypingOther),
|
|
419
|
-
shouldPushStackElementAfter: false
|
|
420
|
-
}));
|
|
421
|
-
}
|
|
422
|
-
static _isBeforeClosingBrace(config, lineAfter) {
|
|
423
|
-
const nextChar = lineAfter.charAt(0);
|
|
424
|
-
const potentialStartingBraces = config.autoClosingPairs.autoClosingPairsOpenByStart.get(nextChar) || [];
|
|
425
|
-
const potentialClosingBraces = config.autoClosingPairs.autoClosingPairsCloseByStart.get(nextChar) || [];
|
|
426
|
-
const isBeforeStartingBrace = ( potentialStartingBraces.some(x => lineAfter.startsWith(x.open)));
|
|
427
|
-
const isBeforeClosingBrace = ( potentialClosingBraces.some(x => lineAfter.startsWith(x.close)));
|
|
428
|
-
return !isBeforeStartingBrace && isBeforeClosingBrace;
|
|
429
|
-
}
|
|
430
|
-
static _findAutoClosingPairOpen(config, model, positions, ch) {
|
|
431
|
-
const candidates = config.autoClosingPairs.autoClosingPairsOpenByEnd.get(ch);
|
|
432
|
-
if (!candidates) {
|
|
433
|
-
return null;
|
|
434
|
-
}
|
|
435
|
-
let result = null;
|
|
436
|
-
for (const candidate of candidates) {
|
|
437
|
-
if (result === null || candidate.open.length > result.open.length) {
|
|
438
|
-
let candidateIsMatch = true;
|
|
439
|
-
for (const position of positions) {
|
|
440
|
-
const relevantText = model.getValueInRange(( new Range(
|
|
441
|
-
position.lineNumber,
|
|
442
|
-
position.column - candidate.open.length + 1,
|
|
443
|
-
position.lineNumber,
|
|
444
|
-
position.column
|
|
445
|
-
)));
|
|
446
|
-
if (relevantText + ch !== candidate.open) {
|
|
447
|
-
candidateIsMatch = false;
|
|
448
|
-
break;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
if (candidateIsMatch) {
|
|
452
|
-
result = candidate;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
return result;
|
|
457
|
-
}
|
|
458
|
-
static _findContainedAutoClosingPair(config, pair) {
|
|
459
|
-
if (pair.open.length <= 1) {
|
|
460
|
-
return null;
|
|
461
|
-
}
|
|
462
|
-
const lastChar = pair.close.charAt(pair.close.length - 1);
|
|
463
|
-
const candidates = config.autoClosingPairs.autoClosingPairsCloseByEnd.get(lastChar) || [];
|
|
464
|
-
let result = null;
|
|
465
|
-
for (const candidate of candidates) {
|
|
466
|
-
if (candidate.open !== pair.open && pair.open.includes(candidate.open) && pair.close.endsWith(candidate.close)) {
|
|
467
|
-
if (!result || candidate.open.length > result.open.length) {
|
|
468
|
-
result = candidate;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
return result;
|
|
473
|
-
}
|
|
474
|
-
static _getAutoClosingPairClose(config, model, selections, ch, chIsAlreadyTyped) {
|
|
475
|
-
for (const selection of selections) {
|
|
476
|
-
if (!selection.isEmpty()) {
|
|
477
|
-
return null;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
const positions = ( selections.map((s) => {
|
|
481
|
-
const position = s.getPosition();
|
|
482
|
-
if (chIsAlreadyTyped) {
|
|
483
|
-
return { lineNumber: position.lineNumber, beforeColumn: position.column - ch.length, afterColumn: position.column };
|
|
484
|
-
}
|
|
485
|
-
else {
|
|
486
|
-
return { lineNumber: position.lineNumber, beforeColumn: position.column, afterColumn: position.column };
|
|
487
|
-
}
|
|
488
|
-
}));
|
|
489
|
-
const pair = this._findAutoClosingPairOpen(config, model, ( positions.map(p => ( new Position(p.lineNumber, p.beforeColumn)))), ch);
|
|
490
|
-
if (!pair) {
|
|
491
|
-
return null;
|
|
492
|
-
}
|
|
493
|
-
let autoCloseConfig;
|
|
494
|
-
let shouldAutoCloseBefore;
|
|
495
|
-
const chIsQuote = isQuote(ch);
|
|
496
|
-
if (chIsQuote) {
|
|
497
|
-
autoCloseConfig = config.autoClosingQuotes;
|
|
498
|
-
shouldAutoCloseBefore = config.shouldAutoCloseBefore.quote;
|
|
499
|
-
}
|
|
500
|
-
else {
|
|
501
|
-
const pairIsForComments = config.blockCommentStartToken ? pair.open.includes(config.blockCommentStartToken) : false;
|
|
502
|
-
if (pairIsForComments) {
|
|
503
|
-
autoCloseConfig = config.autoClosingComments;
|
|
504
|
-
shouldAutoCloseBefore = config.shouldAutoCloseBefore.comment;
|
|
505
|
-
}
|
|
506
|
-
else {
|
|
507
|
-
autoCloseConfig = config.autoClosingBrackets;
|
|
508
|
-
shouldAutoCloseBefore = config.shouldAutoCloseBefore.bracket;
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
if (autoCloseConfig === 'never') {
|
|
512
|
-
return null;
|
|
513
|
-
}
|
|
514
|
-
const containedPair = this._findContainedAutoClosingPair(config, pair);
|
|
515
|
-
const containedPairClose = containedPair ? containedPair.close : '';
|
|
516
|
-
let isContainedPairPresent = true;
|
|
517
|
-
for (const position of positions) {
|
|
518
|
-
const { lineNumber, beforeColumn, afterColumn } = position;
|
|
519
|
-
const lineText = model.getLineContent(lineNumber);
|
|
520
|
-
const lineBefore = lineText.substring(0, beforeColumn - 1);
|
|
521
|
-
const lineAfter = lineText.substring(afterColumn - 1);
|
|
522
|
-
if (!lineAfter.startsWith(containedPairClose)) {
|
|
523
|
-
isContainedPairPresent = false;
|
|
524
|
-
}
|
|
525
|
-
if (lineAfter.length > 0) {
|
|
526
|
-
const characterAfter = lineAfter.charAt(0);
|
|
527
|
-
const isBeforeCloseBrace = TypeOperations._isBeforeClosingBrace(config, lineAfter);
|
|
528
|
-
if (!isBeforeCloseBrace && !shouldAutoCloseBefore(characterAfter)) {
|
|
529
|
-
return null;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
if (pair.open.length === 1 && (ch === '\'' || ch === '"') && autoCloseConfig !== 'always') {
|
|
533
|
-
const wordSeparators = getMapForWordSeparators(config.wordSeparators, []);
|
|
534
|
-
if (lineBefore.length > 0) {
|
|
535
|
-
const characterBefore = lineBefore.charCodeAt(lineBefore.length - 1);
|
|
536
|
-
if (wordSeparators.get(characterBefore) === WordCharacterClass.Regular) {
|
|
537
|
-
return null;
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
if (!model.tokenization.isCheapToTokenize(lineNumber)) {
|
|
542
|
-
return null;
|
|
543
|
-
}
|
|
544
|
-
model.tokenization.forceTokenization(lineNumber);
|
|
545
|
-
const lineTokens = model.tokenization.getLineTokens(lineNumber);
|
|
546
|
-
const scopedLineTokens = createScopedLineTokens(lineTokens, beforeColumn - 1);
|
|
547
|
-
if (!pair.shouldAutoClose(scopedLineTokens, beforeColumn - scopedLineTokens.firstCharOffset)) {
|
|
548
|
-
return null;
|
|
549
|
-
}
|
|
550
|
-
const neutralCharacter = pair.findNeutralCharacter();
|
|
551
|
-
if (neutralCharacter) {
|
|
552
|
-
const tokenType = model.tokenization.getTokenTypeIfInsertingCharacter(lineNumber, beforeColumn, neutralCharacter);
|
|
553
|
-
if (!pair.isOK(tokenType)) {
|
|
554
|
-
return null;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
if (isContainedPairPresent) {
|
|
559
|
-
return pair.close.substring(0, pair.close.length - containedPairClose.length);
|
|
560
|
-
}
|
|
561
|
-
else {
|
|
562
|
-
return pair.close;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
static _runAutoClosingOpenCharType(prevEditOperationType, config, model, selections, ch, chIsAlreadyTyped, autoClosingPairClose) {
|
|
566
|
-
const commands = [];
|
|
567
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
568
|
-
const selection = selections[i];
|
|
569
|
-
commands[i] = ( new TypeWithAutoClosingCommand(selection, ch, !chIsAlreadyTyped, autoClosingPairClose));
|
|
570
|
-
}
|
|
571
|
-
return ( new EditOperationResult(EditOperationType.TypingOther, commands, {
|
|
572
|
-
shouldPushStackElementBefore: true,
|
|
573
|
-
shouldPushStackElementAfter: false
|
|
574
|
-
}));
|
|
575
|
-
}
|
|
576
|
-
static _shouldSurroundChar(config, ch) {
|
|
577
|
-
if (isQuote(ch)) {
|
|
578
|
-
return (config.autoSurround === 'quotes' || config.autoSurround === 'languageDefined');
|
|
579
|
-
}
|
|
580
|
-
else {
|
|
581
|
-
return (config.autoSurround === 'brackets' || config.autoSurround === 'languageDefined');
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
static _isSurroundSelectionType(config, model, selections, ch) {
|
|
585
|
-
if (!TypeOperations._shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) {
|
|
586
|
-
return false;
|
|
587
|
-
}
|
|
588
|
-
const isTypingAQuoteCharacter = isQuote(ch);
|
|
589
|
-
for (const selection of selections) {
|
|
590
|
-
if (selection.isEmpty()) {
|
|
591
|
-
return false;
|
|
592
|
-
}
|
|
593
|
-
let selectionContainsOnlyWhitespace = true;
|
|
594
|
-
for (let lineNumber = selection.startLineNumber; lineNumber <= selection.endLineNumber; lineNumber++) {
|
|
595
|
-
const lineText = model.getLineContent(lineNumber);
|
|
596
|
-
const startIndex = (lineNumber === selection.startLineNumber ? selection.startColumn - 1 : 0);
|
|
597
|
-
const endIndex = (lineNumber === selection.endLineNumber ? selection.endColumn - 1 : lineText.length);
|
|
598
|
-
const selectedText = lineText.substring(startIndex, endIndex);
|
|
599
|
-
if (/[^ \t]/.test(selectedText)) {
|
|
600
|
-
selectionContainsOnlyWhitespace = false;
|
|
601
|
-
break;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
if (selectionContainsOnlyWhitespace) {
|
|
605
|
-
return false;
|
|
606
|
-
}
|
|
607
|
-
if (isTypingAQuoteCharacter && selection.startLineNumber === selection.endLineNumber && selection.startColumn + 1 === selection.endColumn) {
|
|
608
|
-
const selectionText = model.getValueInRange(selection);
|
|
609
|
-
if (isQuote(selectionText)) {
|
|
610
|
-
return false;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
return true;
|
|
615
|
-
}
|
|
616
|
-
static _runSurroundSelectionType(prevEditOperationType, config, model, selections, ch) {
|
|
617
|
-
const commands = [];
|
|
618
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
619
|
-
const selection = selections[i];
|
|
620
|
-
const closeCharacter = config.surroundingPairs[ch];
|
|
621
|
-
commands[i] = ( new SurroundSelectionCommand(selection, ch, closeCharacter));
|
|
622
|
-
}
|
|
623
|
-
return ( new EditOperationResult(EditOperationType.Other, commands, {
|
|
624
|
-
shouldPushStackElementBefore: true,
|
|
625
|
-
shouldPushStackElementAfter: true
|
|
626
|
-
}));
|
|
627
|
-
}
|
|
628
|
-
static _isTypeInterceptorElectricChar(config, model, selections) {
|
|
629
|
-
if (selections.length === 1 && model.tokenization.isCheapToTokenize(selections[0].getEndPosition().lineNumber)) {
|
|
630
|
-
return true;
|
|
631
|
-
}
|
|
632
|
-
return false;
|
|
633
|
-
}
|
|
634
|
-
static _typeInterceptorElectricChar(prevEditOperationType, config, model, selection, ch) {
|
|
635
|
-
if (!config.electricChars.hasOwnProperty(ch) || !selection.isEmpty()) {
|
|
636
|
-
return null;
|
|
637
|
-
}
|
|
638
|
-
const position = selection.getPosition();
|
|
639
|
-
model.tokenization.forceTokenization(position.lineNumber);
|
|
640
|
-
const lineTokens = model.tokenization.getLineTokens(position.lineNumber);
|
|
641
|
-
let electricAction;
|
|
642
|
-
try {
|
|
643
|
-
electricAction = config.onElectricCharacter(ch, lineTokens, position.column);
|
|
644
|
-
}
|
|
645
|
-
catch (e) {
|
|
646
|
-
onUnexpectedError(e);
|
|
647
|
-
return null;
|
|
648
|
-
}
|
|
649
|
-
if (!electricAction) {
|
|
650
|
-
return null;
|
|
651
|
-
}
|
|
652
|
-
if (electricAction.matchOpenBracket) {
|
|
653
|
-
const endColumn = (lineTokens.getLineContent() + ch).lastIndexOf(electricAction.matchOpenBracket) + 1;
|
|
654
|
-
const match = model.bracketPairs.findMatchingBracketUp(electricAction.matchOpenBracket, {
|
|
655
|
-
lineNumber: position.lineNumber,
|
|
656
|
-
column: endColumn
|
|
657
|
-
}, 500 );
|
|
658
|
-
if (match) {
|
|
659
|
-
if (match.startLineNumber === position.lineNumber) {
|
|
660
|
-
return null;
|
|
661
|
-
}
|
|
662
|
-
const matchLine = model.getLineContent(match.startLineNumber);
|
|
663
|
-
const matchLineIndentation = getLeadingWhitespace(matchLine);
|
|
664
|
-
const newIndentation = config.normalizeIndentation(matchLineIndentation);
|
|
665
|
-
const lineText = model.getLineContent(position.lineNumber);
|
|
666
|
-
const lineFirstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(position.lineNumber) || position.column;
|
|
667
|
-
const prefix = lineText.substring(lineFirstNonBlankColumn - 1, position.column - 1);
|
|
668
|
-
const typeText = newIndentation + prefix + ch;
|
|
669
|
-
const typeSelection = ( new Range(position.lineNumber, 1, position.lineNumber, position.column));
|
|
670
|
-
const command = ( new ReplaceCommand(typeSelection, typeText));
|
|
671
|
-
return ( new EditOperationResult(getTypingOperation(typeText, prevEditOperationType), [command], {
|
|
672
|
-
shouldPushStackElementBefore: false,
|
|
673
|
-
shouldPushStackElementAfter: true
|
|
674
|
-
}));
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
return null;
|
|
50
|
+
return CompositionOperation.getEdits(prevEditOperationType, config, model, selections, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta);
|
|
678
51
|
}
|
|
679
52
|
static compositionEndWithInterceptors(prevEditOperationType, config, model, compositions, selections, autoClosedCharacters) {
|
|
680
53
|
if (!compositions) {
|
|
@@ -701,7 +74,7 @@ class TypeOperations {
|
|
|
701
74
|
}
|
|
702
75
|
}
|
|
703
76
|
if (hasDeletion) {
|
|
704
|
-
if (!
|
|
77
|
+
if (!shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) {
|
|
705
78
|
return null;
|
|
706
79
|
}
|
|
707
80
|
const isTypingAQuoteCharacter = isQuote(ch);
|
|
@@ -735,153 +108,45 @@ class TypeOperations {
|
|
|
735
108
|
shouldPushStackElementAfter: false
|
|
736
109
|
}));
|
|
737
110
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
s.positionColumn,
|
|
742
|
-
s.positionLineNumber,
|
|
743
|
-
s.positionColumn + 1
|
|
744
|
-
)), '', false))));
|
|
745
|
-
return ( new EditOperationResult(EditOperationType.TypingOther, commands, {
|
|
746
|
-
shouldPushStackElementBefore: true,
|
|
747
|
-
shouldPushStackElementAfter: false
|
|
748
|
-
}));
|
|
111
|
+
const autoClosingOvertypeEdits = AutoClosingOvertypeWithInterceptorsOperation.getEdits(config, model, selections, autoClosedCharacters, ch);
|
|
112
|
+
if (autoClosingOvertypeEdits !== undefined) {
|
|
113
|
+
return autoClosingOvertypeEdits;
|
|
749
114
|
}
|
|
750
|
-
const
|
|
751
|
-
if (
|
|
752
|
-
return
|
|
115
|
+
const autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, true, false);
|
|
116
|
+
if (autoClosingOpenCharEdits !== undefined) {
|
|
117
|
+
return autoClosingOpenCharEdits;
|
|
753
118
|
}
|
|
754
119
|
return null;
|
|
755
120
|
}
|
|
756
121
|
static typeWithInterceptors(isDoingComposition, prevEditOperationType, config, model, selections, autoClosedCharacters, ch) {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
commands[i] = TypeOperations._enter(config, model, false, selections[i]);
|
|
761
|
-
}
|
|
762
|
-
return ( new EditOperationResult(EditOperationType.TypingOther, commands, {
|
|
763
|
-
shouldPushStackElementBefore: true,
|
|
764
|
-
shouldPushStackElementAfter: false,
|
|
765
|
-
}));
|
|
122
|
+
const enterEdits = EnterOperation.getEdits(config, model, selections, ch, isDoingComposition);
|
|
123
|
+
if (enterEdits !== undefined) {
|
|
124
|
+
return enterEdits;
|
|
766
125
|
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
771
|
-
commands[i] = this._runAutoIndentType(config, model, selections[i], ch);
|
|
772
|
-
if (!commands[i]) {
|
|
773
|
-
autoIndentFails = true;
|
|
774
|
-
break;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
if (!autoIndentFails) {
|
|
778
|
-
return ( new EditOperationResult(EditOperationType.TypingOther, commands, {
|
|
779
|
-
shouldPushStackElementBefore: true,
|
|
780
|
-
shouldPushStackElementAfter: false,
|
|
781
|
-
}));
|
|
782
|
-
}
|
|
126
|
+
const autoIndentEdits = AutoIndentOperation.getEdits(config, model, selections, ch, isDoingComposition);
|
|
127
|
+
if (autoIndentEdits !== undefined) {
|
|
128
|
+
return autoIndentEdits;
|
|
783
129
|
}
|
|
784
|
-
|
|
785
|
-
|
|
130
|
+
const autoClosingOverTypeEdits = AutoClosingOvertypeOperation.getEdits(prevEditOperationType, config, model, selections, autoClosedCharacters, ch);
|
|
131
|
+
if (autoClosingOverTypeEdits !== undefined) {
|
|
132
|
+
return autoClosingOverTypeEdits;
|
|
786
133
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
return this._runAutoClosingOpenCharType(prevEditOperationType, config, model, selections, ch, false, autoClosingPairClose);
|
|
791
|
-
}
|
|
134
|
+
const autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, false, isDoingComposition);
|
|
135
|
+
if (autoClosingOpenCharEdits !== undefined) {
|
|
136
|
+
return autoClosingOpenCharEdits;
|
|
792
137
|
}
|
|
793
|
-
|
|
794
|
-
|
|
138
|
+
const surroundSelectionEdits = SurroundSelectionOperation.getEdits(config, model, selections, ch, isDoingComposition);
|
|
139
|
+
if (surroundSelectionEdits !== undefined) {
|
|
140
|
+
return surroundSelectionEdits;
|
|
795
141
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
return r;
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
const commands = [];
|
|
803
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
804
|
-
commands[i] = ( new ReplaceCommand(selections[i], ch));
|
|
142
|
+
const interceptorElectricCharOperation = InterceptorElectricCharOperation.getEdits(prevEditOperationType, config, model, selections, ch, isDoingComposition);
|
|
143
|
+
if (interceptorElectricCharOperation !== undefined) {
|
|
144
|
+
return interceptorElectricCharOperation;
|
|
805
145
|
}
|
|
806
|
-
|
|
807
|
-
return ( new EditOperationResult(opType, commands, {
|
|
808
|
-
shouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, opType),
|
|
809
|
-
shouldPushStackElementAfter: false
|
|
810
|
-
}));
|
|
146
|
+
return SimpleCharacterTypeOperation.getEdits(prevEditOperationType, selections, ch);
|
|
811
147
|
}
|
|
812
148
|
static typeWithoutInterceptors(prevEditOperationType, config, model, selections, str) {
|
|
813
|
-
|
|
814
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
815
|
-
commands[i] = ( new ReplaceCommand(selections[i], str));
|
|
816
|
-
}
|
|
817
|
-
const opType = getTypingOperation(str, prevEditOperationType);
|
|
818
|
-
return ( new EditOperationResult(opType, commands, {
|
|
819
|
-
shouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, opType),
|
|
820
|
-
shouldPushStackElementAfter: false
|
|
821
|
-
}));
|
|
822
|
-
}
|
|
823
|
-
static lineInsertBefore(config, model, selections) {
|
|
824
|
-
if (model === null || selections === null) {
|
|
825
|
-
return [];
|
|
826
|
-
}
|
|
827
|
-
const commands = [];
|
|
828
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
829
|
-
let lineNumber = selections[i].positionLineNumber;
|
|
830
|
-
if (lineNumber === 1) {
|
|
831
|
-
commands[i] = ( new ReplaceCommandWithoutChangingPosition(( new Range(1, 1, 1, 1)), '\n'));
|
|
832
|
-
}
|
|
833
|
-
else {
|
|
834
|
-
lineNumber--;
|
|
835
|
-
const column = model.getLineMaxColumn(lineNumber);
|
|
836
|
-
commands[i] = this._enter(config, model, false, ( new Range(lineNumber, column, lineNumber, column)));
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
return commands;
|
|
840
|
-
}
|
|
841
|
-
static lineInsertAfter(config, model, selections) {
|
|
842
|
-
if (model === null || selections === null) {
|
|
843
|
-
return [];
|
|
844
|
-
}
|
|
845
|
-
const commands = [];
|
|
846
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
847
|
-
const lineNumber = selections[i].positionLineNumber;
|
|
848
|
-
const column = model.getLineMaxColumn(lineNumber);
|
|
849
|
-
commands[i] = this._enter(config, model, false, ( new Range(lineNumber, column, lineNumber, column)));
|
|
850
|
-
}
|
|
851
|
-
return commands;
|
|
852
|
-
}
|
|
853
|
-
static lineBreakInsert(config, model, selections) {
|
|
854
|
-
const commands = [];
|
|
855
|
-
for (let i = 0, len = selections.length; i < len; i++) {
|
|
856
|
-
commands[i] = this._enter(config, model, true, selections[i]);
|
|
857
|
-
}
|
|
858
|
-
return commands;
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
class TypeWithAutoClosingCommand extends ReplaceCommandWithOffsetCursorState {
|
|
862
|
-
constructor(selection, openCharacter, insertOpenCharacter, closeCharacter) {
|
|
863
|
-
super(selection, (insertOpenCharacter ? openCharacter : '') + closeCharacter, 0, -closeCharacter.length);
|
|
864
|
-
this._openCharacter = openCharacter;
|
|
865
|
-
this._closeCharacter = closeCharacter;
|
|
866
|
-
this.closeCharacterRange = null;
|
|
867
|
-
this.enclosingRange = null;
|
|
868
|
-
}
|
|
869
|
-
computeCursorState(model, helper) {
|
|
870
|
-
const inverseEditOperations = helper.getInverseEditOperations();
|
|
871
|
-
const range = inverseEditOperations[0].range;
|
|
872
|
-
this.closeCharacterRange = ( new Range(
|
|
873
|
-
range.startLineNumber,
|
|
874
|
-
range.endColumn - this._closeCharacter.length,
|
|
875
|
-
range.endLineNumber,
|
|
876
|
-
range.endColumn
|
|
877
|
-
));
|
|
878
|
-
this.enclosingRange = ( new Range(
|
|
879
|
-
range.startLineNumber,
|
|
880
|
-
range.endColumn - this._openCharacter.length - this._closeCharacter.length,
|
|
881
|
-
range.endLineNumber,
|
|
882
|
-
range.endColumn
|
|
883
|
-
));
|
|
884
|
-
return super.computeCursorState(model, helper);
|
|
149
|
+
return TypeWithoutInterceptorsOperation.getEdits(prevEditOperationType, selections, str);
|
|
885
150
|
}
|
|
886
151
|
}
|
|
887
152
|
class CompositionOutcome {
|
|
@@ -894,32 +159,4 @@ class CompositionOutcome {
|
|
|
894
159
|
this.insertedSelectionEnd = insertedSelectionEnd;
|
|
895
160
|
}
|
|
896
161
|
}
|
|
897
|
-
|
|
898
|
-
if (typedText === ' ') {
|
|
899
|
-
return previousTypingOperation === EditOperationType.TypingFirstSpace
|
|
900
|
-
|| previousTypingOperation === EditOperationType.TypingConsecutiveSpace
|
|
901
|
-
? EditOperationType.TypingConsecutiveSpace
|
|
902
|
-
: EditOperationType.TypingFirstSpace;
|
|
903
|
-
}
|
|
904
|
-
return EditOperationType.TypingOther;
|
|
905
|
-
}
|
|
906
|
-
function shouldPushStackElementBetween(previousTypingOperation, typingOperation) {
|
|
907
|
-
if (isTypingOperation(previousTypingOperation) && !isTypingOperation(typingOperation)) {
|
|
908
|
-
return true;
|
|
909
|
-
}
|
|
910
|
-
if (previousTypingOperation === EditOperationType.TypingFirstSpace) {
|
|
911
|
-
return false;
|
|
912
|
-
}
|
|
913
|
-
return normalizeOperationType(previousTypingOperation) !== normalizeOperationType(typingOperation);
|
|
914
|
-
}
|
|
915
|
-
function normalizeOperationType(type) {
|
|
916
|
-
return (type === EditOperationType.TypingConsecutiveSpace || type === EditOperationType.TypingFirstSpace)
|
|
917
|
-
? 'space'
|
|
918
|
-
: type;
|
|
919
|
-
}
|
|
920
|
-
function isTypingOperation(type) {
|
|
921
|
-
return type === EditOperationType.TypingOther
|
|
922
|
-
|| type === EditOperationType.TypingFirstSpace
|
|
923
|
-
|| type === EditOperationType.TypingConsecutiveSpace;
|
|
924
|
-
}
|
|
925
|
-
export { CompositionOutcome, TypeOperations, TypeWithAutoClosingCommand };
|
|
162
|
+
export { CompositionOutcome, TypeOperations };
|