monaco-editor-core 0.58.0 → 0.59.0-dev-20261124
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 +2 -0
- package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +3 -0
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBoxNative.js +4 -2
- package/esm/vs/base/browser/ui/selectBox/selectBoxNative.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +27 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/common/cancellation.js +3 -1
- package/esm/vs/base/common/cancellation.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +8 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseTarget.js +15 -6
- package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
- package/esm/vs/editor/browser/view.js +3 -2
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +12 -8
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js +7 -11
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +246 -238
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
- package/esm/vs/editor/common/editorContextKeys.js +53 -53
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js +3 -1
- package/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +1 -0
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -11
- 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/codelensController.js +2 -2
- 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 +13 -13
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +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/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
- 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/findWidget.js +29 -29
- package/esm/vs/editor/contrib/folding/browser/folding.css +15 -0
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/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/contentHoverRendered.js +1 -1
- package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js +0 -5
- package/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +0 -3
- package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/hover.css +6 -2
- 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/hoverTypes.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +19 -39
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +7 -7
- 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/indentation/common/indentation.js +14 -3
- package/esm/vs/editor/contrib/indentation/common/indentation.js.map +1 -1
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +11 -10
- package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
- 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 +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
- 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/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +93 -38
- package/esm/vs/editor/contrib/suggest/browser/suggestModel.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +18 -18
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +3 -3
- 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 +24 -24
- 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 +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
- package/esm/vs/editor/editor.api.d.ts +5 -0
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +68 -68
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +30 -31
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +12 -12
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +3 -3
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationModels.js +15 -3
- package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationRegistry.js +12 -12
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +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 +5 -5
- package/esm/vs/platform/list/browser/listService.js +27 -27
- 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 +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/confettiColors.js +6 -6
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
- package/esm/vs/platform/theme/common/colors/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/quickpickColors.js +10 -10
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +5 -0
- package/package.json +3 -3
|
@@ -56,7 +56,7 @@ class ToggleCommentLineAction extends CommentLineAction {
|
|
|
56
56
|
constructor() {
|
|
57
57
|
super(0 /* Type.Toggle */, {
|
|
58
58
|
id: 'editor.action.commentLine',
|
|
59
|
-
label: nls.localize2(
|
|
59
|
+
label: nls.localize2(956, "Toggle Line Comment"),
|
|
60
60
|
precondition: EditorContextKeys.writable,
|
|
61
61
|
kbOpts: {
|
|
62
62
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -66,7 +66,7 @@ class ToggleCommentLineAction extends CommentLineAction {
|
|
|
66
66
|
menuOpts: {
|
|
67
67
|
menuId: MenuId.MenubarEditMenu,
|
|
68
68
|
group: '5_insert',
|
|
69
|
-
title: nls.localize(
|
|
69
|
+
title: nls.localize(954, "&&Toggle Line Comment"),
|
|
70
70
|
order: 1
|
|
71
71
|
},
|
|
72
72
|
canTriggerInlineEdits: true,
|
|
@@ -77,7 +77,7 @@ class AddLineCommentAction extends CommentLineAction {
|
|
|
77
77
|
constructor() {
|
|
78
78
|
super(1 /* Type.ForceAdd */, {
|
|
79
79
|
id: 'editor.action.addCommentLine',
|
|
80
|
-
label: nls.localize2(
|
|
80
|
+
label: nls.localize2(957, "Add Line Comment"),
|
|
81
81
|
precondition: EditorContextKeys.writable,
|
|
82
82
|
kbOpts: {
|
|
83
83
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -92,7 +92,7 @@ class RemoveLineCommentAction extends CommentLineAction {
|
|
|
92
92
|
constructor() {
|
|
93
93
|
super(2 /* Type.ForceRemove */, {
|
|
94
94
|
id: 'editor.action.removeCommentLine',
|
|
95
|
-
label: nls.localize2(
|
|
95
|
+
label: nls.localize2(958, "Remove Line Comment"),
|
|
96
96
|
precondition: EditorContextKeys.writable,
|
|
97
97
|
kbOpts: {
|
|
98
98
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -107,7 +107,7 @@ class BlockCommentAction extends EditorAction {
|
|
|
107
107
|
constructor() {
|
|
108
108
|
super({
|
|
109
109
|
id: 'editor.action.blockComment',
|
|
110
|
-
label: nls.localize2(
|
|
110
|
+
label: nls.localize2(959, "Toggle Block Comment"),
|
|
111
111
|
precondition: EditorContextKeys.writable,
|
|
112
112
|
kbOpts: {
|
|
113
113
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -118,7 +118,7 @@ class BlockCommentAction extends EditorAction {
|
|
|
118
118
|
menuOpts: {
|
|
119
119
|
menuId: MenuId.MenubarEditMenu,
|
|
120
120
|
group: '5_insert',
|
|
121
|
-
title: nls.localize(
|
|
121
|
+
title: nls.localize(955, "Toggle &&Block Comment"),
|
|
122
122
|
order: 2
|
|
123
123
|
},
|
|
124
124
|
canTriggerInlineEdits: true,
|
|
@@ -252,7 +252,7 @@ let ContextMenuController = class ContextMenuController {
|
|
|
252
252
|
};
|
|
253
253
|
const actions = [];
|
|
254
254
|
actions.push(createAction({
|
|
255
|
-
label: nls.localize(
|
|
255
|
+
label: nls.localize(960, "Minimap"),
|
|
256
256
|
checked: minimapOptions.enabled,
|
|
257
257
|
run: () => {
|
|
258
258
|
this._configurationService.updateValue(`editor.minimap.enabled`, !minimapOptions.enabled);
|
|
@@ -260,35 +260,35 @@ let ContextMenuController = class ContextMenuController {
|
|
|
260
260
|
}));
|
|
261
261
|
actions.push(new Separator());
|
|
262
262
|
actions.push(createAction({
|
|
263
|
-
label: nls.localize(
|
|
263
|
+
label: nls.localize(961, "Render Characters"),
|
|
264
264
|
enabled: minimapOptions.enabled,
|
|
265
265
|
checked: minimapOptions.renderCharacters,
|
|
266
266
|
run: () => {
|
|
267
267
|
this._configurationService.updateValue(`editor.minimap.renderCharacters`, !minimapOptions.renderCharacters);
|
|
268
268
|
}
|
|
269
269
|
}));
|
|
270
|
-
actions.push(createEnumAction(nls.localize(
|
|
271
|
-
label: nls.localize(
|
|
270
|
+
actions.push(createEnumAction(nls.localize(962, "Vertical size"), minimapOptions.enabled, 'editor.minimap.size', minimapOptions.size, [{
|
|
271
|
+
label: nls.localize(963, "Proportional"),
|
|
272
272
|
value: 'proportional'
|
|
273
273
|
}, {
|
|
274
|
-
label: nls.localize(
|
|
274
|
+
label: nls.localize(964, "Fill"),
|
|
275
275
|
value: 'fill'
|
|
276
276
|
}, {
|
|
277
|
-
label: nls.localize(
|
|
277
|
+
label: nls.localize(965, "Fit"),
|
|
278
278
|
value: 'fit'
|
|
279
279
|
}]));
|
|
280
|
-
actions.push(createEnumAction(nls.localize(
|
|
281
|
-
label: nls.localize(
|
|
280
|
+
actions.push(createEnumAction(nls.localize(966, "Slider"), minimapOptions.enabled, 'editor.minimap.showSlider', minimapOptions.showSlider, [{
|
|
281
|
+
label: nls.localize(967, "Mouse Over"),
|
|
282
282
|
value: 'mouseover'
|
|
283
283
|
}, {
|
|
284
|
-
label: nls.localize(
|
|
284
|
+
label: nls.localize(968, "Always"),
|
|
285
285
|
value: 'always'
|
|
286
286
|
}]));
|
|
287
|
-
actions.push(createEnumAction(nls.localize(
|
|
288
|
-
label: nls.localize(
|
|
287
|
+
actions.push(createEnumAction(nls.localize(969, "Side"), minimapOptions.enabled, 'editor.minimap.side', minimapOptions.side, [{
|
|
288
|
+
label: nls.localize(970, "Right"),
|
|
289
289
|
value: 'right'
|
|
290
290
|
}, {
|
|
291
|
-
label: nls.localize(
|
|
291
|
+
label: nls.localize(971, "Left"),
|
|
292
292
|
value: 'left'
|
|
293
293
|
}]));
|
|
294
294
|
const useShadowDOM = this._editor.getOption(147 /* EditorOption.useShadowDOM */) && !isIOS; // Do not use shadow dom on IOS #122035
|
|
@@ -328,7 +328,7 @@ class ShowContextMenu extends EditorAction {
|
|
|
328
328
|
constructor() {
|
|
329
329
|
super({
|
|
330
330
|
id: 'editor.action.showContextMenu',
|
|
331
|
-
label: nls.localize2(
|
|
331
|
+
label: nls.localize2(972, "Show Editor Context Menu"),
|
|
332
332
|
precondition: undefined,
|
|
333
333
|
kbOpts: {
|
|
334
334
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -100,7 +100,7 @@ export class CursorUndo extends EditorAction {
|
|
|
100
100
|
constructor() {
|
|
101
101
|
super({
|
|
102
102
|
id: 'cursorUndo',
|
|
103
|
-
label: nls.localize2(
|
|
103
|
+
label: nls.localize2(973, "Cursor Undo"),
|
|
104
104
|
precondition: undefined,
|
|
105
105
|
kbOpts: {
|
|
106
106
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -117,7 +117,7 @@ export class CursorRedo extends EditorAction {
|
|
|
117
117
|
constructor() {
|
|
118
118
|
super({
|
|
119
119
|
id: 'cursorRedo',
|
|
120
|
-
label: nls.localize2(
|
|
120
|
+
label: nls.localize2(974, "Cursor Redo"),
|
|
121
121
|
precondition: undefined
|
|
122
122
|
});
|
|
123
123
|
}
|
|
@@ -51,7 +51,7 @@ registerEditorAction(class PasteAsAction extends EditorAction {
|
|
|
51
51
|
properties: {
|
|
52
52
|
kind: {
|
|
53
53
|
type: 'string',
|
|
54
|
-
description: nls.localize(
|
|
54
|
+
description: nls.localize(975, "The kind of the paste edit to try pasting with.\nIf there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message."),
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
},
|
|
@@ -61,7 +61,7 @@ registerEditorAction(class PasteAsAction extends EditorAction {
|
|
|
61
61
|
properties: {
|
|
62
62
|
preferences: {
|
|
63
63
|
type: 'array',
|
|
64
|
-
description: nls.localize(
|
|
64
|
+
description: nls.localize(976, "List of preferred paste edit kind to try applying.\nThe first edit matching the preferences will be applied."),
|
|
65
65
|
items: { type: 'string' }
|
|
66
66
|
}
|
|
67
67
|
},
|
|
@@ -71,7 +71,7 @@ registerEditorAction(class PasteAsAction extends EditorAction {
|
|
|
71
71
|
constructor() {
|
|
72
72
|
super({
|
|
73
73
|
id: pasteAsCommandId,
|
|
74
|
-
label: nls.localize2(
|
|
74
|
+
label: nls.localize2(977, "Paste As..."),
|
|
75
75
|
precondition: EditorContextKeys.writable,
|
|
76
76
|
metadata: {
|
|
77
77
|
description: 'Paste as',
|
|
@@ -100,7 +100,7 @@ registerEditorAction(class extends EditorAction {
|
|
|
100
100
|
constructor() {
|
|
101
101
|
super({
|
|
102
102
|
id: 'editor.action.pasteAsText',
|
|
103
|
-
label: nls.localize2(
|
|
103
|
+
label: nls.localize2(978, "Paste as Text"),
|
|
104
104
|
precondition: EditorContextKeys.writable,
|
|
105
105
|
canTriggerInlineEdits: true,
|
|
106
106
|
});
|
|
@@ -43,7 +43,7 @@ import { PasteEditSession } from './pasteEditSession.js';
|
|
|
43
43
|
import { PostEditWidgetManager } from './postEditWidget.js';
|
|
44
44
|
export const changePasteTypeCommandId = 'editor.changePasteType';
|
|
45
45
|
export const pasteAsPreferenceConfig = 'editor.pasteAs.preferences';
|
|
46
|
-
export const pasteWidgetVisibleCtx = new RawContextKey('pasteWidgetVisible', false, localize(
|
|
46
|
+
export const pasteWidgetVisibleCtx = new RawContextKey('pasteWidgetVisible', false, localize(979, "Whether the paste widget is showing"));
|
|
47
47
|
const vscodeClipboardMime = 'application/vnd.code.copymetadata';
|
|
48
48
|
let CopyPasteController = class CopyPasteController extends Disposable {
|
|
49
49
|
static { CopyPasteController_1 = this; }
|
|
@@ -66,7 +66,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
66
66
|
this._register(editor.onWillCut(e => this.handleCopy(e)));
|
|
67
67
|
this._register(editor.onWillPaste(e => this.handlePaste(e)));
|
|
68
68
|
this._pasteProgressManager = this._register(new InlineProgressManager('pasteIntoEditor', editor, instantiationService));
|
|
69
|
-
this._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'pasteIntoEditor', editor, pasteWidgetVisibleCtx, { id: changePasteTypeCommandId, label: localize(
|
|
69
|
+
this._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'pasteIntoEditor', editor, pasteWidgetVisibleCtx, { id: changePasteTypeCommandId, label: localize(980, "Show paste options...") }, () => CopyPasteController_1._configureDefaultAction ? [CopyPasteController_1._configureDefaultAction] : []));
|
|
70
70
|
}
|
|
71
71
|
changePasteType() {
|
|
72
72
|
this._postPasteWidgetManager.tryShowSelector();
|
|
@@ -217,9 +217,9 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
217
217
|
const kindLabel = 'only' in preference
|
|
218
218
|
? preference.only.value
|
|
219
219
|
: 'preferences' in preference
|
|
220
|
-
? (preference.preferences.length ? preference.preferences.map(preference => preference.value).join(', ') : localize(
|
|
220
|
+
? (preference.preferences.length ? preference.preferences.map(preference => preference.value).join(', ') : localize(981, "empty"))
|
|
221
221
|
: preference.providerId;
|
|
222
|
-
MessageController.get(this._editor)?.showMessage(localize(
|
|
222
|
+
MessageController.get(this._editor)?.showMessage(localize(982, "No paste edits for '{0}' found", kindLabel), selections[0].getStartPosition());
|
|
223
223
|
}
|
|
224
224
|
doPasteInline(allProviders, selections, dataTransfer, metadata, clipboardEvent) {
|
|
225
225
|
this._logService.trace('CopyPasteController#doPasteInline');
|
|
@@ -270,7 +270,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
270
270
|
}
|
|
271
271
|
const resolveP = edit.provider.resolveDocumentPasteEdit(edit, resolveToken);
|
|
272
272
|
const showP = new DeferredPromise();
|
|
273
|
-
const resolved = await this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize(
|
|
273
|
+
const resolved = await this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize(983, "Resolving paste edit for '{0}'. Click to cancel", edit.title), raceCancellation(Promise.race([showP.p, resolveP]), resolveToken), {
|
|
274
274
|
cancel: () => showP.cancel()
|
|
275
275
|
}, 0);
|
|
276
276
|
if (resolved) {
|
|
@@ -289,7 +289,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
});
|
|
292
|
-
this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize(
|
|
292
|
+
this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize(984, "Running paste handlers. Click to cancel and do basic paste"), p, {
|
|
293
293
|
cancel: async () => {
|
|
294
294
|
p.cancel();
|
|
295
295
|
if (editorStateCts.token.isCancellationRequested) {
|
|
@@ -359,7 +359,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
359
359
|
else {
|
|
360
360
|
const configureDefaultItem = {
|
|
361
361
|
id: 'editor.pasteAs.default',
|
|
362
|
-
label: localize(
|
|
362
|
+
label: localize(985, "Configure default paste action"),
|
|
363
363
|
edit: undefined,
|
|
364
364
|
};
|
|
365
365
|
const selected = await this._quickInputService.pick([
|
|
@@ -376,7 +376,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
376
376
|
}
|
|
377
377
|
] : [])
|
|
378
378
|
], {
|
|
379
|
-
placeHolder: localize(
|
|
379
|
+
placeHolder: localize(986, "Select Paste Action"),
|
|
380
380
|
});
|
|
381
381
|
if (selected === configureDefaultItem) {
|
|
382
382
|
CopyPasteController_1._configureDefaultAction?.run();
|
|
@@ -400,7 +400,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
400
400
|
});
|
|
401
401
|
this._progressService.withProgress({
|
|
402
402
|
location: 10 /* ProgressLocation.Window */,
|
|
403
|
-
title: localize(
|
|
403
|
+
title: localize(987, "Running paste handlers"),
|
|
404
404
|
}, () => p);
|
|
405
405
|
this._currentPasteOperation = p;
|
|
406
406
|
}
|
|
@@ -72,7 +72,7 @@ export class DefaultTextPasteOrDropEditProvider extends SimplePasteAndDropProvid
|
|
|
72
72
|
const insertText = await textEntry.asString();
|
|
73
73
|
return {
|
|
74
74
|
handledMimeType: Mimes.text,
|
|
75
|
-
title: localize(
|
|
75
|
+
title: localize(988, "Insert Plain Text"),
|
|
76
76
|
insertText,
|
|
77
77
|
kind: this.kind,
|
|
78
78
|
};
|
|
@@ -105,14 +105,14 @@ class PathProvider extends SimplePasteAndDropProvider {
|
|
|
105
105
|
if (uriCount > 0) {
|
|
106
106
|
// Dropping at least one generic uri (such as https) so use most generic label
|
|
107
107
|
label = entries.length > 1
|
|
108
|
-
? localize(
|
|
109
|
-
: localize(
|
|
108
|
+
? localize(989, "Insert Uris")
|
|
109
|
+
: localize(990, "Insert Uri");
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
112
|
// All the paths are file paths
|
|
113
113
|
label = entries.length > 1
|
|
114
|
-
? localize(
|
|
115
|
-
: localize(
|
|
114
|
+
? localize(991, "Insert Paths")
|
|
115
|
+
: localize(992, "Insert Path");
|
|
116
116
|
}
|
|
117
117
|
return {
|
|
118
118
|
handledMimeType: Mimes.uriList,
|
|
@@ -145,8 +145,8 @@ let RelativePathProvider = class RelativePathProvider extends SimplePasteAndDrop
|
|
|
145
145
|
handledMimeType: Mimes.uriList,
|
|
146
146
|
insertText: relativeUris.join(' '),
|
|
147
147
|
title: entries.length > 1
|
|
148
|
-
? localize(
|
|
149
|
-
: localize(
|
|
148
|
+
? localize(993, "Insert Relative Paths")
|
|
149
|
+
: localize(994, "Insert Relative Path"),
|
|
150
150
|
kind: this.kind,
|
|
151
151
|
};
|
|
152
152
|
}
|
|
@@ -176,7 +176,7 @@ class PasteHtmlProvider {
|
|
|
176
176
|
edits: [{
|
|
177
177
|
insertText: htmlText,
|
|
178
178
|
yieldTo: this._yieldTo,
|
|
179
|
-
title: localize(
|
|
179
|
+
title: localize(995, 'Insert HTML'),
|
|
180
180
|
kind: this.kind,
|
|
181
181
|
}],
|
|
182
182
|
};
|
|
@@ -34,7 +34,7 @@ import { sortEditsByYieldTo } from './edit.js';
|
|
|
34
34
|
import { PostEditWidgetManager } from './postEditWidget.js';
|
|
35
35
|
export const dropAsPreferenceConfig = 'editor.dropIntoEditor.preferences';
|
|
36
36
|
export const changeDropTypeCommandId = 'editor.changeDropType';
|
|
37
|
-
export const dropWidgetVisibleCtx = new RawContextKey('dropWidgetVisible', false, localize(
|
|
37
|
+
export const dropWidgetVisibleCtx = new RawContextKey('dropWidgetVisible', false, localize(996, "Whether the drop widget is showing"));
|
|
38
38
|
let DropIntoEditorController = class DropIntoEditorController extends Disposable {
|
|
39
39
|
static { DropIntoEditorController_1 = this; }
|
|
40
40
|
static { this.ID = 'editor.contrib.dropIntoEditorController'; }
|
|
@@ -48,7 +48,7 @@ let DropIntoEditorController = class DropIntoEditorController extends Disposable
|
|
|
48
48
|
this._treeViewsDragAndDropService = _treeViewsDragAndDropService;
|
|
49
49
|
this.treeItemsTransfer = LocalSelectionTransfer.getInstance();
|
|
50
50
|
this._dropProgressManager = this._register(instantiationService.createInstance(InlineProgressManager, 'dropIntoEditor', editor));
|
|
51
|
-
this._postDropWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'dropIntoEditor', editor, dropWidgetVisibleCtx, { id: changeDropTypeCommandId, label: localize(
|
|
51
|
+
this._postDropWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'dropIntoEditor', editor, dropWidgetVisibleCtx, { id: changeDropTypeCommandId, label: localize(997, "Show drop options...") }, () => DropIntoEditorController_1._configureDefaultAction ? [DropIntoEditorController_1._configureDefaultAction] : []));
|
|
52
52
|
this._register(editor.onDropIntoEditor(e => this.onDropIntoEditor(editor, e.position, e.event)));
|
|
53
53
|
}
|
|
54
54
|
clearWidgets() {
|
|
@@ -103,7 +103,7 @@ let DropIntoEditorController = class DropIntoEditorController extends Disposable
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
-
this._dropProgressManager.showWhile(position, localize(
|
|
106
|
+
this._dropProgressManager.showWhile(position, localize(998, "Running drop handlers. Click to cancel"), p, { cancel: () => p.cancel() });
|
|
107
107
|
DropIntoEditorController_1._currentDropOperation = p;
|
|
108
108
|
}
|
|
109
109
|
async getDropEdits(providers, model, position, dataTransfer, token) {
|
|
@@ -170,7 +170,7 @@ let PostEditWidgetManager = class PostEditWidgetManager extends Disposable {
|
|
|
170
170
|
resolvedEdit = await raceCancellationError(resolve(edit, editorStateCts.token), editorStateCts.token);
|
|
171
171
|
}
|
|
172
172
|
catch (e) {
|
|
173
|
-
return handleError(e, localize(
|
|
173
|
+
return handleError(e, localize(999, "Error resolving edit '{0}':\n{1}", edit.title, toErrorMessage(e)));
|
|
174
174
|
}
|
|
175
175
|
finally {
|
|
176
176
|
editorStateCts.dispose();
|
|
@@ -193,7 +193,7 @@ let PostEditWidgetManager = class PostEditWidgetManager extends Disposable {
|
|
|
193
193
|
editRange = model.getDecorationRange(editTrackingDecoration[0]);
|
|
194
194
|
}
|
|
195
195
|
catch (e) {
|
|
196
|
-
return handleError(e, localize(
|
|
196
|
+
return handleError(e, localize(1000, "Error applying edit '{0}':\n{1}", edit.title, toErrorMessage(e)));
|
|
197
197
|
}
|
|
198
198
|
finally {
|
|
199
199
|
model.deltaDecorations(editTrackingDecoration, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCA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C;IAC7B,CAAC;IAEM,eAAe;QACrB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;IAC3C,CAAC;CACD,CAAA;AAxHY,qBAAqB;IAU/B,WAAA,qBAAqB,CAAA;IACrB,WAAA,gBAAgB,CAAA;IAChB,WAAA,oBAAoB,CAAA;GAZV,qBAAqB,CAwHjC","file":"postEditWidget.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 * as dom from '../../../../base/browser/dom.js';\nimport { Button } from '../../../../base/browser/ui/button/button.js';\nimport { IAction } from '../../../../base/common/actions.js';\nimport { raceCancellationError } from '../../../../base/common/async.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { toErrorMessage } from '../../../../base/common/errorMessage.js';\nimport { isCancellationError } from '../../../../base/common/errors.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { Disposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\nimport { localize } from '../../../../nls.js';\nimport { ActionListItemKind, IActionListItem } from '../../../../platform/actionWidget/browser/actionList.js';\nimport { IActionWidgetService } from '../../../../platform/actionWidget/browser/actionWidget.js';\nimport { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { INotificationService } from '../../../../platform/notification/common/notification.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js';\nimport { IBulkEditResult, IBulkEditService } from '../../../browser/services/bulkEditService.js';\nimport { Range } from '../../../common/core/range.js';\nimport { DocumentDropEdit, DocumentPasteEdit } from '../../../common/languages.js';\nimport { TrackedRangeStickiness } from '../../../common/model.js';\nimport { CodeEditorStateFlag, EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js';\nimport { createCombinedWorkspaceEdit } from './edit.js';\nimport { PasteEditSession } from './pasteEditSession.js';\nimport './postEditWidget.css';\n\n\ninterface EditSet<Edit extends DocumentPasteEdit | DocumentDropEdit> {\n\treadonly activeEditIndex: number;\n\treadonly allEdits: ReadonlyArray<Edit>;\n}\n\ninterface ShowCommand {\n\treadonly id: string;\n\treadonly label: string;\n}\n\nclass PostEditWidget<T extends DocumentPasteEdit | DocumentDropEdit> extends Disposable implements IContentWidget {\n\tprivate static readonly baseId = 'editor.widget.postEditWidget';\n\n\treadonly allowEditorOverflow = true;\n\treadonly suppressMouseDown = true;\n\n\tprivate readonly _editSession: PasteEditSession | undefined;\n\n\tprivate domNode!: HTMLElement;\n\tprivate button!: Button;\n\n\tprivate readonly visibleContext: IContextKey<boolean>;\n\n\tconstructor(\n\t\tprivate readonly typeId: string,\n\t\tprivate readonly editor: ICodeEditor,\n\t\tvisibleContext: RawContextKey<boolean>,\n\t\tprivate readonly showCommand: ShowCommand,\n\t\tprivate readonly range: Range,\n\t\tprivate readonly edits: EditSet<T>,\n\t\tprivate readonly onSelectNewEdit: (editIndex: number, editSession: PasteEditSession | undefined) => void,\n\t\tprivate readonly additionalActions: readonly IAction[],\n\t\teditSessionOwner: PasteEditSession | undefined,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IActionWidgetService private readonly _actionWidgetService: IActionWidgetService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editSession = editSessionOwner ? this._register(editSessionOwner.take()) : undefined;\n\t\tthis.create();\n\n\t\tthis.visibleContext = visibleContext.bindTo(contextKeyService);\n\t\tthis.visibleContext.set(true);\n\t\tthis._register(toDisposable(() => this.visibleContext.reset()));\n\n\t\tthis.editor.addContentWidget(this);\n\t\tthis.editor.layoutContentWidget(this);\n\n\t\tthis._register(toDisposable((() => this.editor.removeContentWidget(this))));\n\n\t\tthis._register(this.editor.onDidChangeCursorPosition(e => {\n\t\t\tthis.dispose();\n\t\t}));\n\n\t\tthis._register(Event.runAndSubscribe(_keybindingService.onDidUpdateKeybindings, () => {\n\t\t\tthis._updateButtonTitle();\n\t\t}));\n\t}\n\n\tprivate _updateButtonTitle() {\n\t\tthis.button.element.title = this._keybindingService.appendKeybinding(this.showCommand.label, this.showCommand.id);\n\t}\n\n\tprivate create(): void {\n\t\tthis.domNode = dom.$('.post-edit-widget');\n\n\t\tthis.button = this._register(new Button(this.domNode, {\n\t\t\tsupportIcons: true,\n\t\t}));\n\t\tthis.button.label = '$(insert)';\n\n\t\tthis._register(dom.addDisposableListener(this.domNode, dom.EventType.CLICK, () => this.showSelector()));\n\t}\n\n\tgetId(): string {\n\t\treturn PostEditWidget.baseId + '.' + this.typeId;\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\treturn {\n\t\t\tposition: this.range.getEndPosition(),\n\t\t\tpreference: [ContentWidgetPositionPreference.BELOW]\n\t\t};\n\t}\n\n\tshowSelector() {\n\t\tconst pos = dom.getDomNodePagePosition(this.button.element);\n\t\tconst anchor = { x: pos.left + pos.width, y: pos.top + pos.height };\n\n\t\tthis._actionWidgetService.show('postEditWidget', false,\n\t\t\tthis.edits.allEdits.map((edit, i): IActionListItem<T> => {\n\t\t\t\treturn {\n\t\t\t\t\tkind: ActionListItemKind.Action,\n\t\t\t\t\titem: edit,\n\t\t\t\t\tlabel: edit.title,\n\t\t\t\t\tdisabled: false,\n\t\t\t\t\tcanPreview: false,\n\t\t\t\t\tgroup: { title: '', icon: ThemeIcon.fromId(i === this.edits.activeEditIndex ? Codicon.check.id : Codicon.blank.id) },\n\t\t\t\t};\n\t\t\t}), {\n\t\t\tonHide: () => {\n\t\t\t\tthis.editor.focus();\n\t\t\t},\n\t\t\tonSelect: (item) => {\n\t\t\t\tthis._actionWidgetService.hide(false);\n\n\t\t\t\tconst i = this.edits.allEdits.findIndex(edit => edit === item);\n\t\t\t\tif (i !== this.edits.activeEditIndex) {\n\t\t\t\t\t// Transfer the edits before undo disposes this widget.\n\t\t\t\t\treturn this.onSelectNewEdit(i, this._editSession?.take());\n\t\t\t\t}\n\t\t\t},\n\t\t}, anchor, this.editor.getDomNode() ?? undefined, this.additionalActions);\n\t}\n}\n\nexport class PostEditWidgetManager<T extends DocumentPasteEdit | DocumentDropEdit> extends Disposable {\n\n\tprivate readonly _currentWidget = this._register(new MutableDisposable<PostEditWidget<T>>());\n\n\tconstructor(\n\t\tprivate readonly _id: string,\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _visibleContext: RawContextKey<boolean>,\n\t\tprivate readonly _showCommand: ShowCommand,\n\t\tprivate readonly _getAdditionalActions: () => readonly IAction[],\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IBulkEditService private readonly _bulkEditService: IBulkEditService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._register(Event.any(\n\t\t\t_editor.onDidChangeModel,\n\t\t\t_editor.onDidChangeModelContent,\n\t\t)(() => this.clear()));\n\t}\n\n\tpublic async applyEditAndShowIfNeeded(ranges: readonly Range[], edits: EditSet<T>, canShowWidget: boolean, resolve: (edit: T, token: CancellationToken) => Promise<T>, token: CancellationToken, editSessionOwner?: PasteEditSession): Promise<boolean> {\n\t\tif (!ranges.length || !this._editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst edit = edits.allEdits.at(edits.activeEditIndex);\n\t\tif (!edit) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst onDidSelectEdit = async (newEditIndex: number, editSession: PasteEditSession | undefined) => {\n\t\t\ttry {\n\t\t\t\tthis.clear();\n\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\tif (!model) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tawait model.undo();\n\t\t\t\tawait this.applyEditAndShowIfNeeded(ranges, { activeEditIndex: newEditIndex, allEdits: edits.allEdits }, canShowWidget, resolve, token, editSession);\n\t\t\t} finally {\n\t\t\t\teditSession?.dispose();\n\t\t\t}\n\t\t};\n\n\t\tconst handleError = (e: Error, message: string) => {\n\t\t\tif (isCancellationError(e)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis._notificationService.error(message);\n\t\t\tif (canShowWidget) {\n\t\t\t\tthis.show(ranges[0], edits, onDidSelectEdit, editSessionOwner);\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\tconst editorStateCts = new EditorStateCancellationTokenSource(this._editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection, undefined, token);\n\t\tlet resolvedEdit: T;\n\t\ttry {\n\t\t\tresolvedEdit = await raceCancellationError(resolve(edit, editorStateCts.token), editorStateCts.token);\n\t\t} catch (e) {\n\t\t\treturn handleError(e, localize('resolveError', \"Error resolving edit '{0}':\\n{1}\", edit.title, toErrorMessage(e)));\n\t\t} finally {\n\t\t\teditorStateCts.dispose();\n\t\t}\n\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, ranges, resolvedEdit);\n\n\t\t// Use a decoration to track edits around the trigger range\n\t\tconst primaryRange = ranges[0];\n\t\tconst editTrackingDecoration = model.deltaDecorations([], [{\n\t\t\trange: primaryRange,\n\t\t\toptions: { description: 'paste-line-suffix', stickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges }\n\t\t}]);\n\n\t\tthis._editor.focus();\n\t\tlet editResult: IBulkEditResult;\n\t\tlet editRange: Range | null;\n\t\ttry {\n\t\t\teditResult = await this._bulkEditService.apply(combinedWorkspaceEdit, { editor: this._editor, token });\n\t\t\teditRange = model.getDecorationRange(editTrackingDecoration[0]);\n\t\t} catch (e) {\n\t\t\treturn handleError(e, localize('applyError', \"Error applying edit '{0}':\\n{1}\", edit.title, toErrorMessage(e)));\n\t\t} finally {\n\t\t\tmodel.deltaDecorations(editTrackingDecoration, []);\n\t\t}\n\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (canShowWidget && editResult.isApplied && edits.allEdits.length > 1) {\n\t\t\tthis.show(editRange ?? primaryRange, edits, onDidSelectEdit, editSessionOwner);\n\t\t}\n\t\treturn editResult.isApplied;\n\t}\n\n\tpublic show(range: Range, edits: EditSet<T>, onDidSelectEdit: (newIndex: number, editSession: PasteEditSession | undefined) => void, editSessionOwner?: PasteEditSession) {\n\t\tthis.clear();\n\n\t\tif (this._editor.hasModel()) {\n\t\t\tthis._currentWidget.value = this._instantiationService.createInstance(PostEditWidget<T>, this._id, this._editor, this._visibleContext, this._showCommand, range, edits, onDidSelectEdit, this._getAdditionalActions(), editSessionOwner);\n\t\t}\n\t}\n\n\tpublic clear() {\n\t\tthis._currentWidget.clear();\n\t}\n\n\tpublic tryShowSelector() {\n\t\tthis._currentWidget.value?.showSelector();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MA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/*---------------------------------------------------------------------------------------------\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 * as dom from '../../../../base/browser/dom.js';\nimport { Button } from '../../../../base/browser/ui/button/button.js';\nimport { IAction } from '../../../../base/common/actions.js';\nimport { raceCancellationError } from '../../../../base/common/async.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { toErrorMessage } from '../../../../base/common/errorMessage.js';\nimport { isCancellationError } from '../../../../base/common/errors.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { Disposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\nimport { localize } from '../../../../nls.js';\nimport { ActionListItemKind, IActionListItem } from '../../../../platform/actionWidget/browser/actionList.js';\nimport { IActionWidgetService } from '../../../../platform/actionWidget/browser/actionWidget.js';\nimport { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { INotificationService } from '../../../../platform/notification/common/notification.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js';\nimport { IBulkEditResult, IBulkEditService } from '../../../browser/services/bulkEditService.js';\nimport { Range } from '../../../common/core/range.js';\nimport { DocumentDropEdit, DocumentPasteEdit } from '../../../common/languages.js';\nimport { TrackedRangeStickiness } from '../../../common/model.js';\nimport { CodeEditorStateFlag, EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js';\nimport { createCombinedWorkspaceEdit } from './edit.js';\nimport { PasteEditSession } from './pasteEditSession.js';\nimport './postEditWidget.css';\n\n\ninterface EditSet<Edit extends DocumentPasteEdit | DocumentDropEdit> {\n\treadonly activeEditIndex: number;\n\treadonly allEdits: ReadonlyArray<Edit>;\n}\n\ninterface ShowCommand {\n\treadonly id: string;\n\treadonly label: string;\n}\n\nclass PostEditWidget<T extends DocumentPasteEdit | DocumentDropEdit> extends Disposable implements IContentWidget {\n\tprivate static readonly baseId = 'editor.widget.postEditWidget';\n\n\treadonly allowEditorOverflow = true;\n\treadonly suppressMouseDown = true;\n\n\tprivate readonly _editSession: PasteEditSession | undefined;\n\n\tprivate domNode!: HTMLElement;\n\tprivate button!: Button;\n\n\tprivate readonly visibleContext: IContextKey<boolean>;\n\n\tconstructor(\n\t\tprivate readonly typeId: string,\n\t\tprivate readonly editor: ICodeEditor,\n\t\tvisibleContext: RawContextKey<boolean>,\n\t\tprivate readonly showCommand: ShowCommand,\n\t\tprivate readonly range: Range,\n\t\tprivate readonly edits: EditSet<T>,\n\t\tprivate readonly onSelectNewEdit: (editIndex: number, editSession: PasteEditSession | undefined) => void,\n\t\tprivate readonly additionalActions: readonly IAction[],\n\t\teditSessionOwner: PasteEditSession | undefined,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IActionWidgetService private readonly _actionWidgetService: IActionWidgetService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editSession = editSessionOwner ? this._register(editSessionOwner.take()) : undefined;\n\t\tthis.create();\n\n\t\tthis.visibleContext = visibleContext.bindTo(contextKeyService);\n\t\tthis.visibleContext.set(true);\n\t\tthis._register(toDisposable(() => this.visibleContext.reset()));\n\n\t\tthis.editor.addContentWidget(this);\n\t\tthis.editor.layoutContentWidget(this);\n\n\t\tthis._register(toDisposable((() => this.editor.removeContentWidget(this))));\n\n\t\tthis._register(this.editor.onDidChangeCursorPosition(e => {\n\t\t\tthis.dispose();\n\t\t}));\n\n\t\tthis._register(Event.runAndSubscribe(_keybindingService.onDidUpdateKeybindings, () => {\n\t\t\tthis._updateButtonTitle();\n\t\t}));\n\t}\n\n\tprivate _updateButtonTitle() {\n\t\tthis.button.element.title = this._keybindingService.appendKeybinding(this.showCommand.label, this.showCommand.id);\n\t}\n\n\tprivate create(): void {\n\t\tthis.domNode = dom.$('.post-edit-widget');\n\n\t\tthis.button = this._register(new Button(this.domNode, {\n\t\t\tsupportIcons: true,\n\t\t}));\n\t\tthis.button.label = '$(insert)';\n\n\t\tthis._register(dom.addDisposableListener(this.domNode, dom.EventType.CLICK, () => this.showSelector()));\n\t}\n\n\tgetId(): string {\n\t\treturn PostEditWidget.baseId + '.' + this.typeId;\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\treturn {\n\t\t\tposition: this.range.getEndPosition(),\n\t\t\tpreference: [ContentWidgetPositionPreference.BELOW]\n\t\t};\n\t}\n\n\tshowSelector() {\n\t\tconst pos = dom.getDomNodePagePosition(this.button.element);\n\t\tconst anchor = { x: pos.left + pos.width, y: pos.top + pos.height };\n\n\t\tthis._actionWidgetService.show('postEditWidget', false,\n\t\t\tthis.edits.allEdits.map((edit, i): IActionListItem<T> => {\n\t\t\t\treturn {\n\t\t\t\t\tkind: ActionListItemKind.Action,\n\t\t\t\t\titem: edit,\n\t\t\t\t\tlabel: edit.title,\n\t\t\t\t\tdisabled: false,\n\t\t\t\t\tcanPreview: false,\n\t\t\t\t\tgroup: { title: '', icon: ThemeIcon.fromId(i === this.edits.activeEditIndex ? Codicon.check.id : Codicon.blank.id) },\n\t\t\t\t};\n\t\t\t}), {\n\t\t\tonHide: () => {\n\t\t\t\tthis.editor.focus();\n\t\t\t},\n\t\t\tonSelect: (item) => {\n\t\t\t\tthis._actionWidgetService.hide(false);\n\n\t\t\t\tconst i = this.edits.allEdits.findIndex(edit => edit === item);\n\t\t\t\tif (i !== this.edits.activeEditIndex) {\n\t\t\t\t\t// Transfer the edits before undo disposes this widget.\n\t\t\t\t\treturn this.onSelectNewEdit(i, this._editSession?.take());\n\t\t\t\t}\n\t\t\t},\n\t\t}, anchor, this.editor.getDomNode() ?? undefined, this.additionalActions);\n\t}\n}\n\nexport class PostEditWidgetManager<T extends DocumentPasteEdit | DocumentDropEdit> extends Disposable {\n\n\tprivate readonly _currentWidget = this._register(new MutableDisposable<PostEditWidget<T>>());\n\n\tconstructor(\n\t\tprivate readonly _id: string,\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _visibleContext: RawContextKey<boolean>,\n\t\tprivate readonly _showCommand: ShowCommand,\n\t\tprivate readonly _getAdditionalActions: () => readonly IAction[],\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IBulkEditService private readonly _bulkEditService: IBulkEditService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._register(Event.any(\n\t\t\t_editor.onDidChangeModel,\n\t\t\t_editor.onDidChangeModelContent,\n\t\t)(() => this.clear()));\n\t}\n\n\tpublic async applyEditAndShowIfNeeded(ranges: readonly Range[], edits: EditSet<T>, canShowWidget: boolean, resolve: (edit: T, token: CancellationToken) => Promise<T>, token: CancellationToken, editSessionOwner?: PasteEditSession): Promise<boolean> {\n\t\tif (!ranges.length || !this._editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst edit = edits.allEdits.at(edits.activeEditIndex);\n\t\tif (!edit) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst onDidSelectEdit = async (newEditIndex: number, editSession: PasteEditSession | undefined) => {\n\t\t\ttry {\n\t\t\t\tthis.clear();\n\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\tif (!model) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tawait model.undo();\n\t\t\t\tawait this.applyEditAndShowIfNeeded(ranges, { activeEditIndex: newEditIndex, allEdits: edits.allEdits }, canShowWidget, resolve, token, editSession);\n\t\t\t} finally {\n\t\t\t\teditSession?.dispose();\n\t\t\t}\n\t\t};\n\n\t\tconst handleError = (e: Error, message: string) => {\n\t\t\tif (isCancellationError(e)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis._notificationService.error(message);\n\t\t\tif (canShowWidget) {\n\t\t\t\tthis.show(ranges[0], edits, onDidSelectEdit, editSessionOwner);\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\tconst editorStateCts = new EditorStateCancellationTokenSource(this._editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection, undefined, token);\n\t\tlet resolvedEdit: T;\n\t\ttry {\n\t\t\tresolvedEdit = await raceCancellationError(resolve(edit, editorStateCts.token), editorStateCts.token);\n\t\t} catch (e) {\n\t\t\treturn handleError(e, localize('resolveError', \"Error resolving edit '{0}':\\n{1}\", edit.title, toErrorMessage(e)));\n\t\t} finally {\n\t\t\teditorStateCts.dispose();\n\t\t}\n\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, ranges, resolvedEdit);\n\n\t\t// Use a decoration to track edits around the trigger range\n\t\tconst primaryRange = ranges[0];\n\t\tconst editTrackingDecoration = model.deltaDecorations([], [{\n\t\t\trange: primaryRange,\n\t\t\toptions: { description: 'paste-line-suffix', stickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges }\n\t\t}]);\n\n\t\tthis._editor.focus();\n\t\tlet editResult: IBulkEditResult;\n\t\tlet editRange: Range | null;\n\t\ttry {\n\t\t\teditResult = await this._bulkEditService.apply(combinedWorkspaceEdit, { editor: this._editor, token });\n\t\t\teditRange = model.getDecorationRange(editTrackingDecoration[0]);\n\t\t} catch (e) {\n\t\t\treturn handleError(e, localize('applyError', \"Error applying edit '{0}':\\n{1}\", edit.title, toErrorMessage(e)));\n\t\t} finally {\n\t\t\tmodel.deltaDecorations(editTrackingDecoration, []);\n\t\t}\n\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (canShowWidget && editResult.isApplied && edits.allEdits.length > 1) {\n\t\t\tthis.show(editRange ?? primaryRange, edits, onDidSelectEdit, editSessionOwner);\n\t\t}\n\t\treturn editResult.isApplied;\n\t}\n\n\tpublic show(range: Range, edits: EditSet<T>, onDidSelectEdit: (newIndex: number, editSession: PasteEditSession | undefined) => void, editSessionOwner?: PasteEditSession) {\n\t\tthis.clear();\n\n\t\tif (this._editor.hasModel()) {\n\t\t\tthis._currentWidget.value = this._instantiationService.createInstance(PostEditWidget<T>, this._id, this._editor, this._visibleContext, this._showCommand, range, edits, onDidSelectEdit, this._getAdditionalActions(), editSessionOwner);\n\t\t}\n\t}\n\n\tpublic clear() {\n\t\tthis._currentWidget.clear();\n\t}\n\n\tpublic tryShowSelector() {\n\t\tthis._currentWidget.value?.showSelector();\n\t}\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import { createDecorator } from '../../../../platform/instantiation/common/insta
|
|
|
10
10
|
import { registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
|
|
11
11
|
import { localize } from '../../../../nls.js';
|
|
12
12
|
const IEditorCancellationTokens = createDecorator('IEditorCancelService');
|
|
13
|
-
const ctxCancellableOperation = new RawContextKey('cancellableOperation', false, localize(
|
|
13
|
+
const ctxCancellableOperation = new RawContextKey('cancellableOperation', false, localize(1001, 'Whether the editor runs a cancellable operation, e.g. like \'Peek References\''));
|
|
14
14
|
registerSingleton(IEditorCancellationTokens, class {
|
|
15
15
|
constructor() {
|
|
16
16
|
this._tokens = new WeakMap();
|
|
@@ -314,7 +314,7 @@ let CommonFindController = class CommonFindController extends Disposable {
|
|
|
314
314
|
replaceAll() {
|
|
315
315
|
if (this._model) {
|
|
316
316
|
if (this._editor.getModel()?.isTooLargeForHeapOperation()) {
|
|
317
|
-
this._notificationService.warn(nls.localize(
|
|
317
|
+
this._notificationService.warn(nls.localize(1002, "The file is too large to perform a replace all operation."));
|
|
318
318
|
return false;
|
|
319
319
|
}
|
|
320
320
|
this._model.replaceAll();
|
|
@@ -435,7 +435,7 @@ FindController = __decorate([
|
|
|
435
435
|
export { FindController };
|
|
436
436
|
export const StartFindAction = registerMultiEditorAction(new MultiEditorAction({
|
|
437
437
|
id: FIND_IDS.StartFindAction,
|
|
438
|
-
label: nls.localize2(
|
|
438
|
+
label: nls.localize2(1010, "Find"),
|
|
439
439
|
precondition: ContextKeyExpr.or(EditorContextKeys.focus, ContextKeyExpr.has('editorIsOpen')),
|
|
440
440
|
kbOpts: {
|
|
441
441
|
kbExpr: null,
|
|
@@ -445,7 +445,7 @@ export const StartFindAction = registerMultiEditorAction(new MultiEditorAction({
|
|
|
445
445
|
menuOpts: {
|
|
446
446
|
menuId: MenuId.MenubarEditMenu,
|
|
447
447
|
group: '3_find',
|
|
448
|
-
title: nls.localize(
|
|
448
|
+
title: nls.localize(1003, "&&Find"),
|
|
449
449
|
order: 1
|
|
450
450
|
}
|
|
451
451
|
}));
|
|
@@ -486,7 +486,7 @@ export class StartFindWithArgsAction extends EditorAction {
|
|
|
486
486
|
constructor() {
|
|
487
487
|
super({
|
|
488
488
|
id: FIND_IDS.StartFindWithArgs,
|
|
489
|
-
label: nls.localize2(
|
|
489
|
+
label: nls.localize2(1011, "Find with Arguments"),
|
|
490
490
|
precondition: undefined,
|
|
491
491
|
kbOpts: {
|
|
492
492
|
kbExpr: null,
|
|
@@ -530,7 +530,7 @@ export class StartFindWithSelectionAction extends EditorAction {
|
|
|
530
530
|
constructor() {
|
|
531
531
|
super({
|
|
532
532
|
id: FIND_IDS.StartFindWithSelection,
|
|
533
|
-
label: nls.localize2(
|
|
533
|
+
label: nls.localize2(1012, "Find with Selection"),
|
|
534
534
|
precondition: undefined,
|
|
535
535
|
kbOpts: {
|
|
536
536
|
kbExpr: null,
|
|
@@ -603,14 +603,14 @@ async function matchFindAction(editor, next) {
|
|
|
603
603
|
// Re-announce "no results" for screen readers on explicit navigation (#301126)
|
|
604
604
|
const state = controller.getState();
|
|
605
605
|
if (wasFindWidgetVisible && state.matchesCount === 0 && state.searchString) {
|
|
606
|
-
alertFn(nls.localize(
|
|
606
|
+
alertFn(nls.localize(1004, "{0} found for '{1}'", NLS_NO_RESULTS, state.searchString));
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
export const NextMatchFindAction = registerMultiEditorAction(new MultiEditorAction({
|
|
612
612
|
id: FIND_IDS.NextMatchFindAction,
|
|
613
|
-
label: nls.localize2(
|
|
613
|
+
label: nls.localize2(1013, "Find Next"),
|
|
614
614
|
precondition: undefined,
|
|
615
615
|
kbOpts: [{
|
|
616
616
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -628,7 +628,7 @@ NextMatchFindAction.addImplementation(0, async (accessor, editor, args) => {
|
|
|
628
628
|
});
|
|
629
629
|
export const PreviousMatchFindAction = registerMultiEditorAction(new MultiEditorAction({
|
|
630
630
|
id: FIND_IDS.PreviousMatchFindAction,
|
|
631
|
-
label: nls.localize2(
|
|
631
|
+
label: nls.localize2(1014, "Find Previous"),
|
|
632
632
|
precondition: undefined,
|
|
633
633
|
kbOpts: [{
|
|
634
634
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -648,7 +648,7 @@ export class MoveToMatchFindAction extends EditorAction {
|
|
|
648
648
|
constructor() {
|
|
649
649
|
super({
|
|
650
650
|
id: FIND_IDS.GoToMatchFindAction,
|
|
651
|
-
label: nls.localize2(
|
|
651
|
+
label: nls.localize2(1015, "Go to Match..."),
|
|
652
652
|
precondition: CONTEXT_FIND_WIDGET_VISIBLE
|
|
653
653
|
});
|
|
654
654
|
this._highlightDecorations = [];
|
|
@@ -663,14 +663,14 @@ export class MoveToMatchFindAction extends EditorAction {
|
|
|
663
663
|
const notificationService = accessor.get(INotificationService);
|
|
664
664
|
notificationService.notify({
|
|
665
665
|
severity: Severity.Warning,
|
|
666
|
-
message: nls.localize(
|
|
666
|
+
message: nls.localize(1005, "No matches. Try searching for something else.")
|
|
667
667
|
});
|
|
668
668
|
return;
|
|
669
669
|
}
|
|
670
670
|
const quickInputService = accessor.get(IQuickInputService);
|
|
671
671
|
const disposables = new DisposableStore();
|
|
672
672
|
const inputBox = disposables.add(quickInputService.createInputBox());
|
|
673
|
-
inputBox.placeholder = nls.localize(
|
|
673
|
+
inputBox.placeholder = nls.localize(1006, "Type a number to go to a specific match (between 1 and {0})", matchesCount);
|
|
674
674
|
const toFindMatchIndex = (value) => {
|
|
675
675
|
const index = parseInt(value);
|
|
676
676
|
if (isNaN(index)) {
|
|
@@ -697,7 +697,7 @@ export class MoveToMatchFindAction extends EditorAction {
|
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
699
|
else {
|
|
700
|
-
inputBox.validationMessage = nls.localize(
|
|
700
|
+
inputBox.validationMessage = nls.localize(1007, "Please type a number between 1 and {0}", controller.getState().matchesCount);
|
|
701
701
|
this.clearDecorations(editor);
|
|
702
702
|
}
|
|
703
703
|
};
|
|
@@ -711,7 +711,7 @@ export class MoveToMatchFindAction extends EditorAction {
|
|
|
711
711
|
inputBox.hide();
|
|
712
712
|
}
|
|
713
713
|
else {
|
|
714
|
-
inputBox.validationMessage = nls.localize(
|
|
714
|
+
inputBox.validationMessage = nls.localize(1008, "Please type a number between 1 and {0}", controller.getState().matchesCount);
|
|
715
715
|
}
|
|
716
716
|
}));
|
|
717
717
|
disposables.add(inputBox.onDidHide(() => {
|
|
@@ -779,7 +779,7 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
|
|
|
779
779
|
constructor() {
|
|
780
780
|
super({
|
|
781
781
|
id: FIND_IDS.NextSelectionMatchFindAction,
|
|
782
|
-
label: nls.localize2(
|
|
782
|
+
label: nls.localize2(1016, "Find Next Selection"),
|
|
783
783
|
precondition: undefined,
|
|
784
784
|
kbOpts: {
|
|
785
785
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -796,7 +796,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
|
|
|
796
796
|
constructor() {
|
|
797
797
|
super({
|
|
798
798
|
id: FIND_IDS.PreviousSelectionMatchFindAction,
|
|
799
|
-
label: nls.localize2(
|
|
799
|
+
label: nls.localize2(1017, "Find Previous Selection"),
|
|
800
800
|
precondition: undefined,
|
|
801
801
|
kbOpts: {
|
|
802
802
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -811,7 +811,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
|
|
|
811
811
|
}
|
|
812
812
|
export const StartFindReplaceAction = registerMultiEditorAction(new MultiEditorAction({
|
|
813
813
|
id: FIND_IDS.StartFindReplaceAction,
|
|
814
|
-
label: nls.localize2(
|
|
814
|
+
label: nls.localize2(1018, "Replace"),
|
|
815
815
|
precondition: ContextKeyExpr.or(EditorContextKeys.focus, ContextKeyExpr.has('editorIsOpen')),
|
|
816
816
|
kbOpts: {
|
|
817
817
|
kbExpr: null,
|
|
@@ -822,7 +822,7 @@ export const StartFindReplaceAction = registerMultiEditorAction(new MultiEditorA
|
|
|
822
822
|
menuOpts: {
|
|
823
823
|
menuId: MenuId.MenubarEditMenu,
|
|
824
824
|
group: '3_find',
|
|
825
|
-
title: nls.localize(
|
|
825
|
+
title: nls.localize(1009, "&&Replace"),
|
|
826
826
|
order: 2
|
|
827
827
|
}
|
|
828
828
|
}));
|