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
|
@@ -25,7 +25,7 @@ export class ShowNextInlineSuggestionAction extends EditorAction {
|
|
|
25
25
|
constructor() {
|
|
26
26
|
super({
|
|
27
27
|
id: ShowNextInlineSuggestionAction.ID,
|
|
28
|
-
label: nls.localize2(
|
|
28
|
+
label: nls.localize2(1192, "Show Next Inline Suggestion"),
|
|
29
29
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
30
30
|
kbOpts: {
|
|
31
31
|
weight: 100,
|
|
@@ -43,7 +43,7 @@ export class ShowPreviousInlineSuggestionAction extends EditorAction {
|
|
|
43
43
|
constructor() {
|
|
44
44
|
super({
|
|
45
45
|
id: ShowPreviousInlineSuggestionAction.ID,
|
|
46
|
-
label: nls.localize2(
|
|
46
|
+
label: nls.localize2(1193, "Show Previous Inline Suggestion"),
|
|
47
47
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
48
48
|
kbOpts: {
|
|
49
49
|
weight: 100,
|
|
@@ -75,13 +75,13 @@ export class TriggerInlineSuggestionAction extends EditorAction {
|
|
|
75
75
|
constructor() {
|
|
76
76
|
super({
|
|
77
77
|
id: 'editor.action.inlineSuggest.trigger',
|
|
78
|
-
label: nls.localize2(
|
|
78
|
+
label: nls.localize2(1194, "Trigger Inline Suggestion"),
|
|
79
79
|
precondition: EditorContextKeys.writable,
|
|
80
80
|
metadata: {
|
|
81
|
-
description: nls.localize(
|
|
81
|
+
description: nls.localize(1181, "Triggers an inline suggestion in the editor."),
|
|
82
82
|
args: [{
|
|
83
83
|
name: 'args',
|
|
84
|
-
description: nls.localize(
|
|
84
|
+
description: nls.localize(1182, "Options for triggering inline suggestions."),
|
|
85
85
|
isOptional: true,
|
|
86
86
|
schema: argsValidator.getJSONSchema(),
|
|
87
87
|
}]
|
|
@@ -110,7 +110,7 @@ export class TriggerInlineSuggestionAction extends EditorAction {
|
|
|
110
110
|
if (!controller?.model.get()?.state.get()) {
|
|
111
111
|
notificationService.notify({
|
|
112
112
|
severity: Severity.Info,
|
|
113
|
-
message: nls.localize(
|
|
113
|
+
message: nls.localize(1183, "No inline suggestion is available.")
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -120,7 +120,7 @@ export class AcceptNextWordOfInlineCompletion extends EditorAction {
|
|
|
120
120
|
constructor() {
|
|
121
121
|
super({
|
|
122
122
|
id: 'editor.action.inlineSuggest.acceptNextWord',
|
|
123
|
-
label: nls.localize2(
|
|
123
|
+
label: nls.localize2(1195, "Accept Next Word Of Inline Suggestion"),
|
|
124
124
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
125
125
|
kbOpts: {
|
|
126
126
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 1,
|
|
@@ -129,7 +129,7 @@ export class AcceptNextWordOfInlineCompletion extends EditorAction {
|
|
|
129
129
|
},
|
|
130
130
|
menuOpts: [{
|
|
131
131
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
132
|
-
title: nls.localize(
|
|
132
|
+
title: nls.localize(1184, 'Accept Word'),
|
|
133
133
|
group: 'primary',
|
|
134
134
|
order: 2,
|
|
135
135
|
}],
|
|
@@ -144,14 +144,14 @@ export class AcceptNextLineOfInlineCompletion extends EditorAction {
|
|
|
144
144
|
constructor() {
|
|
145
145
|
super({
|
|
146
146
|
id: 'editor.action.inlineSuggest.acceptNextLine',
|
|
147
|
-
label: nls.localize2(
|
|
147
|
+
label: nls.localize2(1196, "Accept Next Line Of Inline Suggestion"),
|
|
148
148
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
149
149
|
kbOpts: {
|
|
150
150
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 1,
|
|
151
151
|
},
|
|
152
152
|
menuOpts: [{
|
|
153
153
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
154
|
-
title: nls.localize(
|
|
154
|
+
title: nls.localize(1185, 'Accept Line'),
|
|
155
155
|
group: 'secondary',
|
|
156
156
|
order: 2,
|
|
157
157
|
}],
|
|
@@ -166,16 +166,16 @@ export class AcceptInlineCompletion extends EditorAction {
|
|
|
166
166
|
constructor() {
|
|
167
167
|
super({
|
|
168
168
|
id: inlineSuggestCommitId,
|
|
169
|
-
label: nls.localize2(
|
|
169
|
+
label: nls.localize2(1197, "Accept Inline Suggestion"),
|
|
170
170
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),
|
|
171
171
|
menuOpts: [{
|
|
172
172
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
173
|
-
title: nls.localize(
|
|
173
|
+
title: nls.localize(1186, "Accept"),
|
|
174
174
|
group: 'primary',
|
|
175
175
|
order: 2,
|
|
176
176
|
}, {
|
|
177
177
|
menuId: MenuId.InlineEditsActions,
|
|
178
|
-
title: nls.localize(
|
|
178
|
+
title: nls.localize(1187, "Accept"),
|
|
179
179
|
group: 'primary',
|
|
180
180
|
order: 2,
|
|
181
181
|
}],
|
|
@@ -206,7 +206,7 @@ export class AcceptInlineCompletionAlternativeAction extends EditorAction {
|
|
|
206
206
|
constructor() {
|
|
207
207
|
super({
|
|
208
208
|
id: inlineSuggestCommitAlternativeActionId,
|
|
209
|
-
label: nls.localize2(
|
|
209
|
+
label: nls.localize2(1198, "Accept Inline Suggestion Alternative Action"),
|
|
210
210
|
precondition: ContextKeyExpr.and(InlineCompletionContextKeys.inlineSuggestionAlternativeActionVisible, InlineCompletionContextKeys.inlineEditVisible),
|
|
211
211
|
menuOpts: [],
|
|
212
212
|
kbOpts: [
|
|
@@ -235,11 +235,11 @@ export class JumpToNextInlineEdit extends EditorAction {
|
|
|
235
235
|
constructor() {
|
|
236
236
|
super({
|
|
237
237
|
id: jumpToNextInlineEditId,
|
|
238
|
-
label: nls.localize2(
|
|
238
|
+
label: nls.localize2(1199, "Jump to next inline edit"),
|
|
239
239
|
precondition: InlineCompletionContextKeys.inlineEditVisible,
|
|
240
240
|
menuOpts: [{
|
|
241
241
|
menuId: MenuId.InlineEditsActions,
|
|
242
|
-
title: nls.localize(
|
|
242
|
+
title: nls.localize(1188, "Jump"),
|
|
243
243
|
group: 'primary',
|
|
244
244
|
order: 1,
|
|
245
245
|
when: InlineCompletionContextKeys.cursorAtInlineEdit.toNegated(),
|
|
@@ -263,7 +263,7 @@ export class HideInlineCompletion extends EditorAction {
|
|
|
263
263
|
constructor() {
|
|
264
264
|
super({
|
|
265
265
|
id: HideInlineCompletion.ID,
|
|
266
|
-
label: nls.localize2(
|
|
266
|
+
label: nls.localize2(1200, "Hide Inline Suggestion"),
|
|
267
267
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),
|
|
268
268
|
kbOpts: {
|
|
269
269
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 90, // same as hiding the suggest widget
|
|
@@ -271,7 +271,7 @@ export class HideInlineCompletion extends EditorAction {
|
|
|
271
271
|
},
|
|
272
272
|
menuOpts: [{
|
|
273
273
|
menuId: MenuId.InlineEditsActions,
|
|
274
|
-
title: nls.localize(
|
|
274
|
+
title: nls.localize(1189, "Reject"),
|
|
275
275
|
group: 'primary',
|
|
276
276
|
order: 3,
|
|
277
277
|
}]
|
|
@@ -290,7 +290,7 @@ export class ToggleInlineCompletionShowCollapsed extends EditorAction {
|
|
|
290
290
|
constructor() {
|
|
291
291
|
super({
|
|
292
292
|
id: ToggleInlineCompletionShowCollapsed.ID,
|
|
293
|
-
label: nls.localize2(
|
|
293
|
+
label: nls.localize2(1201, "Toggle Inline Suggestions Show Collapsed"),
|
|
294
294
|
precondition: ContextKeyExpr.true(),
|
|
295
295
|
});
|
|
296
296
|
}
|
|
@@ -312,7 +312,7 @@ export class ToggleAlwaysShowInlineSuggestionToolbar extends Action2 {
|
|
|
312
312
|
constructor() {
|
|
313
313
|
super({
|
|
314
314
|
id: ToggleAlwaysShowInlineSuggestionToolbar.ID,
|
|
315
|
-
title: nls.localize(
|
|
315
|
+
title: nls.localize(1190, "Always Show Toolbar"),
|
|
316
316
|
f1: false,
|
|
317
317
|
precondition: undefined,
|
|
318
318
|
menu: [{
|
|
@@ -334,7 +334,7 @@ export class DevExtractReproSample extends EditorAction {
|
|
|
334
334
|
constructor() {
|
|
335
335
|
super({
|
|
336
336
|
id: 'editor.action.inlineSuggest.dev.extractRepro',
|
|
337
|
-
label: nls.localize(
|
|
337
|
+
label: nls.localize(1191, "Developer: Extract Inline Suggest State"),
|
|
338
338
|
alias: 'Developer: Inline Suggest Extract Repro',
|
|
339
339
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineEditVisible, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
340
340
|
});
|
package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js
CHANGED
|
@@ -6,18 +6,18 @@ import { RawContextKey } from '../../../../../platform/contextkey/common/context
|
|
|
6
6
|
import { localize } from '../../../../../nls.js';
|
|
7
7
|
import * as nls from '../../../../../nls.js';
|
|
8
8
|
export class InlineCompletionContextKeys {
|
|
9
|
-
static { this.inlineSuggestionVisible = new RawContextKey('inlineSuggestionVisible', false, localize(
|
|
10
|
-
static { this.inlineSuggestionAlternativeActionVisible = new RawContextKey('inlineSuggestionAlternativeActionVisible', false, localize(
|
|
11
|
-
static { this.inlineSuggestionHasIndentation = new RawContextKey('inlineSuggestionHasIndentation', false, localize(
|
|
12
|
-
static { this.inlineSuggestionHasIndentationLessThanTabSize = new RawContextKey('inlineSuggestionHasIndentationLessThanTabSize', true, localize(
|
|
13
|
-
static { this.suppressSuggestions = new RawContextKey('inlineSuggestionSuppressSuggestions', undefined, localize(
|
|
14
|
-
static { this.cursorBeforeGhostText = new RawContextKey('cursorBeforeGhostText', false, localize(
|
|
15
|
-
static { this.cursorInIndentation = new RawContextKey('cursorInIndentation', false, localize(
|
|
16
|
-
static { this.hasSelection = new RawContextKey('editor.hasSelection', false, localize(
|
|
17
|
-
static { this.cursorAtInlineEdit = new RawContextKey('cursorAtInlineEdit', false, localize(
|
|
18
|
-
static { this.inlineEditVisible = new RawContextKey('inlineEditIsVisible', false, localize(
|
|
19
|
-
static { this.tabShouldJumpToInlineEdit = new RawContextKey('tabShouldJumpToInlineEdit', false, localize(
|
|
20
|
-
static { this.tabShouldAcceptInlineEdit = new RawContextKey('tabShouldAcceptInlineEdit', false, localize(
|
|
21
|
-
static { this.inInlineEditsPreviewEditor = new RawContextKey('inInlineEditsPreviewEditor', true, nls.localize(
|
|
9
|
+
static { this.inlineSuggestionVisible = new RawContextKey('inlineSuggestionVisible', false, localize(1202, "Whether an inline suggestion is visible")); }
|
|
10
|
+
static { this.inlineSuggestionAlternativeActionVisible = new RawContextKey('inlineSuggestionAlternativeActionVisible', false, localize(1203, "Whether an alternative action for the inline suggestion is visible.")); }
|
|
11
|
+
static { this.inlineSuggestionHasIndentation = new RawContextKey('inlineSuggestionHasIndentation', false, localize(1204, "Whether the inline suggestion starts with whitespace")); }
|
|
12
|
+
static { this.inlineSuggestionHasIndentationLessThanTabSize = new RawContextKey('inlineSuggestionHasIndentationLessThanTabSize', true, localize(1205, "Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")); }
|
|
13
|
+
static { this.suppressSuggestions = new RawContextKey('inlineSuggestionSuppressSuggestions', undefined, localize(1206, "Whether suggestions should be suppressed for the current suggestion")); }
|
|
14
|
+
static { this.cursorBeforeGhostText = new RawContextKey('cursorBeforeGhostText', false, localize(1207, "Whether the cursor is at ghost text")); }
|
|
15
|
+
static { this.cursorInIndentation = new RawContextKey('cursorInIndentation', false, localize(1208, "Whether the cursor is in indentation")); }
|
|
16
|
+
static { this.hasSelection = new RawContextKey('editor.hasSelection', false, localize(1209, "Whether the editor has a selection")); }
|
|
17
|
+
static { this.cursorAtInlineEdit = new RawContextKey('cursorAtInlineEdit', false, localize(1210, "Whether the cursor is at an inline edit")); }
|
|
18
|
+
static { this.inlineEditVisible = new RawContextKey('inlineEditIsVisible', false, localize(1211, "Whether an inline edit is visible")); }
|
|
19
|
+
static { this.tabShouldJumpToInlineEdit = new RawContextKey('tabShouldJumpToInlineEdit', false, localize(1212, "Whether tab should jump to an inline edit.")); }
|
|
20
|
+
static { this.tabShouldAcceptInlineEdit = new RawContextKey('tabShouldAcceptInlineEdit', false, localize(1213, "Whether tab should accept the inline edit.")); }
|
|
21
|
+
static { this.inInlineEditsPreviewEditor = new RawContextKey('inInlineEditsPreviewEditor', true, nls.localize(1214, "Whether the current code editor is showing an inline edits preview")); }
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=inlineCompletionContextKeys.js.map
|
package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js
CHANGED
|
@@ -378,7 +378,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
378
378
|
const accessibleViewKeybinding = this._keybindingService.lookupKeybinding('editor.action.accessibleView');
|
|
379
379
|
let hint;
|
|
380
380
|
if (!accessibleViewShowing && accessibleViewKeybinding && this.editor.getOption(169 /* EditorOption.inlineCompletionsAccessibilityVerbose */)) {
|
|
381
|
-
hint = localize(
|
|
381
|
+
hint = localize(1215, "Inspect this in the accessible view ({0})", accessibleViewKeybinding.getAriaLabel());
|
|
382
382
|
}
|
|
383
383
|
alert(hint ? content + ', ' + hint : content);
|
|
384
384
|
}
|
|
@@ -115,7 +115,7 @@ let InlineCompletionsHoverParticipant = class InlineCompletionsHoverParticipant
|
|
|
115
115
|
return new RenderedHoverParts([renderedHoverPart]);
|
|
116
116
|
}
|
|
117
117
|
getAccessibleContent(hoverPart) {
|
|
118
|
-
return nls.localize(
|
|
118
|
+
return nls.localize(1216, 'There are inline completions here');
|
|
119
119
|
}
|
|
120
120
|
renderScreenReaderText(context, part) {
|
|
121
121
|
const disposables = new DisposableStore();
|
|
@@ -123,7 +123,7 @@ let InlineCompletionsHoverParticipant = class InlineCompletionsHoverParticipant
|
|
|
123
123
|
const markdownHoverElement = $('div.hover-row.markdown-hover');
|
|
124
124
|
const hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' }));
|
|
125
125
|
const render = (code) => {
|
|
126
|
-
const inlineSuggestionAvailable = nls.localize(
|
|
126
|
+
const inlineSuggestionAvailable = nls.localize(1217, "Suggestion:");
|
|
127
127
|
const renderedContents = disposables.add(this._markdownRendererService.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code), {
|
|
128
128
|
context: this._editor,
|
|
129
129
|
asyncRenderCallback: () => {
|
package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js
CHANGED
|
@@ -97,8 +97,8 @@ InlineCompletionsHintsWidget = __decorate([
|
|
|
97
97
|
__param(2, IInstantiationService)
|
|
98
98
|
], InlineCompletionsHintsWidget);
|
|
99
99
|
export { InlineCompletionsHintsWidget };
|
|
100
|
-
const inlineSuggestionHintsNextIcon = registerIcon('inline-suggestion-hints-next', Codicon.chevronRight, localize(
|
|
101
|
-
const inlineSuggestionHintsPreviousIcon = registerIcon('inline-suggestion-hints-previous', Codicon.chevronLeft, localize(
|
|
100
|
+
const inlineSuggestionHintsNextIcon = registerIcon('inline-suggestion-hints-next', Codicon.chevronRight, localize(1218, 'Icon for show next parameter hint.'));
|
|
101
|
+
const inlineSuggestionHintsPreviousIcon = registerIcon('inline-suggestion-hints-previous', Codicon.chevronLeft, localize(1219, 'Icon for show previous parameter hint.'));
|
|
102
102
|
let InlineSuggestionHintsContentWidget = class InlineSuggestionHintsContentWidget extends Disposable {
|
|
103
103
|
static { InlineSuggestionHintsContentWidget_1 = this; }
|
|
104
104
|
static { this.hot = createHotClass(this); }
|
|
@@ -153,9 +153,9 @@ let InlineSuggestionHintsContentWidget = class InlineSuggestionHintsContentWidge
|
|
|
153
153
|
this._warningMessageNode.element,
|
|
154
154
|
h('div@toolBar'),
|
|
155
155
|
]);
|
|
156
|
-
this.previousAction = this._register(this.createCommandAction(showPreviousInlineSuggestionActionId, localize(
|
|
156
|
+
this.previousAction = this._register(this.createCommandAction(showPreviousInlineSuggestionActionId, localize(1220, 'Previous'), ThemeIcon.asClassName(inlineSuggestionHintsPreviousIcon)));
|
|
157
157
|
this.availableSuggestionCountAction = this._register(new Action('inlineSuggestionHints.availableSuggestionCount', '', undefined, false));
|
|
158
|
-
this.nextAction = this._register(this.createCommandAction(showNextInlineSuggestionActionId, localize(
|
|
158
|
+
this.nextAction = this._register(this.createCommandAction(showNextInlineSuggestionActionId, localize(1221, 'Next'), ThemeIcon.asClassName(inlineSuggestionHintsNextIcon)));
|
|
159
159
|
this.inlineCompletionsActionsMenus = this._register(this._menuService.createMenu(MenuId.InlineCompletionsActions, this._contextKeyService));
|
|
160
160
|
this.clearAvailableSuggestionCountLabelDebounced = this._register(new RunOnceScheduler(() => {
|
|
161
161
|
this.availableSuggestionCountAction.label = '';
|
|
@@ -17,7 +17,7 @@ import { LcsDiff, StringDiffSequence } from '../../../../../base/common/diff/dif
|
|
|
17
17
|
import { Disposable } from '../../../../../base/common/lifecycle.js';
|
|
18
18
|
import { localize } from '../../../../../nls.js';
|
|
19
19
|
import { CommandsRegistry, ICommandService } from '../../../../../platform/commands/common/commands.js';
|
|
20
|
-
import { IBulkEditService } from '../../../../browser/services/bulkEditService.js';
|
|
20
|
+
import { IBulkEditService, ResourceTextEdit } from '../../../../browser/services/bulkEditService.js';
|
|
21
21
|
import { TextReplacement } from '../../../../common/core/edits/textEdit.js';
|
|
22
22
|
import { Position } from '../../../../common/core/position.js';
|
|
23
23
|
import { Range } from '../../../../common/core/range.js';
|
|
@@ -28,6 +28,8 @@ import { hasProvider, rawRename } from '../../../rename/browser/rename.js';
|
|
|
28
28
|
import { renameSymbolCommandId } from '../controller/commandIds.js';
|
|
29
29
|
import { InlineSuggestionItem } from './inlineSuggestionItem.js';
|
|
30
30
|
import { Codicon } from '../../../../../base/common/codicons.js';
|
|
31
|
+
import { IRenameSymbolTrackerService } from '../../../../browser/services/renameSymbolTrackerService.js';
|
|
32
|
+
import { ICodeEditorService } from '../../../../browser/services/codeEditorService.js';
|
|
31
33
|
var RenameKind;
|
|
32
34
|
(function (RenameKind) {
|
|
33
35
|
RenameKind["no"] = "no";
|
|
@@ -238,16 +240,50 @@ export class RenameInferenceEngine {
|
|
|
238
240
|
};
|
|
239
241
|
}
|
|
240
242
|
}
|
|
243
|
+
class EditorState {
|
|
244
|
+
static create(codeEditorService, textModel) {
|
|
245
|
+
const editor = codeEditorService.getFocusedCodeEditor();
|
|
246
|
+
if (editor === null) {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
if (editor.getModel() !== textModel) {
|
|
250
|
+
return undefined;
|
|
251
|
+
}
|
|
252
|
+
return new EditorState(editor, textModel.getVersionId());
|
|
253
|
+
}
|
|
254
|
+
constructor(editor, versionId) {
|
|
255
|
+
this.editor = editor;
|
|
256
|
+
this.versionId = versionId;
|
|
257
|
+
}
|
|
258
|
+
equals(other) {
|
|
259
|
+
if (other === undefined) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
return this.editor === other.editor && this.versionId === other.versionId;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
241
265
|
class RenameSymbolRunnable {
|
|
242
|
-
constructor(languageFeaturesService, textModel, position, newName,
|
|
266
|
+
constructor(languageFeaturesService, commandService, requestUuid, textModel, state, position, newName, lastSymbolRename, oldName) {
|
|
243
267
|
this._result = undefined;
|
|
268
|
+
this._commandService = commandService;
|
|
269
|
+
this._textModel = textModel;
|
|
270
|
+
this._state = state;
|
|
244
271
|
this._requestUuid = requestUuid;
|
|
245
272
|
this._cancellationTokenSource = new CancellationTokenSource();
|
|
246
|
-
|
|
273
|
+
if (lastSymbolRename === undefined || oldName === undefined) {
|
|
274
|
+
this._promise = rawRename(languageFeaturesService.renameProvider, textModel, position, newName, this._cancellationTokenSource.token);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
this._promise = this.sendNesRenameRequest(textModel, position, oldName, newName, lastSymbolRename);
|
|
279
|
+
}
|
|
247
280
|
}
|
|
248
281
|
get requestUuid() {
|
|
249
282
|
return this._requestUuid;
|
|
250
283
|
}
|
|
284
|
+
isValid(codeEditorService) {
|
|
285
|
+
return this._state.equals(EditorState.create(codeEditorService, this._textModel));
|
|
286
|
+
}
|
|
251
287
|
cancel() {
|
|
252
288
|
this._cancellationTokenSource.cancel();
|
|
253
289
|
}
|
|
@@ -276,17 +312,39 @@ class RenameSymbolRunnable {
|
|
|
276
312
|
}
|
|
277
313
|
return this._result;
|
|
278
314
|
}
|
|
315
|
+
async sendNesRenameRequest(textModel, position, oldName, newName, lastSymbolRename) {
|
|
316
|
+
try {
|
|
317
|
+
const result = await this._commandService.executeCommand('github.copilot.nes.postRename', textModel.uri, position, oldName, newName, lastSymbolRename);
|
|
318
|
+
if (result === undefined) {
|
|
319
|
+
return { rejectReason: 'Rename failed', edits: [] };
|
|
320
|
+
}
|
|
321
|
+
const edits = [];
|
|
322
|
+
for (const item of result) {
|
|
323
|
+
for (const change of item.changes) {
|
|
324
|
+
const range = new Range(change.range.start.line + 1, change.range.start.character + 1, change.range.end.line + 1, change.range.end.character + 1);
|
|
325
|
+
const edit = new ResourceTextEdit(item.file, new TextReplacement(range, change.newText ?? newName));
|
|
326
|
+
edits.push(edit);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return { edits };
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
return { rejectReason: 'Rename failed', edits: [] };
|
|
333
|
+
}
|
|
334
|
+
}
|
|
279
335
|
}
|
|
280
336
|
let RenameSymbolProcessor = class RenameSymbolProcessor extends Disposable {
|
|
281
|
-
constructor(_commandService, _languageFeaturesService, _languageConfigurationService, bulkEditService) {
|
|
337
|
+
constructor(_commandService, _languageFeaturesService, _languageConfigurationService, bulkEditService, _renameSymbolTrackerService, _codeEditorService) {
|
|
282
338
|
super();
|
|
283
339
|
this._commandService = _commandService;
|
|
284
340
|
this._languageFeaturesService = _languageFeaturesService;
|
|
285
341
|
this._languageConfigurationService = _languageConfigurationService;
|
|
342
|
+
this._renameSymbolTrackerService = _renameSymbolTrackerService;
|
|
343
|
+
this._codeEditorService = _codeEditorService;
|
|
286
344
|
this._renameInferenceEngine = new RenameInferenceEngine();
|
|
287
345
|
this._renameRunnable = undefined;
|
|
288
346
|
this._register(CommandsRegistry.registerCommand(renameSymbolCommandId, async (_, source, renameRunnable) => {
|
|
289
|
-
if (renameRunnable === undefined) {
|
|
347
|
+
if (renameRunnable === undefined || !renameRunnable.isValid(this._codeEditorService)) {
|
|
290
348
|
return;
|
|
291
349
|
}
|
|
292
350
|
try {
|
|
@@ -310,6 +368,10 @@ let RenameSymbolProcessor = class RenameSymbolProcessor extends Disposable {
|
|
|
310
368
|
if (!hasProvider(this._languageFeaturesService.renameProvider, textModel)) {
|
|
311
369
|
return suggestItem;
|
|
312
370
|
}
|
|
371
|
+
const state = EditorState.create(this._codeEditorService, textModel);
|
|
372
|
+
if (state === undefined) {
|
|
373
|
+
return suggestItem;
|
|
374
|
+
}
|
|
313
375
|
const start = Date.now();
|
|
314
376
|
const edit = suggestItem.action.textReplacement;
|
|
315
377
|
const languageConfiguration = this._languageConfigurationService.getLanguageConfiguration(textModel.getLanguageId());
|
|
@@ -319,10 +381,15 @@ let RenameSymbolProcessor = class RenameSymbolProcessor extends Disposable {
|
|
|
319
381
|
return suggestItem;
|
|
320
382
|
}
|
|
321
383
|
const { oldName, newName, position, edits: renameEdits } = edits.renames;
|
|
384
|
+
const trackedWord = this._renameSymbolTrackerService.trackedWord.get();
|
|
385
|
+
let lastSymbolRename = undefined;
|
|
386
|
+
if (trackedWord !== undefined && trackedWord.model === textModel && trackedWord.originalWord === oldName && trackedWord.currentWord === newName) {
|
|
387
|
+
lastSymbolRename = trackedWord.currentRange;
|
|
388
|
+
}
|
|
322
389
|
// Check asynchronously if a rename is possible
|
|
323
390
|
let timedOut = false;
|
|
324
|
-
const check = await raceTimeout(this.checkRenamePrecondition(suggestItem, textModel, position, oldName, newName), 100, () => { timedOut = true; });
|
|
325
|
-
const renamePossible = this.isRenamePossible(suggestItem, check);
|
|
391
|
+
const check = await raceTimeout(this.checkRenamePrecondition(suggestItem, textModel, position, oldName, newName, lastSymbolRename), 100, () => { timedOut = true; });
|
|
392
|
+
const renamePossible = this.isRenamePossible(suggestItem, check, state, textModel);
|
|
326
393
|
suggestItem.setRenameProcessingInfo({
|
|
327
394
|
createdRename: renamePossible,
|
|
328
395
|
duration: Date.now() - start,
|
|
@@ -335,7 +402,7 @@ let RenameSymbolProcessor = class RenameSymbolProcessor extends Disposable {
|
|
|
335
402
|
}
|
|
336
403
|
// Prepare the rename edits
|
|
337
404
|
if (this._renameRunnable === undefined) {
|
|
338
|
-
this._renameRunnable = new RenameSymbolRunnable(this._languageFeaturesService, textModel, position, newName,
|
|
405
|
+
this._renameRunnable = new RenameSymbolRunnable(this._languageFeaturesService, this._commandService, suggestItem.requestUuid, textModel, state, position, newName, lastSymbolRename, lastSymbolRename !== undefined ? oldName : undefined);
|
|
339
406
|
}
|
|
340
407
|
// Create alternative action
|
|
341
408
|
const source = EditSources.inlineCompletionAccept({
|
|
@@ -347,11 +414,11 @@ let RenameSymbolProcessor = class RenameSymbolProcessor extends Disposable {
|
|
|
347
414
|
});
|
|
348
415
|
const command = {
|
|
349
416
|
id: renameSymbolCommandId,
|
|
350
|
-
title: localize(
|
|
417
|
+
title: localize(1222, "Rename"),
|
|
351
418
|
arguments: [source, this._renameRunnable],
|
|
352
419
|
};
|
|
353
420
|
const alternativeAction = {
|
|
354
|
-
label: localize(
|
|
421
|
+
label: localize(1223, "Rename"),
|
|
355
422
|
icon: Codicon.replaceAll,
|
|
356
423
|
command,
|
|
357
424
|
count: this._renameRunnable.getCount(),
|
|
@@ -366,22 +433,42 @@ let RenameSymbolProcessor = class RenameSymbolProcessor extends Disposable {
|
|
|
366
433
|
};
|
|
367
434
|
return InlineSuggestionItem.create(suggestItem.withAction(renameAction), textModel, false);
|
|
368
435
|
}
|
|
369
|
-
async checkRenamePrecondition(suggestItem, textModel, position, oldName, newName) {
|
|
436
|
+
async checkRenamePrecondition(suggestItem, textModel, position, oldName, newName, lastSymbolRename) {
|
|
437
|
+
const no = { canRename: RenameKind.no, timedOut: false };
|
|
370
438
|
try {
|
|
371
|
-
const result = await this._commandService.executeCommand('github.copilot.nes.prepareRename', textModel.uri, position, oldName, newName, suggestItem.requestUuid);
|
|
439
|
+
const result = await this._commandService.executeCommand('github.copilot.nes.prepareRename', textModel.uri, position, oldName, newName, suggestItem.requestUuid, lastSymbolRename);
|
|
372
440
|
if (result === undefined) {
|
|
373
|
-
return
|
|
441
|
+
return no;
|
|
442
|
+
}
|
|
443
|
+
else if (typeof result === 'string') {
|
|
444
|
+
const canRename = RenameKind.fromString(result);
|
|
445
|
+
if (canRename === RenameKind.yes || canRename === RenameKind.maybe) {
|
|
446
|
+
return {
|
|
447
|
+
canRename,
|
|
448
|
+
oldName,
|
|
449
|
+
onOldState: false,
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
return {
|
|
454
|
+
canRename,
|
|
455
|
+
timedOut: false,
|
|
456
|
+
};
|
|
457
|
+
}
|
|
374
458
|
}
|
|
375
459
|
else {
|
|
376
|
-
return
|
|
460
|
+
return result;
|
|
377
461
|
}
|
|
378
462
|
}
|
|
379
463
|
catch (error) {
|
|
380
|
-
return
|
|
464
|
+
return no;
|
|
381
465
|
}
|
|
382
466
|
}
|
|
383
|
-
isRenamePossible(suggestItem, check) {
|
|
384
|
-
if (check === undefined || check === RenameKind.no) {
|
|
467
|
+
isRenamePossible(suggestItem, check, state, textModel) {
|
|
468
|
+
if (check === undefined || check.canRename === RenameKind.no) {
|
|
469
|
+
return false;
|
|
470
|
+
}
|
|
471
|
+
if (!state.equals(EditorState.create(this._codeEditorService, textModel))) {
|
|
385
472
|
return false;
|
|
386
473
|
}
|
|
387
474
|
if (this._renameRunnable === undefined) {
|
|
@@ -401,7 +488,9 @@ RenameSymbolProcessor = __decorate([
|
|
|
401
488
|
__param(0, ICommandService),
|
|
402
489
|
__param(1, ILanguageFeaturesService),
|
|
403
490
|
__param(2, ILanguageConfigurationService),
|
|
404
|
-
__param(3, IBulkEditService)
|
|
491
|
+
__param(3, IBulkEditService),
|
|
492
|
+
__param(4, IRenameSymbolTrackerService),
|
|
493
|
+
__param(5, ICodeEditorService)
|
|
405
494
|
], RenameSymbolProcessor);
|
|
406
495
|
export { RenameSymbolProcessor };
|
|
407
496
|
//# sourceMappingURL=renameSymbolProcessor.js.map
|