monaco-editor-core 0.56.0-dev-20260121 → 0.56.0-dev-20260123
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 +6 -2
- package/esm/vs/base/browser/markdownRenderer.js +0 -1
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/tree/abstractTree.js +15 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/common/actions.js +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +2 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/errorMessage.js +6 -6
- package/esm/vs/base/common/keybindingLabels.js +20 -20
- package/esm/vs/base/common/network.js +0 -2
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +10 -4
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
- package/esm/vs/base/common/policy.js +5 -5
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
- package/esm/vs/editor/browser/coreCommands.js +3 -3
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/editorExtensions.js +9 -9
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +41 -0
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/services/inlineCompletionsService.js +4 -4
- package/esm/vs/editor/browser/services/renameSymbolTrackerService.js +15 -0
- package/esm/vs/editor/browser/services/renameSymbolTrackerService.js.map +1 -0
- package/esm/vs/editor/browser/view.js +3 -0
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js +14 -0
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +7 -0
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +8 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +2 -41
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +55 -55
- package/esm/vs/editor/common/config/editorOptions.js +410 -410
- package/esm/vs/editor/common/core/editorColorRegistry.js +70 -70
- package/esm/vs/editor/common/editorContextKeys.js +48 -48
- 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/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 +44 -34
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +5 -4
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js.map +1 -1
- 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 +10 -10
- 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/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
- package/esm/vs/editor/contrib/find/browser/findWidget.css +5 -6
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +2 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +54 -45
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/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/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +7 -7
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- 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 +107 -18
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
- 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/components/gutterIndicatorView.js.map +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/inlineCompletions/browser/view/inlineEdits/utils/utils.js +2 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- 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 +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +10 -10
- 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 +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +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/standalone/browser/services/standaloneWebWorkerService.js +2 -1
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +2 -0
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +34 -11
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +10 -0
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- 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/actions.js +2 -0
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- 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 +9 -9
- 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 +18 -18
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/package.json +2 -2
|
@@ -43,12 +43,12 @@ let SelectionAnchorController = class SelectionAnchorController {
|
|
|
43
43
|
this.decorationId = accessor.addDecoration(Selection.fromPositions(position, position), {
|
|
44
44
|
description: 'selection-anchor',
|
|
45
45
|
stickiness: 1 /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */,
|
|
46
|
-
hoverMessage: new MarkdownString().appendText(localize(
|
|
46
|
+
hoverMessage: new MarkdownString().appendText(localize(809, "Selection Anchor")),
|
|
47
47
|
className: 'selection-anchor'
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
this.selectionAnchorSetContextKey.set(!!this.decorationId);
|
|
51
|
-
alert(localize(
|
|
51
|
+
alert(localize(810, "Anchor set at {0}:{1}", position.lineNumber, position.column));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
goToSelectionAnchor() {
|
|
@@ -91,7 +91,7 @@ class SetSelectionAnchor extends EditorAction {
|
|
|
91
91
|
constructor() {
|
|
92
92
|
super({
|
|
93
93
|
id: 'editor.action.setSelectionAnchor',
|
|
94
|
-
label: localize2(
|
|
94
|
+
label: localize2(811, "Set Selection Anchor"),
|
|
95
95
|
precondition: undefined,
|
|
96
96
|
kbOpts: {
|
|
97
97
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -108,7 +108,7 @@ class GoToSelectionAnchor extends EditorAction {
|
|
|
108
108
|
constructor() {
|
|
109
109
|
super({
|
|
110
110
|
id: 'editor.action.goToSelectionAnchor',
|
|
111
|
-
label: localize2(
|
|
111
|
+
label: localize2(812, "Go to Selection Anchor"),
|
|
112
112
|
precondition: SelectionAnchorSet,
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -120,7 +120,7 @@ class SelectFromAnchorToCursor extends EditorAction {
|
|
|
120
120
|
constructor() {
|
|
121
121
|
super({
|
|
122
122
|
id: 'editor.action.selectFromAnchorToCursor',
|
|
123
|
-
label: localize2(
|
|
123
|
+
label: localize2(813, "Select from Anchor to Cursor"),
|
|
124
124
|
precondition: SelectionAnchorSet,
|
|
125
125
|
kbOpts: {
|
|
126
126
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -137,7 +137,7 @@ class CancelSelectionAnchor extends EditorAction {
|
|
|
137
137
|
constructor() {
|
|
138
138
|
super({
|
|
139
139
|
id: 'editor.action.cancelSelectionAnchor',
|
|
140
|
-
label: localize2(
|
|
140
|
+
label: localize2(814, "Cancel Selection Anchor"),
|
|
141
141
|
precondition: SelectionAnchorSet,
|
|
142
142
|
kbOpts: {
|
|
143
143
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -17,12 +17,12 @@ import { MenuId, MenuRegistry } from '../../../../platform/actions/common/action
|
|
|
17
17
|
import { registerColor } from '../../../../platform/theme/common/colorRegistry.js';
|
|
18
18
|
import { registerThemingParticipant, themeColorFromId } from '../../../../platform/theme/common/themeService.js';
|
|
19
19
|
import { editorBracketMatchForeground } from '../../../common/core/editorColorRegistry.js';
|
|
20
|
-
const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', '#A0A0A0', nls.localize(
|
|
20
|
+
const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', '#A0A0A0', nls.localize(815, 'Overview ruler marker color for matching brackets.'));
|
|
21
21
|
class JumpToBracketAction extends EditorAction {
|
|
22
22
|
constructor() {
|
|
23
23
|
super({
|
|
24
24
|
id: 'editor.action.jumpToBracket',
|
|
25
|
-
label: nls.localize2(
|
|
25
|
+
label: nls.localize2(817, "Go to Bracket"),
|
|
26
26
|
precondition: undefined,
|
|
27
27
|
kbOpts: {
|
|
28
28
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -39,10 +39,10 @@ class SelectToBracketAction extends EditorAction {
|
|
|
39
39
|
constructor() {
|
|
40
40
|
super({
|
|
41
41
|
id: 'editor.action.selectToBracket',
|
|
42
|
-
label: nls.localize2(
|
|
42
|
+
label: nls.localize2(818, "Select to Bracket"),
|
|
43
43
|
precondition: undefined,
|
|
44
44
|
metadata: {
|
|
45
|
-
description: nls.localize2(
|
|
45
|
+
description: nls.localize2(819, "Select the text inside and including the brackets or curly braces"),
|
|
46
46
|
args: [{
|
|
47
47
|
name: 'args',
|
|
48
48
|
schema: {
|
|
@@ -70,7 +70,7 @@ class RemoveBracketsAction extends EditorAction {
|
|
|
70
70
|
constructor() {
|
|
71
71
|
super({
|
|
72
72
|
id: 'editor.action.removeBrackets',
|
|
73
|
-
label: nls.localize2(
|
|
73
|
+
label: nls.localize2(820, "Remove Brackets"),
|
|
74
74
|
precondition: undefined,
|
|
75
75
|
kbOpts: {
|
|
76
76
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -343,7 +343,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
|
343
343
|
group: '5_infile_nav',
|
|
344
344
|
command: {
|
|
345
345
|
id: 'editor.action.jumpToBracket',
|
|
346
|
-
title: nls.localize(
|
|
346
|
+
title: nls.localize(816, "Go to &&Bracket")
|
|
347
347
|
},
|
|
348
348
|
order: 2
|
|
349
349
|
});
|
|
@@ -29,7 +29,7 @@ class MoveCaretLeftAction extends MoveCaretAction {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
super(true, {
|
|
31
31
|
id: 'editor.action.moveCarretLeftAction',
|
|
32
|
-
label: nls.localize2(
|
|
32
|
+
label: nls.localize2(821, "Move Selected Text Left"),
|
|
33
33
|
precondition: EditorContextKeys.writable
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -38,7 +38,7 @@ class MoveCaretRightAction extends MoveCaretAction {
|
|
|
38
38
|
constructor() {
|
|
39
39
|
super(false, {
|
|
40
40
|
id: 'editor.action.moveCarretRightAction',
|
|
41
|
-
label: nls.localize2(
|
|
41
|
+
label: nls.localize2(822, "Move Selected Text Right"),
|
|
42
42
|
precondition: EditorContextKeys.writable
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -12,7 +12,7 @@ class TransposeLettersAction extends EditorAction {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super({
|
|
14
14
|
id: 'editor.action.transposeLetters',
|
|
15
|
-
label: nls.localize2(
|
|
15
|
+
label: nls.localize2(823, "Transpose Letters"),
|
|
16
16
|
precondition: EditorContextKeys.writable,
|
|
17
17
|
kbOpts: {
|
|
18
18
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -41,23 +41,23 @@ export const CutAction = supportsCut ? registerCommand(new MultiCommand({
|
|
|
41
41
|
menuOpts: [{
|
|
42
42
|
menuId: MenuId.MenubarEditMenu,
|
|
43
43
|
group: '2_ccp',
|
|
44
|
-
title: nls.localize(
|
|
44
|
+
title: nls.localize(824, "Cu&&t"),
|
|
45
45
|
order: 1
|
|
46
46
|
}, {
|
|
47
47
|
menuId: MenuId.EditorContext,
|
|
48
48
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
49
|
-
title: nls.localize(
|
|
49
|
+
title: nls.localize(825, "Cut"),
|
|
50
50
|
when: EditorContextKeys.writable,
|
|
51
51
|
order: 1,
|
|
52
52
|
}, {
|
|
53
53
|
menuId: MenuId.CommandPalette,
|
|
54
54
|
group: '',
|
|
55
|
-
title: nls.localize(
|
|
55
|
+
title: nls.localize(826, "Cut"),
|
|
56
56
|
order: 1
|
|
57
57
|
}, {
|
|
58
58
|
menuId: MenuId.SimpleEditorContext,
|
|
59
59
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
60
|
-
title: nls.localize(
|
|
60
|
+
title: nls.localize(827, "Cut"),
|
|
61
61
|
when: EditorContextKeys.writable,
|
|
62
62
|
order: 1,
|
|
63
63
|
}]
|
|
@@ -76,29 +76,29 @@ export const CopyAction = supportsCopy ? registerCommand(new MultiCommand({
|
|
|
76
76
|
menuOpts: [{
|
|
77
77
|
menuId: MenuId.MenubarEditMenu,
|
|
78
78
|
group: '2_ccp',
|
|
79
|
-
title: nls.localize(
|
|
79
|
+
title: nls.localize(828, "&&Copy"),
|
|
80
80
|
order: 2
|
|
81
81
|
}, {
|
|
82
82
|
menuId: MenuId.EditorContext,
|
|
83
83
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
84
|
-
title: nls.localize(
|
|
84
|
+
title: nls.localize(829, "Copy"),
|
|
85
85
|
order: 2,
|
|
86
86
|
}, {
|
|
87
87
|
menuId: MenuId.CommandPalette,
|
|
88
88
|
group: '',
|
|
89
|
-
title: nls.localize(
|
|
89
|
+
title: nls.localize(830, "Copy"),
|
|
90
90
|
order: 1
|
|
91
91
|
}, {
|
|
92
92
|
menuId: MenuId.SimpleEditorContext,
|
|
93
93
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
94
|
-
title: nls.localize(
|
|
94
|
+
title: nls.localize(831, "Copy"),
|
|
95
95
|
order: 2,
|
|
96
96
|
}]
|
|
97
97
|
})) : undefined;
|
|
98
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2(
|
|
99
|
-
MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2(
|
|
100
|
-
MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2(
|
|
101
|
-
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2(
|
|
98
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2(836, "Copy As"), group: '2_ccp', order: 3 });
|
|
99
|
+
MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2(837, "Copy As"), group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 });
|
|
100
|
+
MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2(838, "Share"), group: '11_share', order: -1, when: ContextKeyExpr.and(ContextKeyExpr.notEquals('resourceScheme', 'output'), EditorContextKeys.editorTextFocus) });
|
|
101
|
+
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2(839, "Share"), group: '11_share', order: -1 });
|
|
102
102
|
export const PasteAction = supportsPaste ? registerCommand(new MultiCommand({
|
|
103
103
|
id: 'editor.action.clipboardPasteAction',
|
|
104
104
|
precondition: undefined,
|
|
@@ -114,23 +114,23 @@ export const PasteAction = supportsPaste ? registerCommand(new MultiCommand({
|
|
|
114
114
|
menuOpts: [{
|
|
115
115
|
menuId: MenuId.MenubarEditMenu,
|
|
116
116
|
group: '2_ccp',
|
|
117
|
-
title: nls.localize(
|
|
117
|
+
title: nls.localize(832, "&&Paste"),
|
|
118
118
|
order: 4
|
|
119
119
|
}, {
|
|
120
120
|
menuId: MenuId.EditorContext,
|
|
121
121
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
122
|
-
title: nls.localize(
|
|
122
|
+
title: nls.localize(833, "Paste"),
|
|
123
123
|
when: EditorContextKeys.writable,
|
|
124
124
|
order: 4,
|
|
125
125
|
}, {
|
|
126
126
|
menuId: MenuId.CommandPalette,
|
|
127
127
|
group: '',
|
|
128
|
-
title: nls.localize(
|
|
128
|
+
title: nls.localize(834, "Paste"),
|
|
129
129
|
order: 1
|
|
130
130
|
}, {
|
|
131
131
|
menuId: MenuId.SimpleEditorContext,
|
|
132
132
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
133
|
-
title: nls.localize(
|
|
133
|
+
title: nls.localize(835, "Paste"),
|
|
134
134
|
when: EditorContextKeys.writable,
|
|
135
135
|
order: 4,
|
|
136
136
|
}]
|
|
@@ -139,7 +139,7 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction {
|
|
|
139
139
|
constructor() {
|
|
140
140
|
super({
|
|
141
141
|
id: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',
|
|
142
|
-
label: nls.localize2(
|
|
142
|
+
label: nls.localize2(840, "Copy with Syntax Highlighting"),
|
|
143
143
|
precondition: undefined,
|
|
144
144
|
kbOpts: {
|
|
145
145
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -252,7 +252,7 @@ export async function applyCodeAction(accessor, item, codeActionReason, options,
|
|
|
252
252
|
const message = asMessage(err);
|
|
253
253
|
notificationService.error(typeof message === 'string'
|
|
254
254
|
? message
|
|
255
|
-
: nls.localize(
|
|
255
|
+
: nls.localize(841, "An unknown error occurred while applying the code action"));
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
// ensure the start sound and end sound do not overlap
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';
|
|
6
6
|
import { escapeRegExpCharacters } from '../../../../base/common/strings.js';
|
|
7
|
-
import { EditorAction, EditorCommand } from '../../../browser/editorExtensions.js';
|
|
7
|
+
import { EditorAction, EditorAction2, EditorCommand } from '../../../browser/editorExtensions.js';
|
|
8
8
|
import { EditorContextKeys } from '../../../common/editorContextKeys.js';
|
|
9
9
|
import { autoFixCommandId, codeActionCommandId, fixAllCommandId, organizeImportsCommandId, quickFixCommandId, refactorCommandId, sourceActionCommandId } from './codeAction.js';
|
|
10
10
|
import * as nls from '../../../../nls.js';
|
|
11
|
+
import { MenuId } from '../../../../platform/actions/common/actions.js';
|
|
11
12
|
import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
|
|
12
13
|
import { CodeActionCommandArgs, CodeActionKind, CodeActionTriggerSource } from '../common/types.js';
|
|
13
14
|
import { CodeActionController } from './codeActionController.js';
|
|
14
15
|
import { SUPPORTED_CODE_ACTIONS } from './codeActionModel.js';
|
|
16
|
+
import { Codicon } from '../../../../base/common/codicons.js';
|
|
15
17
|
function contextKeyForSupportedActions(kind) {
|
|
16
18
|
return ContextKeyExpr.regex(SUPPORTED_CODE_ACTIONS.keys()[0], new RegExp('(\\s|^)' + escapeRegExpCharacters(kind.value) + '\\b'));
|
|
17
19
|
}
|
|
@@ -21,23 +23,23 @@ const argsSchema = {
|
|
|
21
23
|
properties: {
|
|
22
24
|
'kind': {
|
|
23
25
|
type: 'string',
|
|
24
|
-
description: nls.localize(
|
|
26
|
+
description: nls.localize(842, "Kind of the code action to run."),
|
|
25
27
|
},
|
|
26
28
|
'apply': {
|
|
27
29
|
type: 'string',
|
|
28
|
-
description: nls.localize(
|
|
30
|
+
description: nls.localize(843, "Controls when the returned actions are applied."),
|
|
29
31
|
default: "ifSingle" /* CodeActionAutoApply.IfSingle */,
|
|
30
32
|
enum: ["first" /* CodeActionAutoApply.First */, "ifSingle" /* CodeActionAutoApply.IfSingle */, "never" /* CodeActionAutoApply.Never */],
|
|
31
33
|
enumDescriptions: [
|
|
32
|
-
nls.localize(
|
|
33
|
-
nls.localize(
|
|
34
|
-
nls.localize(
|
|
34
|
+
nls.localize(844, "Always apply the first returned code action."),
|
|
35
|
+
nls.localize(845, "Apply the first returned code action if it is the only one."),
|
|
36
|
+
nls.localize(846, "Do not apply the returned code actions."),
|
|
35
37
|
]
|
|
36
38
|
},
|
|
37
39
|
'preferred': {
|
|
38
40
|
type: 'boolean',
|
|
39
41
|
default: false,
|
|
40
|
-
description: nls.localize(
|
|
42
|
+
description: nls.localize(847, "Controls if only preferred code actions should be returned."),
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
};
|
|
@@ -47,21 +49,29 @@ function triggerCodeActionsForEditorSelection(editor, notAvailableMessage, filte
|
|
|
47
49
|
controller?.manualTriggerAtCurrentPosition(notAvailableMessage, triggerAction, filter, autoApply);
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
export class QuickFixAction extends
|
|
52
|
+
export class QuickFixAction extends EditorAction2 {
|
|
51
53
|
constructor() {
|
|
52
54
|
super({
|
|
53
55
|
id: quickFixCommandId,
|
|
54
|
-
|
|
56
|
+
title: nls.localize2(864, "Quick Fix..."),
|
|
55
57
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
icon: Codicon.lightBulb,
|
|
59
|
+
f1: true,
|
|
60
|
+
keybinding: {
|
|
61
|
+
when: EditorContextKeys.textInputFocus,
|
|
58
62
|
primary: 2048 /* KeyMod.CtrlCmd */ | 89 /* KeyCode.Period */,
|
|
59
63
|
weight: 100 /* KeybindingWeight.EditorContrib */
|
|
64
|
+
},
|
|
65
|
+
menu: {
|
|
66
|
+
id: MenuId.InlineChatEditorAffordance,
|
|
67
|
+
group: '0_quickfix',
|
|
68
|
+
order: 0,
|
|
69
|
+
when: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider)
|
|
60
70
|
}
|
|
61
71
|
});
|
|
62
72
|
}
|
|
63
|
-
|
|
64
|
-
return triggerCodeActionsForEditorSelection(editor, nls.localize(
|
|
73
|
+
runEditorCommand(_accessor, editor) {
|
|
74
|
+
return triggerCodeActionsForEditorSelection(editor, nls.localize(848, "No code actions available"), undefined, undefined, CodeActionTriggerSource.QuickFix);
|
|
65
75
|
}
|
|
66
76
|
}
|
|
67
77
|
export class CodeActionCommand extends EditorCommand {
|
|
@@ -82,11 +92,11 @@ export class CodeActionCommand extends EditorCommand {
|
|
|
82
92
|
});
|
|
83
93
|
return triggerCodeActionsForEditorSelection(editor, typeof userArgs?.kind === 'string'
|
|
84
94
|
? args.preferred
|
|
85
|
-
? nls.localize(
|
|
86
|
-
: nls.localize(
|
|
95
|
+
? nls.localize(849, "No preferred code actions for '{0}' available", userArgs.kind)
|
|
96
|
+
: nls.localize(850, "No code actions for '{0}' available", userArgs.kind)
|
|
87
97
|
: args.preferred
|
|
88
|
-
? nls.localize(
|
|
89
|
-
: nls.localize(
|
|
98
|
+
? nls.localize(851, "No preferred code actions available")
|
|
99
|
+
: nls.localize(852, "No code actions available"), {
|
|
90
100
|
include: args.kind,
|
|
91
101
|
includeSourceActions: true,
|
|
92
102
|
onlyIncludePreferredActions: args.preferred,
|
|
@@ -97,7 +107,7 @@ export class RefactorAction extends EditorAction {
|
|
|
97
107
|
constructor() {
|
|
98
108
|
super({
|
|
99
109
|
id: refactorCommandId,
|
|
100
|
-
label: nls.localize2(
|
|
110
|
+
label: nls.localize2(865, "Refactor..."),
|
|
101
111
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),
|
|
102
112
|
kbOpts: {
|
|
103
113
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -125,11 +135,11 @@ export class RefactorAction extends EditorAction {
|
|
|
125
135
|
});
|
|
126
136
|
return triggerCodeActionsForEditorSelection(editor, typeof userArgs?.kind === 'string'
|
|
127
137
|
? args.preferred
|
|
128
|
-
? nls.localize(
|
|
129
|
-
: nls.localize(
|
|
138
|
+
? nls.localize(853, "No preferred refactorings for '{0}' available", userArgs.kind)
|
|
139
|
+
: nls.localize(854, "No refactorings for '{0}' available", userArgs.kind)
|
|
130
140
|
: args.preferred
|
|
131
|
-
? nls.localize(
|
|
132
|
-
: nls.localize(
|
|
141
|
+
? nls.localize(855, "No preferred refactorings available")
|
|
142
|
+
: nls.localize(856, "No refactorings available"), {
|
|
133
143
|
include: CodeActionKind.Refactor.contains(args.kind) ? args.kind : HierarchicalKind.None,
|
|
134
144
|
onlyIncludePreferredActions: args.preferred
|
|
135
145
|
}, args.apply, CodeActionTriggerSource.Refactor);
|
|
@@ -139,7 +149,7 @@ export class SourceAction extends EditorAction {
|
|
|
139
149
|
constructor() {
|
|
140
150
|
super({
|
|
141
151
|
id: sourceActionCommandId,
|
|
142
|
-
label: nls.localize2(
|
|
152
|
+
label: nls.localize2(866, "Source Action..."),
|
|
143
153
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),
|
|
144
154
|
contextMenuOpts: {
|
|
145
155
|
group: '1_modification',
|
|
@@ -159,11 +169,11 @@ export class SourceAction extends EditorAction {
|
|
|
159
169
|
});
|
|
160
170
|
return triggerCodeActionsForEditorSelection(editor, typeof userArgs?.kind === 'string'
|
|
161
171
|
? args.preferred
|
|
162
|
-
? nls.localize(
|
|
163
|
-
: nls.localize(
|
|
172
|
+
? nls.localize(857, "No preferred source actions for '{0}' available", userArgs.kind)
|
|
173
|
+
: nls.localize(858, "No source actions for '{0}' available", userArgs.kind)
|
|
164
174
|
: args.preferred
|
|
165
|
-
? nls.localize(
|
|
166
|
-
: nls.localize(
|
|
175
|
+
? nls.localize(859, "No preferred source actions available")
|
|
176
|
+
: nls.localize(860, "No source actions available"), {
|
|
167
177
|
include: CodeActionKind.Source.contains(args.kind) ? args.kind : HierarchicalKind.None,
|
|
168
178
|
includeSourceActions: true,
|
|
169
179
|
onlyIncludePreferredActions: args.preferred,
|
|
@@ -174,7 +184,7 @@ export class OrganizeImportsAction extends EditorAction {
|
|
|
174
184
|
constructor() {
|
|
175
185
|
super({
|
|
176
186
|
id: organizeImportsCommandId,
|
|
177
|
-
label: nls.localize2(
|
|
187
|
+
label: nls.localize2(867, "Organize Imports"),
|
|
178
188
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),
|
|
179
189
|
kbOpts: {
|
|
180
190
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -182,31 +192,31 @@ export class OrganizeImportsAction extends EditorAction {
|
|
|
182
192
|
weight: 100 /* KeybindingWeight.EditorContrib */
|
|
183
193
|
},
|
|
184
194
|
metadata: {
|
|
185
|
-
description: nls.localize2(
|
|
195
|
+
description: nls.localize2(868, "Organize imports in the current file. Also called 'Optimize Imports' by some tools")
|
|
186
196
|
}
|
|
187
197
|
});
|
|
188
198
|
}
|
|
189
199
|
run(_accessor, editor) {
|
|
190
|
-
return triggerCodeActionsForEditorSelection(editor, nls.localize(
|
|
200
|
+
return triggerCodeActionsForEditorSelection(editor, nls.localize(861, "No organize imports action available"), { include: CodeActionKind.SourceOrganizeImports, includeSourceActions: true }, "ifSingle" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.OrganizeImports);
|
|
191
201
|
}
|
|
192
202
|
}
|
|
193
203
|
export class FixAllAction extends EditorAction {
|
|
194
204
|
constructor() {
|
|
195
205
|
super({
|
|
196
206
|
id: fixAllCommandId,
|
|
197
|
-
label: nls.localize2(
|
|
207
|
+
label: nls.localize2(869, "Fix All"),
|
|
198
208
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.SourceFixAll))
|
|
199
209
|
});
|
|
200
210
|
}
|
|
201
211
|
run(_accessor, editor) {
|
|
202
|
-
return triggerCodeActionsForEditorSelection(editor, nls.localize(
|
|
212
|
+
return triggerCodeActionsForEditorSelection(editor, nls.localize(862, "No fix all action available"), { include: CodeActionKind.SourceFixAll, includeSourceActions: true }, "ifSingle" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.FixAll);
|
|
203
213
|
}
|
|
204
214
|
}
|
|
205
215
|
export class AutoFixAction extends EditorAction {
|
|
206
216
|
constructor() {
|
|
207
217
|
super({
|
|
208
218
|
id: autoFixCommandId,
|
|
209
|
-
label: nls.localize2(
|
|
219
|
+
label: nls.localize2(870, "Auto Fix..."),
|
|
210
220
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.QuickFix)),
|
|
211
221
|
kbOpts: {
|
|
212
222
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -219,7 +229,7 @@ export class AutoFixAction extends EditorAction {
|
|
|
219
229
|
});
|
|
220
230
|
}
|
|
221
231
|
run(_accessor, editor) {
|
|
222
|
-
return triggerCodeActionsForEditorSelection(editor, nls.localize(
|
|
232
|
+
return triggerCodeActionsForEditorSelection(editor, nls.localize(863, "No auto fixes available"), {
|
|
223
233
|
include: CodeActionKind.QuickFix,
|
|
224
234
|
onlyIncludePreferredActions: true
|
|
225
235
|
}, "ifSingle" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.AutoFix);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/codeAction/browser/codeActionCommands.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAG/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAoB,MAAM,sCAAsC,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAChL,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAEtF,OAAO,EAAuB,qBAAqB,EAAoB,cAAc,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC3I,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,SAAS,6BAA6B,CAAC,IAAsB;IAC5D,OAAO,cAAc,CAAC,KAAK,CAC1B,sBAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAChC,IAAI,MAAM,CAAC,SAAS,GAAG,sBAAsB,CA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AC,cAAc,CAAC,YAAY,CAAC,CAAC;SAC5D,CAAC,CAAC;IACJ,CAAC;IAEM,GAAG,CAAC,SAA2B,EAAE,MAAmB;QAC1D,OAAO,oCAAoC,CAAC,MAAM,EACjD,GAAG,CAAC,QAAQ,CAAC,GAAoB,EAAE,6BAA6B,CAAC,EACjE,EAAE,OAAO,EAAE,cAAc,CAAC,YAAY,EAAE,oBAAoB,EAAE,IAAI,EAAE,iDACtC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;CACD;AAED,MAAM,OAAO,aAAc,SAAQ,YAAY;IAE9C;QACC,KAAK,CAAC;YACL,EAAE,EAAE,gBAAgB;YACpB,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,GAAe,EAAE,aAAa,CAAC;YACpD,YAAY,EAAE,cAAc,CAAC,GAAG,CAC/B,iBAAiB,CAAC,QAAQ,EAC1B,6BAA6B,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YACxD,MAAM,EAAE;gBACP,MAAM,EAAE,iBAAiB,CAAC,cAAc;gBACxC,OAAO,EAAE,8CAAyB,0BAAiB;gBACnD,GAAG,EAAE;oBACJ,OAAO,EAAE,gDAA2B,0BAAiB;iBACrD;gBACD,MAAM,0CAAgC;aACtC;SACD,CAAC,CAAC;IACJ,CAAC;IAEM,GAAG,CAAC,SAA2B,EAAE,MAAmB;QAC1D,OAAO,oCAAoC,CAAC,MAAM,EACjD,GAAG,CAAC,QAAQ,CAAC,GAAmC,EAAE,yBAAyB,CAAC,EAC5E;YACC,OAAO,EAAE,cAAc,CAAC,QAAQ;YAChC,2BAA2B,EAAE,IAAI;SACjC,iDAC6B,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;CACD","file":"codeActionCommands.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 { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { IJSONSchema, TypeFromJsonSchema } from '../../../../base/common/jsonSchema.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport { escapeRegExpCharacters } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorAction, EditorCommand, ServicesAccessor } from '../../../browser/editorExtensions.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { autoFixCommandId, codeActionCommandId, fixAllCommandId, organizeImportsCommandId, quickFixCommandId, refactorCommandId, sourceActionCommandId } from './codeAction.js';\nimport * as nls from '../../../../nls.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nimport { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { CodeActionAutoApply, CodeActionCommandArgs, CodeActionFilter, CodeActionKind, CodeActionTriggerSource } from '../common/types.js';\nimport { CodeActionController } from './codeActionController.js';\nimport { SUPPORTED_CODE_ACTIONS } from './codeActionModel.js';\n\nfunction contextKeyForSupportedActions(kind: HierarchicalKind) {\n\treturn ContextKeyExpr.regex(\n\t\tSUPPORTED_CODE_ACTIONS.keys()[0],\n\t\tnew RegExp('(\\\\s|^)' + escapeRegExpCharacters(kind.value) + '\\\\b'));\n}\n\nconst argsSchema = {\n\ttype: 'object',\n\tdefaultSnippets: [{ body: { kind: '' } }],\n\tproperties: {\n\t\t'kind': {\n\t\t\ttype: 'string',\n\t\t\tdescription: nls.localize('args.schema.kind', \"Kind of the code action to run.\"),\n\t\t},\n\t\t'apply': {\n\t\t\ttype: 'string',\n\t\t\tdescription: nls.localize('args.schema.apply', \"Controls when the returned actions are applied.\"),\n\t\t\tdefault: CodeActionAutoApply.IfSingle,\n\t\t\tenum: [CodeActionAutoApply.First, CodeActionAutoApply.IfSingle, CodeActionAutoApply.Never],\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('args.schema.apply.first', \"Always apply the first returned code action.\"),\n\t\t\t\tnls.localize('args.schema.apply.ifSingle', \"Apply the first returned code action if it is the only one.\"),\n\t\t\t\tnls.localize('args.schema.apply.never', \"Do not apply the returned code actions.\"),\n\t\t\t]\n\t\t},\n\t\t'preferred': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription: nls.localize('args.schema.preferred', \"Controls if only preferred code actions should be returned.\"),\n\t\t}\n\t}\n} as const satisfies IJSONSchema;\n\nfunction triggerCodeActionsForEditorSelection(\n\teditor: ICodeEditor,\n\tnotAvailableMessage: string,\n\tfilter: CodeActionFilter | undefined,\n\tautoApply: CodeActionAutoApply | undefined,\n\ttriggerAction: CodeActionTriggerSource = CodeActionTriggerSource.Default\n): void {\n\tif (editor.hasModel()) {\n\t\tconst controller = CodeActionController.get(editor);\n\t\tcontroller?.manualTriggerAtCurrentPosition(notAvailableMessage, triggerAction, filter, autoApply);\n\t}\n}\n\nexport class QuickFixAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: quickFixCommandId,\n\t\t\tlabel: nls.localize2('quickfix.trigger.label', \"Quick Fix...\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Period,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor, nls.localize('editor.action.quickFix.noneMessage', \"No code actions available\"), undefined, undefined, CodeActionTriggerSource.QuickFix);\n\t}\n}\n\nexport class CodeActionCommand extends EditorCommand {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: codeActionCommandId,\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tmetadata: {\n\t\t\t\tdescription: 'Trigger a code action',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema, }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic runEditorCommand(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs?: TypeFromJsonSchema<typeof argsSchema>): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: HierarchicalKind.Empty,\n\t\t\tapply: CodeActionAutoApply.IfSingle,\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.codeAction.noneMessage.preferred.kind', \"No preferred code actions for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.codeAction.noneMessage.kind', \"No code actions for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.codeAction.noneMessage.preferred', \"No preferred code actions available\")\n\t\t\t\t\t: nls.localize('editor.action.codeAction.noneMessage', \"No code actions available\"),\n\t\t\t{\n\t\t\t\tinclude: args.kind,\n\t\t\t\tincludeSourceActions: true,\n\t\t\t\tonlyIncludePreferredActions: args.preferred,\n\t\t\t},\n\t\t\targs.apply);\n\t}\n}\n\n\nexport class RefactorAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: refactorCommandId,\n\t\t\tlabel: nls.localize2('refactor.label', \"Refactor...\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyR,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KeyR\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 2,\n\t\t\t\twhen: ContextKeyExpr.and(\n\t\t\t\t\tEditorContextKeys.writable,\n\t\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.Refactor)),\n\t\t\t},\n\t\t\tmetadata: {\n\t\t\t\tdescription: 'Refactor...',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs?: TypeFromJsonSchema<typeof argsSchema>): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: CodeActionKind.Refactor,\n\t\t\tapply: CodeActionAutoApply.Never\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.refactor.noneMessage.preferred.kind', \"No preferred refactorings for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.refactor.noneMessage.kind', \"No refactorings for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.refactor.noneMessage.preferred', \"No preferred refactorings available\")\n\t\t\t\t\t: nls.localize('editor.action.refactor.noneMessage', \"No refactorings available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.Refactor.contains(args.kind) ? args.kind : HierarchicalKind.None,\n\t\t\t\tonlyIncludePreferredActions: args.preferred\n\t\t\t},\n\t\t\targs.apply, CodeActionTriggerSource.Refactor);\n\t}\n}\n\nexport class SourceAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: sourceActionCommandId,\n\t\t\tlabel: nls.localize2('source.label', \"Source Action...\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 2.1,\n\t\t\t\twhen: ContextKeyExpr.and(\n\t\t\t\t\tEditorContextKeys.writable,\n\t\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.Source)),\n\t\t\t},\n\t\t\tmetadata: {\n\t\t\t\tdescription: 'Source Action...',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs?: TypeFromJsonSchema<typeof argsSchema>): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: CodeActionKind.Source,\n\t\t\tapply: CodeActionAutoApply.Never\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.source.noneMessage.preferred.kind', \"No preferred source actions for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.source.noneMessage.kind', \"No source actions for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.source.noneMessage.preferred', \"No preferred source actions available\")\n\t\t\t\t\t: nls.localize('editor.action.source.noneMessage', \"No source actions available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.Source.contains(args.kind) ? args.kind : HierarchicalKind.None,\n\t\t\t\tincludeSourceActions: true,\n\t\t\t\tonlyIncludePreferredActions: args.preferred,\n\t\t\t},\n\t\t\targs.apply, CodeActionTriggerSource.SourceAction);\n\t}\n}\n\nexport class OrganizeImportsAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: organizeImportsCommandId,\n\t\t\tlabel: nls.localize2('organizeImports.label', \"Organize Imports\"),\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.KeyO,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmetadata: {\n\t\t\t\tdescription: nls.localize2('organizeImports.description', \"Organize imports in the current file. Also called 'Optimize Imports' by some tools\")\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.organize.noneMessage', \"No organize imports action available\"),\n\t\t\t{ include: CodeActionKind.SourceOrganizeImports, includeSourceActions: true },\n\t\t\tCodeActionAutoApply.IfSingle, CodeActionTriggerSource.OrganizeImports);\n\t}\n}\n\nexport class FixAllAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: fixAllCommandId,\n\t\t\tlabel: nls.localize2('fixAll.label', \"Fix All\"),\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.SourceFixAll))\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('fixAll.noneMessage', \"No fix all action available\"),\n\t\t\t{ include: CodeActionKind.SourceFixAll, includeSourceActions: true },\n\t\t\tCodeActionAutoApply.IfSingle, CodeActionTriggerSource.FixAll);\n\t}\n}\n\nexport class AutoFixAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: autoFixCommandId,\n\t\t\tlabel: nls.localize2('autoFix.label', \"Auto Fix...\"),\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.QuickFix)),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.Alt | KeyMod.Shift | KeyCode.Period,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Period\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.autoFix.noneMessage', \"No auto fixes available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.QuickFix,\n\t\t\t\tonlyIncludePreferredActions: true\n\t\t\t},\n\t\t\tCodeActionAutoApply.IfSingle, CodeActionTriggerSource.AutoFix);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/codeAction/browser/codeActionCommands.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAG/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAoB,MAAM,sCAAsC,CAAC;AACpH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAChL,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,gDAAgD,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAEtF,OAAO,EAAuB,qBAAqB,EAAoB,cAAc,EAAE,uBAAuB,EAAE,MAAM,o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AAM,EAAE,iBAAiB,CAAC,cAAc;gBACxC,OAAO,EAAE,8CAAyB,0BAAiB;gBACnD,GAAG,EAAE;oBACJ,OAAO,EAAE,gDAA2B,0BAAiB;iBACrD;gBACD,MAAM,0CAAgC;aACtC;SACD,CAAC,CAAC;IACJ,CAAC;IAEM,GAAG,CAAC,SAA2B,EAAE,MAAmB;QAC1D,OAAO,oCAAoC,CAAC,MAAM,EACjD,GAAG,CAAC,QAAQ,CAAC,GAAmC,EAAE,yBAAyB,CAAC,EAC5E;YACC,OAAO,EAAE,cAAc,CAAC,QAAQ;YAChC,2BAA2B,EAAE,IAAI;SACjC,iDAC6B,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;CACD","file":"codeActionCommands.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 { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { IJSONSchema, TypeFromJsonSchema } from '../../../../base/common/jsonSchema.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport { escapeRegExpCharacters } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorAction, EditorAction2, EditorCommand, ServicesAccessor } from '../../../browser/editorExtensions.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { autoFixCommandId, codeActionCommandId, fixAllCommandId, organizeImportsCommandId, quickFixCommandId, refactorCommandId, sourceActionCommandId } from './codeAction.js';\nimport * as nls from '../../../../nls.js';\nimport { MenuId } from '../../../../platform/actions/common/actions.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nimport { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { CodeActionAutoApply, CodeActionCommandArgs, CodeActionFilter, CodeActionKind, CodeActionTriggerSource } from '../common/types.js';\nimport { CodeActionController } from './codeActionController.js';\nimport { SUPPORTED_CODE_ACTIONS } from './codeActionModel.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\n\nfunction contextKeyForSupportedActions(kind: HierarchicalKind) {\n\treturn ContextKeyExpr.regex(\n\t\tSUPPORTED_CODE_ACTIONS.keys()[0],\n\t\tnew RegExp('(\\\\s|^)' + escapeRegExpCharacters(kind.value) + '\\\\b'));\n}\n\nconst argsSchema = {\n\ttype: 'object',\n\tdefaultSnippets: [{ body: { kind: '' } }],\n\tproperties: {\n\t\t'kind': {\n\t\t\ttype: 'string',\n\t\t\tdescription: nls.localize('args.schema.kind', \"Kind of the code action to run.\"),\n\t\t},\n\t\t'apply': {\n\t\t\ttype: 'string',\n\t\t\tdescription: nls.localize('args.schema.apply', \"Controls when the returned actions are applied.\"),\n\t\t\tdefault: CodeActionAutoApply.IfSingle,\n\t\t\tenum: [CodeActionAutoApply.First, CodeActionAutoApply.IfSingle, CodeActionAutoApply.Never],\n\t\t\tenumDescriptions: [\n\t\t\t\tnls.localize('args.schema.apply.first', \"Always apply the first returned code action.\"),\n\t\t\t\tnls.localize('args.schema.apply.ifSingle', \"Apply the first returned code action if it is the only one.\"),\n\t\t\t\tnls.localize('args.schema.apply.never', \"Do not apply the returned code actions.\"),\n\t\t\t]\n\t\t},\n\t\t'preferred': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription: nls.localize('args.schema.preferred', \"Controls if only preferred code actions should be returned.\"),\n\t\t}\n\t}\n} as const satisfies IJSONSchema;\n\nfunction triggerCodeActionsForEditorSelection(\n\teditor: ICodeEditor,\n\tnotAvailableMessage: string,\n\tfilter: CodeActionFilter | undefined,\n\tautoApply: CodeActionAutoApply | undefined,\n\ttriggerAction: CodeActionTriggerSource = CodeActionTriggerSource.Default\n): void {\n\tif (editor.hasModel()) {\n\t\tconst controller = CodeActionController.get(editor);\n\t\tcontroller?.manualTriggerAtCurrentPosition(notAvailableMessage, triggerAction, filter, autoApply);\n\t}\n}\n\nexport class QuickFixAction extends EditorAction2 {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: quickFixCommandId,\n\t\t\ttitle: nls.localize2('quickfix.trigger.label', \"Quick Fix...\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\ticon: Codicon.lightBulb,\n\t\t\tf1: true,\n\t\t\tkeybinding: {\n\t\t\t\twhen: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.Period,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenu: {\n\t\t\t\tid: MenuId.InlineChatEditorAffordance,\n\t\t\t\tgroup: '0_quickfix',\n\t\t\t\torder: 0,\n\t\t\t\twhen: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider)\n\t\t\t}\n\t\t});\n\t}\n\n\toverride runEditorCommand(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor, nls.localize('editor.action.quickFix.noneMessage', \"No code actions available\"), undefined, undefined, CodeActionTriggerSource.QuickFix);\n\t}\n}\n\nexport class CodeActionCommand extends EditorCommand {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: codeActionCommandId,\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tmetadata: {\n\t\t\t\tdescription: 'Trigger a code action',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema, }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic runEditorCommand(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs?: TypeFromJsonSchema<typeof argsSchema>): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: HierarchicalKind.Empty,\n\t\t\tapply: CodeActionAutoApply.IfSingle,\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.codeAction.noneMessage.preferred.kind', \"No preferred code actions for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.codeAction.noneMessage.kind', \"No code actions for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.codeAction.noneMessage.preferred', \"No preferred code actions available\")\n\t\t\t\t\t: nls.localize('editor.action.codeAction.noneMessage', \"No code actions available\"),\n\t\t\t{\n\t\t\t\tinclude: args.kind,\n\t\t\t\tincludeSourceActions: true,\n\t\t\t\tonlyIncludePreferredActions: args.preferred,\n\t\t\t},\n\t\t\targs.apply);\n\t}\n}\n\n\nexport class RefactorAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: refactorCommandId,\n\t\t\tlabel: nls.localize2('refactor.label', \"Refactor...\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyR,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KeyR\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 2,\n\t\t\t\twhen: ContextKeyExpr.and(\n\t\t\t\t\tEditorContextKeys.writable,\n\t\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.Refactor)),\n\t\t\t},\n\t\t\tmetadata: {\n\t\t\t\tdescription: 'Refactor...',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs?: TypeFromJsonSchema<typeof argsSchema>): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: CodeActionKind.Refactor,\n\t\t\tapply: CodeActionAutoApply.Never\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.refactor.noneMessage.preferred.kind', \"No preferred refactorings for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.refactor.noneMessage.kind', \"No refactorings for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.refactor.noneMessage.preferred', \"No preferred refactorings available\")\n\t\t\t\t\t: nls.localize('editor.action.refactor.noneMessage', \"No refactorings available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.Refactor.contains(args.kind) ? args.kind : HierarchicalKind.None,\n\t\t\t\tonlyIncludePreferredActions: args.preferred\n\t\t\t},\n\t\t\targs.apply, CodeActionTriggerSource.Refactor);\n\t}\n}\n\nexport class SourceAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: sourceActionCommandId,\n\t\t\tlabel: nls.localize2('source.label', \"Source Action...\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n\t\t\tcontextMenuOpts: {\n\t\t\t\tgroup: '1_modification',\n\t\t\t\torder: 2.1,\n\t\t\t\twhen: ContextKeyExpr.and(\n\t\t\t\t\tEditorContextKeys.writable,\n\t\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.Source)),\n\t\t\t},\n\t\t\tmetadata: {\n\t\t\t\tdescription: 'Source Action...',\n\t\t\t\targs: [{ name: 'args', schema: argsSchema }]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor, userArgs?: TypeFromJsonSchema<typeof argsSchema>): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArgs, {\n\t\t\tkind: CodeActionKind.Source,\n\t\t\tapply: CodeActionAutoApply.Never\n\t\t});\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\ttypeof userArgs?.kind === 'string'\n\t\t\t\t? args.preferred\n\t\t\t\t\t? nls.localize('editor.action.source.noneMessage.preferred.kind', \"No preferred source actions for '{0}' available\", userArgs.kind)\n\t\t\t\t\t: nls.localize('editor.action.source.noneMessage.kind', \"No source actions for '{0}' available\", userArgs.kind)\n\t\t\t\t: args.preferred\n\t\t\t\t\t? nls.localize('editor.action.source.noneMessage.preferred', \"No preferred source actions available\")\n\t\t\t\t\t: nls.localize('editor.action.source.noneMessage', \"No source actions available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.Source.contains(args.kind) ? args.kind : HierarchicalKind.None,\n\t\t\t\tincludeSourceActions: true,\n\t\t\t\tonlyIncludePreferredActions: args.preferred,\n\t\t\t},\n\t\t\targs.apply, CodeActionTriggerSource.SourceAction);\n\t}\n}\n\nexport class OrganizeImportsAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: organizeImportsCommandId,\n\t\t\tlabel: nls.localize2('organizeImports.label', \"Organize Imports\"),\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.KeyO,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmetadata: {\n\t\t\t\tdescription: nls.localize2('organizeImports.description', \"Organize imports in the current file. Also called 'Optimize Imports' by some tools\")\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.organize.noneMessage', \"No organize imports action available\"),\n\t\t\t{ include: CodeActionKind.SourceOrganizeImports, includeSourceActions: true },\n\t\t\tCodeActionAutoApply.IfSingle, CodeActionTriggerSource.OrganizeImports);\n\t}\n}\n\nexport class FixAllAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: fixAllCommandId,\n\t\t\tlabel: nls.localize2('fixAll.label', \"Fix All\"),\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.SourceFixAll))\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('fixAll.noneMessage', \"No fix all action available\"),\n\t\t\t{ include: CodeActionKind.SourceFixAll, includeSourceActions: true },\n\t\t\tCodeActionAutoApply.IfSingle, CodeActionTriggerSource.FixAll);\n\t}\n}\n\nexport class AutoFixAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: autoFixCommandId,\n\t\t\tlabel: nls.localize2('autoFix.label', \"Auto Fix...\"),\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.writable,\n\t\t\t\tcontextKeyForSupportedActions(CodeActionKind.QuickFix)),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.Alt | KeyMod.Shift | KeyCode.Period,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Period\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\treturn triggerCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.autoFix.noneMessage', \"No auto fixes available\"),\n\t\t\t{\n\t\t\t\tinclude: CodeActionKind.QuickFix,\n\t\t\t\tonlyIncludePreferredActions: true\n\t\t\t},\n\t\t\tCodeActionAutoApply.IfSingle, CodeActionTriggerSource.AutoFix);\n\t}\n}\n"]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { registerEditorAction, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js';
|
|
6
|
+
import { registerAction2 } from '../../../../platform/actions/common/actions.js';
|
|
6
7
|
import { editorConfigurationBaseNode } from '../../../common/config/editorConfigurationSchema.js';
|
|
7
8
|
import { AutoFixAction, CodeActionCommand, FixAllAction, OrganizeImportsAction, QuickFixAction, RefactorAction, SourceAction } from './codeActionCommands.js';
|
|
8
9
|
import { CodeActionController } from './codeActionController.js';
|
|
@@ -12,7 +13,7 @@ import { Extensions } from '../../../../platform/configuration/common/configurat
|
|
|
12
13
|
import { Registry } from '../../../../platform/registry/common/platform.js';
|
|
13
14
|
registerEditorContribution(CodeActionController.ID, CodeActionController, 3 /* EditorContributionInstantiation.Eventually */);
|
|
14
15
|
registerEditorContribution(LightBulbWidget.ID, LightBulbWidget, 4 /* EditorContributionInstantiation.Lazy */);
|
|
15
|
-
|
|
16
|
+
registerAction2(QuickFixAction);
|
|
16
17
|
registerEditorAction(RefactorAction);
|
|
17
18
|
registerEditorAction(SourceAction);
|
|
18
19
|
registerEditorAction(OrganizeImportsAction);
|
|
@@ -25,7 +26,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
25
26
|
'editor.codeActionWidget.showHeaders': {
|
|
26
27
|
type: 'boolean',
|
|
27
28
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
28
|
-
description: nls.localize(
|
|
29
|
+
description: nls.localize(871, "Enable/disable showing group headers in the Code Action menu."),
|
|
29
30
|
default: true,
|
|
30
31
|
},
|
|
31
32
|
}
|
|
@@ -36,7 +37,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
36
37
|
'editor.codeActionWidget.includeNearbyQuickFixes': {
|
|
37
38
|
type: 'boolean',
|
|
38
39
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
39
|
-
description: nls.localize(
|
|
40
|
+
description: nls.localize(872, "Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),
|
|
40
41
|
default: true,
|
|
41
42
|
},
|
|
42
43
|
}
|
|
@@ -47,7 +48,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
47
48
|
'editor.codeActions.triggerOnFocusChange': {
|
|
48
49
|
type: 'boolean',
|
|
49
50
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
50
|
-
markdownDescription: nls.localize(
|
|
51
|
+
markdownDescription: nls.localize(873, 'Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.', '`#editor.codeActionsOnSave#`', '`#files.autoSave#`', '`afterDelay`', '`always`'),
|
|
51
52
|
default: false,
|
|
52
53
|
},
|
|
53
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/codeAction/browser/codeActionContributions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAmC,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAChK,OAAO,EAAE,2BAA2B,EAAE,MAAM,qDAAqD,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9J,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC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Content":["/*---------------------------------------------------------------------------------------------\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 { EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { registerAction2 } from '../../../../platform/actions/common/actions.js';\nimport { editorConfigurationBaseNode } from '../../../common/config/editorConfigurationSchema.js';\nimport { AutoFixAction, CodeActionCommand, FixAllAction, OrganizeImportsAction, QuickFixAction, RefactorAction, SourceAction } from './codeActionCommands.js';\nimport { CodeActionController } from './codeActionController.js';\nimport { LightBulbWidget } from './lightBulbWidget.js';\nimport * as nls from '../../../../nls.js';\nimport { ConfigurationScope, Extensions, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js';\nimport { Registry } from '../../../../platform/registry/common/platform.js';\n\nregisterEditorContribution(CodeActionController.ID, CodeActionController, EditorContributionInstantiation.Eventually);\nregisterEditorContribution(LightBulbWidget.ID, LightBulbWidget, EditorContributionInstantiation.Lazy);\nregisterAction2(QuickFixAction);\nregisterEditorAction(RefactorAction);\nregisterEditorAction(SourceAction);\nregisterEditorAction(OrganizeImportsAction);\nregisterEditorAction(AutoFixAction);\nregisterEditorAction(FixAllAction);\nregisterEditorCommand(new CodeActionCommand());\n\nRegistry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({\n\t...editorConfigurationBaseNode,\n\tproperties: {\n\t\t'editor.codeActionWidget.showHeaders': {\n\t\t\ttype: 'boolean',\n\t\t\tscope: ConfigurationScope.LANGUAGE_OVERRIDABLE,\n\t\t\tdescription: nls.localize('showCodeActionHeaders', \"Enable/disable showing group headers in the Code Action menu.\"),\n\t\t\tdefault: true,\n\t\t},\n\t}\n});\n\nRegistry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({\n\t...editorConfigurationBaseNode,\n\tproperties: {\n\t\t'editor.codeActionWidget.includeNearbyQuickFixes': {\n\t\t\ttype: 'boolean',\n\t\t\tscope: ConfigurationScope.LANGUAGE_OVERRIDABLE,\n\t\t\tdescription: nls.localize('includeNearbyQuickFixes', \"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.\"),\n\t\t\tdefault: true,\n\t\t},\n\t}\n});\n\nRegistry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({\n\t...editorConfigurationBaseNode,\n\tproperties: {\n\t\t'editor.codeActions.triggerOnFocusChange': {\n\t\t\ttype: 'boolean',\n\t\t\tscope: ConfigurationScope.LANGUAGE_OVERRIDABLE,\n\t\t\tmarkdownDescription: nls.localize('triggerOnFocusChange', 'Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.', '`#editor.codeActionsOnSave#`', '`#files.autoSave#`', '`afterDelay`', '`always`'),\n\t\t\tdefault: false,\n\t\t},\n\t}\n});\n"]}
|