monaco-editor-core 0.55.0-dev-20251028 → 0.55.0-dev-20251030
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 +14 -0
- package/esm/vs/base/browser/markdownRenderer.js +53 -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/common/codiconsLibrary.js +6 -3
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/glob.js +41 -31
- package/esm/vs/base/common/glob.js.map +1 -1
- package/esm/vs/base/common/htmlContent.js +5 -1
- package/esm/vs/base/common/htmlContent.js.map +1 -1
- package/esm/vs/base/common/network.js +2 -6
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/strings.js +8 -6
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/editor/browser/editorExtensions.js +5 -0
- package/esm/vs/editor/browser/editorExtensions.js.map +1 -1
- package/esm/vs/editor/browser/triggerInlineEditCommandsRegistry.js +17 -0
- package/esm/vs/editor/browser/triggerInlineEditCommandsRegistry.js.map +1 -0
- package/esm/vs/editor/common/textModelEditSource.js +1 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +2 -1
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +4 -0
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +16 -12
- package/esm/vs/editor/contrib/comment/browser/comment.js.map +1 -1
- 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 +7 -5
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js.map +1 -1
- 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.js +26 -26
- 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/contentHoverRendered.js +17 -6
- package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +6 -3
- package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/hover.css +36 -0
- 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 +51 -0
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js.map +1 -0
- package/esm/vs/editor/contrib/hover/browser/hoverTypes.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +25 -9
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +8 -5
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +29 -27
- package/esm/vs/editor/contrib/indentation/browser/indentation.js.map +1 -1
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +3 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +4 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- 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/inlineEditsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +87 -62
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +8 -8
- 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 +13 -12
- package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +27 -24
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +9 -9
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- 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 +2 -2
- package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +7 -7
- 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/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/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(1182, "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(1183, "Show Previous Inline Suggestion"),
|
|
47
47
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
48
48
|
kbOpts: {
|
|
49
49
|
weight: 100,
|
|
@@ -74,13 +74,13 @@ export class TriggerInlineSuggestionAction extends EditorAction {
|
|
|
74
74
|
constructor() {
|
|
75
75
|
super({
|
|
76
76
|
id: 'editor.action.inlineSuggest.trigger',
|
|
77
|
-
label: nls.localize2(
|
|
77
|
+
label: nls.localize2(1184, "Trigger Inline Suggestion"),
|
|
78
78
|
precondition: EditorContextKeys.writable,
|
|
79
79
|
metadata: {
|
|
80
|
-
description: nls.localize(
|
|
80
|
+
description: nls.localize(1171, "Triggers an inline suggestion in the editor."),
|
|
81
81
|
args: [{
|
|
82
82
|
name: 'args',
|
|
83
|
-
description: nls.localize(
|
|
83
|
+
description: nls.localize(1172, "Options for triggering inline suggestions."),
|
|
84
84
|
isOptional: true,
|
|
85
85
|
schema: argsValidator.getJSONSchema(),
|
|
86
86
|
}]
|
|
@@ -108,7 +108,7 @@ export class TriggerInlineSuggestionAction extends EditorAction {
|
|
|
108
108
|
if (!controller?.model.get()?.state.get()) {
|
|
109
109
|
notificationService.notify({
|
|
110
110
|
severity: Severity.Info,
|
|
111
|
-
message: nls.localize(
|
|
111
|
+
message: nls.localize(1173, "No inline suggestion is available.")
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -118,7 +118,7 @@ export class AcceptNextWordOfInlineCompletion extends EditorAction {
|
|
|
118
118
|
constructor() {
|
|
119
119
|
super({
|
|
120
120
|
id: 'editor.action.inlineSuggest.acceptNextWord',
|
|
121
|
-
label: nls.localize2(
|
|
121
|
+
label: nls.localize2(1185, "Accept Next Word Of Inline Suggestion"),
|
|
122
122
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
123
123
|
kbOpts: {
|
|
124
124
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 1,
|
|
@@ -127,7 +127,7 @@ export class AcceptNextWordOfInlineCompletion extends EditorAction {
|
|
|
127
127
|
},
|
|
128
128
|
menuOpts: [{
|
|
129
129
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
130
|
-
title: nls.localize(
|
|
130
|
+
title: nls.localize(1174, 'Accept Word'),
|
|
131
131
|
group: 'primary',
|
|
132
132
|
order: 2,
|
|
133
133
|
}],
|
|
@@ -142,14 +142,14 @@ export class AcceptNextLineOfInlineCompletion extends EditorAction {
|
|
|
142
142
|
constructor() {
|
|
143
143
|
super({
|
|
144
144
|
id: 'editor.action.inlineSuggest.acceptNextLine',
|
|
145
|
-
label: nls.localize2(
|
|
145
|
+
label: nls.localize2(1186, "Accept Next Line Of Inline Suggestion"),
|
|
146
146
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
147
147
|
kbOpts: {
|
|
148
148
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 1,
|
|
149
149
|
},
|
|
150
150
|
menuOpts: [{
|
|
151
151
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
152
|
-
title: nls.localize(
|
|
152
|
+
title: nls.localize(1175, 'Accept Line'),
|
|
153
153
|
group: 'secondary',
|
|
154
154
|
order: 2,
|
|
155
155
|
}],
|
|
@@ -164,16 +164,16 @@ export class AcceptInlineCompletion extends EditorAction {
|
|
|
164
164
|
constructor() {
|
|
165
165
|
super({
|
|
166
166
|
id: inlineSuggestCommitId,
|
|
167
|
-
label: nls.localize2(
|
|
167
|
+
label: nls.localize2(1187, "Accept Inline Suggestion"),
|
|
168
168
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),
|
|
169
169
|
menuOpts: [{
|
|
170
170
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
171
|
-
title: nls.localize(
|
|
171
|
+
title: nls.localize(1176, "Accept"),
|
|
172
172
|
group: 'primary',
|
|
173
173
|
order: 2,
|
|
174
174
|
}, {
|
|
175
175
|
menuId: MenuId.InlineEditsActions,
|
|
176
|
-
title: nls.localize(
|
|
176
|
+
title: nls.localize(1177, "Accept"),
|
|
177
177
|
group: 'primary',
|
|
178
178
|
order: 2,
|
|
179
179
|
}],
|
|
@@ -204,11 +204,11 @@ export class JumpToNextInlineEdit extends EditorAction {
|
|
|
204
204
|
constructor() {
|
|
205
205
|
super({
|
|
206
206
|
id: jumpToNextInlineEditId,
|
|
207
|
-
label: nls.localize2(
|
|
207
|
+
label: nls.localize2(1188, "Jump to next inline edit"),
|
|
208
208
|
precondition: InlineCompletionContextKeys.inlineEditVisible,
|
|
209
209
|
menuOpts: [{
|
|
210
210
|
menuId: MenuId.InlineEditsActions,
|
|
211
|
-
title: nls.localize(
|
|
211
|
+
title: nls.localize(1178, "Jump"),
|
|
212
212
|
group: 'primary',
|
|
213
213
|
order: 1,
|
|
214
214
|
when: InlineCompletionContextKeys.cursorAtInlineEdit.toNegated(),
|
|
@@ -232,7 +232,7 @@ export class HideInlineCompletion extends EditorAction {
|
|
|
232
232
|
constructor() {
|
|
233
233
|
super({
|
|
234
234
|
id: HideInlineCompletion.ID,
|
|
235
|
-
label: nls.localize2(
|
|
235
|
+
label: nls.localize2(1189, "Hide Inline Suggestion"),
|
|
236
236
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),
|
|
237
237
|
kbOpts: {
|
|
238
238
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 90, // same as hiding the suggest widget
|
|
@@ -240,7 +240,7 @@ export class HideInlineCompletion extends EditorAction {
|
|
|
240
240
|
},
|
|
241
241
|
menuOpts: [{
|
|
242
242
|
menuId: MenuId.InlineEditsActions,
|
|
243
|
-
title: nls.localize(
|
|
243
|
+
title: nls.localize(1179, "Reject"),
|
|
244
244
|
group: 'primary',
|
|
245
245
|
order: 3,
|
|
246
246
|
}]
|
|
@@ -259,7 +259,7 @@ export class ToggleInlineCompletionShowCollapsed extends EditorAction {
|
|
|
259
259
|
constructor() {
|
|
260
260
|
super({
|
|
261
261
|
id: ToggleInlineCompletionShowCollapsed.ID,
|
|
262
|
-
label: nls.localize2(
|
|
262
|
+
label: nls.localize2(1190, "Toggle Inline Suggestions Show Collapsed"),
|
|
263
263
|
precondition: ContextKeyExpr.true(),
|
|
264
264
|
});
|
|
265
265
|
}
|
|
@@ -281,7 +281,7 @@ export class ToggleAlwaysShowInlineSuggestionToolbar extends Action2 {
|
|
|
281
281
|
constructor() {
|
|
282
282
|
super({
|
|
283
283
|
id: ToggleAlwaysShowInlineSuggestionToolbar.ID,
|
|
284
|
-
title: nls.localize(
|
|
284
|
+
title: nls.localize(1180, "Always Show Toolbar"),
|
|
285
285
|
f1: false,
|
|
286
286
|
precondition: undefined,
|
|
287
287
|
menu: [{
|
|
@@ -303,7 +303,7 @@ export class DevExtractReproSample extends EditorAction {
|
|
|
303
303
|
constructor() {
|
|
304
304
|
super({
|
|
305
305
|
id: 'editor.action.inlineSuggest.dev.extractRepro',
|
|
306
|
-
label: nls.localize(
|
|
306
|
+
label: nls.localize(1181, "Developer: Extract Inline Suggest State"),
|
|
307
307
|
alias: 'Developer: Inline Suggest Extract Repro',
|
|
308
308
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineEditVisible, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
309
309
|
});
|
package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js
CHANGED
|
@@ -6,17 +6,17 @@ 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.inlineSuggestionHasIndentation = new RawContextKey('inlineSuggestionHasIndentation', false, localize(
|
|
11
|
-
static { this.inlineSuggestionHasIndentationLessThanTabSize = new RawContextKey('inlineSuggestionHasIndentationLessThanTabSize', true, localize(
|
|
12
|
-
static { this.suppressSuggestions = new RawContextKey('inlineSuggestionSuppressSuggestions', undefined, localize(
|
|
13
|
-
static { this.cursorBeforeGhostText = new RawContextKey('cursorBeforeGhostText', false, localize(
|
|
14
|
-
static { this.cursorInIndentation = new RawContextKey('cursorInIndentation', false, localize(
|
|
15
|
-
static { this.hasSelection = new RawContextKey('editor.hasSelection', false, localize(
|
|
16
|
-
static { this.cursorAtInlineEdit = new RawContextKey('cursorAtInlineEdit', false, localize(
|
|
17
|
-
static { this.inlineEditVisible = new RawContextKey('inlineEditIsVisible', false, localize(
|
|
18
|
-
static { this.tabShouldJumpToInlineEdit = new RawContextKey('tabShouldJumpToInlineEdit', false, localize(
|
|
19
|
-
static { this.tabShouldAcceptInlineEdit = new RawContextKey('tabShouldAcceptInlineEdit', false, localize(
|
|
20
|
-
static { this.inInlineEditsPreviewEditor = new RawContextKey('inInlineEditsPreviewEditor', true, nls.localize(
|
|
9
|
+
static { this.inlineSuggestionVisible = new RawContextKey('inlineSuggestionVisible', false, localize(1191, "Whether an inline suggestion is visible")); }
|
|
10
|
+
static { this.inlineSuggestionHasIndentation = new RawContextKey('inlineSuggestionHasIndentation', false, localize(1192, "Whether the inline suggestion starts with whitespace")); }
|
|
11
|
+
static { this.inlineSuggestionHasIndentationLessThanTabSize = new RawContextKey('inlineSuggestionHasIndentationLessThanTabSize', true, localize(1193, "Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")); }
|
|
12
|
+
static { this.suppressSuggestions = new RawContextKey('inlineSuggestionSuppressSuggestions', undefined, localize(1194, "Whether suggestions should be suppressed for the current suggestion")); }
|
|
13
|
+
static { this.cursorBeforeGhostText = new RawContextKey('cursorBeforeGhostText', false, localize(1195, "Whether the cursor is at ghost text")); }
|
|
14
|
+
static { this.cursorInIndentation = new RawContextKey('cursorInIndentation', false, localize(1196, "Whether the cursor is in indentation")); }
|
|
15
|
+
static { this.hasSelection = new RawContextKey('editor.hasSelection', false, localize(1197, "Whether the editor has a selection")); }
|
|
16
|
+
static { this.cursorAtInlineEdit = new RawContextKey('cursorAtInlineEdit', false, localize(1198, "Whether the cursor is at an inline edit")); }
|
|
17
|
+
static { this.inlineEditVisible = new RawContextKey('inlineEditIsVisible', false, localize(1199, "Whether an inline edit is visible")); }
|
|
18
|
+
static { this.tabShouldJumpToInlineEdit = new RawContextKey('tabShouldJumpToInlineEdit', false, localize(1200, "Whether tab should jump to an inline edit.")); }
|
|
19
|
+
static { this.tabShouldAcceptInlineEdit = new RawContextKey('tabShouldAcceptInlineEdit', false, localize(1201, "Whether tab should accept the inline edit.")); }
|
|
20
|
+
static { this.inInlineEditsPreviewEditor = new RawContextKey('inInlineEditsPreviewEditor', true, nls.localize(1202, "Whether the current code editor is showing an inline edits preview")); }
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=inlineCompletionContextKeys.js.map
|
package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js
CHANGED
|
@@ -31,6 +31,7 @@ import { IKeybindingService } from '../../../../../platform/keybinding/common/ke
|
|
|
31
31
|
import { hotClassGetOriginalInstance } from '../../../../../platform/observable/common/wrapInHotClass.js';
|
|
32
32
|
import { CoreEditingCommands } from '../../../../browser/coreCommands.js';
|
|
33
33
|
import { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';
|
|
34
|
+
import { TriggerInlineEditCommandsRegistry } from '../../../../browser/triggerInlineEditCommandsRegistry.js';
|
|
34
35
|
import { getOuterEditor } from '../../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js';
|
|
35
36
|
import { Position } from '../../../../common/core/position.js';
|
|
36
37
|
import { ILanguageFeatureDebounceService } from '../../../../common/services/languageFeatureDebounce.js';
|
|
@@ -190,6 +191,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
190
191
|
InsertLineAfterAction.ID,
|
|
191
192
|
InsertLineBeforeAction.ID,
|
|
192
193
|
FIND_IDS.NextMatchFindAction,
|
|
194
|
+
...TriggerInlineEditCommandsRegistry.getRegisteredCommands(),
|
|
193
195
|
]);
|
|
194
196
|
this._register(this._commandService.onDidExecuteCommand((e) => {
|
|
195
197
|
if (triggerCommands.has(e.commandId) && editor.hasTextFocus() && this._enabled.get()) {
|
|
@@ -363,7 +365,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
363
365
|
const accessibleViewKeybinding = this._keybindingService.lookupKeybinding('editor.action.accessibleView');
|
|
364
366
|
let hint;
|
|
365
367
|
if (!accessibleViewShowing && accessibleViewKeybinding && this.editor.getOption(169 /* EditorOption.inlineCompletionsAccessibilityVerbose */)) {
|
|
366
|
-
hint = localize(
|
|
368
|
+
hint = localize(1203, "Inspect this in the accessible view ({0})", accessibleViewKeybinding.getAriaLabel());
|
|
367
369
|
}
|
|
368
370
|
alert(hint ? content + ', ' + hint : content);
|
|
369
371
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,6CAA6C,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAgB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC/P,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAA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7B,4DAA4D;gBAC5D,IAAI,IAAI,CAAC,sBAAsB,CAAC,GAAG,EAAE,EAAE,CAAC;oBACvC,KAAK,MAAM,IAAI,IAAI,6BAA2B,CAAC,UAAU,EAAE,CAAC;wBAC3D,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;4BACnB,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;wBACzC,CAAC;oBACF,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,IAAI;QACV,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,EAAE,CAAC;YACP,CAAC,CAAC,IAAI,EAAE,CAAC;QACV,CAAC;IACF,CAAC;;AAvZW,2BAA2B;IAgDrC,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;IAClB,WAAA,qBAAqB,CAAA;IACrB,WAAA,eAAe,CAAA;IACf,WAAA,+BAA+B,CAAA;IAC/B,WAAA,wBAAwB,CAAA;IACxB,WAAA,2BAA2B,CAAA;IAC3B,WAAA,kBAAkB,CAAA;IAClB,WAAA,qBAAqB,CAAA;GAxDX,2BAA2B,CAwZvC","file":"inlineCompletionsController.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 { alert } from '../../../../../base/browser/ui/aria/aria.js';\nimport { timeout } from '../../../../../base/common/async.js';\nimport { cancelOnDispose } from '../../../../../base/common/cancellation.js';\nimport { createHotClass } from '../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable, toDisposable } from '../../../../../base/common/lifecycle.js';\nimport { ITransaction, autorun, derived, derivedDisposable, derivedObservableWithCache, observableFromEvent, observableSignal, observableValue, runOnChange, runOnChangeWithStore, transaction, waitForState } from '../../../../../base/common/observable.js';\nimport { isEqual } from '../../../../../base/common/resources.js';\nimport { isUndefined } from '../../../../../base/common/types.js';\nimport { localize } from '../../../../../nls.js';\nimport { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { AccessibilitySignal, IAccessibilitySignalService } from '../../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService, ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js';\nimport { hotClassGetOriginalInstance } from '../../../../../platform/observable/common/wrapInHotClass.js';\nimport { CoreEditingCommands } from '../../../../browser/coreCommands.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { getOuterEditor } from '../../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { CursorChangeReason } from '../../../../common/cursorEvents.js';\nimport { ILanguageFeatureDebounceService } from '../../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { FIND_IDS } from '../../../find/browser/findModel.js';\nimport { InsertLineAfterAction, InsertLineBeforeAction } from '../../../linesOperations/browser/linesOperations.js';\nimport { InlineSuggestionHintsContentWidget } from '../hintsWidget/inlineCompletionsHintsWidget.js';\nimport { TextModelChangeRecorder } from '../model/changeRecorder.js';\nimport { InlineCompletionsModel } from '../model/inlineCompletionsModel.js';\nimport { ObservableSuggestWidgetAdapter } from '../model/suggestWidgetAdapter.js';\nimport { ObservableContextKeyService } from '../utils.js';\nimport { InlineCompletionsView } from '../view/inlineCompletionsView.js';\nimport { inlineSuggestCommitId } from './commandIds.js';\nimport { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js';\n\nexport class InlineCompletionsController extends Disposable {\n\tprivate static readonly _instances = new Set<InlineCompletionsController>();\n\n\tpublic static hot = createHotClass(this);\n\tpublic static ID = 'editor.contrib.inlineCompletionsController';\n\n\t/**\n\t * Find the controller in the focused editor or in the outer editor (if applicable)\n\t */\n\tpublic static getInFocusedEditorOrParent(accessor: ServicesAccessor): InlineCompletionsController | null {\n\t\tconst outerEditor = getOuterEditor(accessor);\n\t\tif (!outerEditor) {\n\t\t\treturn null;\n\t\t}\n\t\treturn InlineCompletionsController.get(outerEditor);\n\t}\n\n\tpublic static get(editor: ICodeEditor): InlineCompletionsController | null {\n\t\treturn hotClassGetOriginalInstance(editor.getContribution<InlineCompletionsController>(InlineCompletionsController.ID));\n\t}\n\n\tprivate readonly _editorObs;\n\tprivate readonly _positions;\n\n\tprivate readonly _suggestWidgetAdapter;\n\n\tprivate readonly _enabledInConfig;\n\tprivate readonly _isScreenReaderEnabled;\n\tprivate readonly _editorDictationInProgress;\n\tprivate readonly _enabled;\n\n\tprivate readonly _debounceValue;\n\n\tprivate readonly _focusIsInMenu;\n\tprivate readonly _focusIsInEditorOrMenu;\n\n\tprivate readonly _cursorIsInIndentation;\n\n\tpublic readonly model;\n\n\tprivate readonly _playAccessibilitySignal;\n\n\tprivate readonly _hideInlineEditOnSelectionChange;\n\n\tprotected readonly _view;\n\n\tconstructor(\n\t\tpublic readonly editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ILanguageFeatureDebounceService private readonly _debounceService: ILanguageFeatureDebounceService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t) {\n\t\tsuper();\n\t\tthis._editorObs = observableCodeEditor(this.editor);\n\t\tthis._positions = derived(this, reader => this._editorObs.selections.read(reader)?.map(s => s.getEndPosition()) ?? [new Position(1, 1)]);\n\t\tthis._suggestWidgetAdapter = this._register(new ObservableSuggestWidgetAdapter(\n\t\t\tthis._editorObs,\n\t\t\titem => this.model.get()?.handleSuggestAccepted(item),\n\t\t\t() => this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit(),\n\t\t));\n\t\tthis._enabledInConfig = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).enabled);\n\t\tthis._isScreenReaderEnabled = observableFromEvent(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized());\n\t\tthis._editorDictationInProgress = observableFromEvent(this,\n\t\t\tthis._contextKeyService.onDidChangeContext,\n\t\t\t() => this._contextKeyService.getContext(this.editor.getDomNode()).getValue('editorDictation.inProgress') === true\n\t\t);\n\t\tthis._enabled = derived(this, reader => this._enabledInConfig.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader)));\n\t\tthis._debounceValue = this._debounceService.for(\n\t\t\tthis._languageFeaturesService.inlineCompletionsProvider,\n\t\t\t'InlineCompletionsDebounce',\n\t\t\t{ min: 50, max: 50 }\n\t\t);\n\t\tthis._focusIsInMenu = observableValue<boolean>(this, false);\n\t\tthis._focusIsInEditorOrMenu = derived(this, reader => {\n\t\t\tconst editorHasFocus = this._editorObs.isFocused.read(reader);\n\t\t\tconst menuHasFocus = this._focusIsInMenu.read(reader);\n\t\t\treturn editorHasFocus || menuHasFocus;\n\t\t});\n\t\tthis._cursorIsInIndentation = derived(this, reader => {\n\t\t\tconst cursorPos = this._editorObs.cursorPosition.read(reader);\n\t\t\tif (cursorPos === null) { return false; }\n\t\t\tconst model = this._editorObs.model.read(reader);\n\t\t\tif (!model) { return false; }\n\t\t\tthis._editorObs.versionId.read(reader);\n\t\t\tconst indentMaxColumn = model.getLineIndentColumn(cursorPos.lineNumber);\n\t\t\treturn cursorPos.column <= indentMaxColumn;\n\t\t});\n\t\tthis.model = derivedDisposable<InlineCompletionsModel | undefined>(this, reader => {\n\t\t\tif (this._editorObs.isReadonly.read(reader)) { return undefined; }\n\t\t\tconst textModel = this._editorObs.model.read(reader);\n\t\t\tif (!textModel) { return undefined; }\n\n\t\t\tconst model: InlineCompletionsModel = this._instantiationService.createInstance(\n\t\t\t\tInlineCompletionsModel,\n\t\t\t\ttextModel,\n\t\t\t\tthis._suggestWidgetAdapter.selectedItem,\n\t\t\t\tthis._editorObs.versionId,\n\t\t\t\tthis._positions,\n\t\t\t\tthis._debounceValue,\n\t\t\t\tthis._enabled,\n\t\t\t\tthis.editor,\n\t\t\t);\n\t\t\treturn model;\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._playAccessibilitySignal = observableSignal(this);\n\t\tthis._hideInlineEditOnSelectionChange = this._editorObs.getOption(EditorOption.inlineSuggest).map(val => true);\n\t\tthis._view = this._register(this._instantiationService.createInstance(InlineCompletionsView, this.editor, this.model, this._focusIsInMenu));\n\n\t\tInlineCompletionsController._instances.add(this);\n\t\tthis._register(toDisposable(() => InlineCompletionsController._instances.delete(this)));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t// Cancel all other inline completions when a new one starts\n\t\t\tconst model = this.model.read(reader);\n\t\t\tif (!model) { return; }\n\t\t\tconst state = model.state.read(reader);\n\t\t\tif (!state) { return; }\n\t\t\tif (!this._focusIsInEditorOrMenu.read(undefined)) { return; }\n\n\t\t\t// This controller is in focus, hence reject others.\n\t\t\t// However if we display a NES that relates to another edit then trigger NES on that related controller\n\t\t\tconst nextEditUri = state.kind === 'inlineEdit' ? state.nextEditUri : undefined;\n\t\t\tfor (const ctrl of InlineCompletionsController._instances) {\n\t\t\t\tif (ctrl === this) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (nextEditUri && isEqual(nextEditUri, ctrl.editor.getModel()?.uri)) {\n\t\t\t\t\t// The next edit in other edito is related to this controller, trigger it.\n\t\t\t\t\tctrl.model.read(undefined)?.trigger();\n\t\t\t\t} else {\n\t\t\t\t\tctrl.reject();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._register(autorun(reader => {\n\t\t\t// Cancel all other inline completions when a new one starts\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst uri = this.editor.getModel()?.uri;\n\t\t\tif (!model || !uri) { return; }\n\n\t\t\t// This NES was accepted, its possible there is an NES that points to this editor.\n\t\t\t// I.e. there's an NES that reads `Go To Next Edit`,\n\t\t\t// If there is one that points to this editor, then we need to hide that as this NES was accepted.\n\t\t\treader.store.add(model.onDidAccept(() => {\n\t\t\t\tfor (const ctrl of InlineCompletionsController._instances) {\n\t\t\t\t\tif (ctrl === this) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Find the nes from another editor that points to this.\n\t\t\t\t\tconst state = ctrl.model.read(undefined)?.state.read(undefined);\n\t\t\t\t\tif (state?.kind === 'inlineEdit' && isEqual(state.nextEditUri, uri)) {\n\t\t\t\t\t\tctrl.model.read(undefined)?.stop('automatic');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\n\t\t}));\n\n\t\tthis._register(runOnChange(this._editorObs.onDidType, (_value, _changes) => {\n\t\t\tif (this._enabled.get()) {\n\t\t\t\tthis.model.get()?.trigger();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(runOnChange(this._editorObs.onDidPaste, (_value, _changes) => {\n\t\t\tif (this._enabled.get()) {\n\t\t\t\tthis.model.get()?.trigger();\n\t\t\t}\n\t\t}));\n\n\t\t// These commands don't trigger onDidType.\n\t\tconst triggerCommands = new Set([\n\t\t\tCoreEditingCommands.Tab.id,\n\t\t\tCoreEditingCommands.DeleteLeft.id,\n\t\t\tCoreEditingCommands.DeleteRight.id,\n\t\t\tinlineSuggestCommitId,\n\t\t\t'acceptSelectedSuggestion',\n\t\t\tInsertLineAfterAction.ID,\n\t\t\tInsertLineBeforeAction.ID,\n\t\t\tFIND_IDS.NextMatchFindAction,\n\t\t]);\n\t\tthis._register(this._commandService.onDidExecuteCommand((e) => {\n\t\t\tif (triggerCommands.has(e.commandId) && editor.hasTextFocus() && this._enabled.get()) {\n\t\t\t\tlet noDelay = false;\n\t\t\t\tif (e.commandId === inlineSuggestCommitId) {\n\t\t\t\t\tnoDelay = true;\n\t\t\t\t}\n\t\t\t\tthis._editorObs.forceUpdate(tx => {\n\t\t\t\t\t/** @description onDidExecuteCommand */\n\t\t\t\t\tthis.model.get()?.trigger(tx, { noDelay });\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(runOnChange(this._editorObs.selections, (_value, _, changes) => {\n\t\t\tif (changes.some(e => e.reason === CursorChangeReason.Explicit || e.source === 'api')) {\n\t\t\t\tif (!this._hideInlineEditOnSelectionChange.get() && this.model.get()?.state.get()?.kind === 'inlineEdit') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst m = this.model.get();\n\t\t\t\tif (!m) { return; }\n\t\t\t\tif (m.state.get()?.kind === 'ghostText') {\n\t\t\t\t\tthis.model.get()?.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst isFocused = this._focusIsInEditorOrMenu.read(reader);\n\t\t\tconst model = this.model.read(undefined);\n\t\t\tif (isFocused) {\n\t\t\t\t// If this model already has an NES for another editor, then leave as is\n\t\t\t\t// Else stop other models.\n\t\t\t\tconst state = model?.state.read(undefined);\n\t\t\t\tif (!state || state.kind !== 'inlineEdit' || !state.nextEditUri) {\n\t\t\t\t\ttransaction(tx => {\n\t\t\t\t\t\tfor (const ctrl of InlineCompletionsController._instances) {\n\t\t\t\t\t\t\tif (ctrl !== this) {\n\t\t\t\t\t\t\t\tctrl.model.read(undefined)?.stop('automatic', tx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// This is a hidden setting very useful for debugging\n\t\t\tif (this._contextKeyService.getContextKeyValue<boolean>('accessibleViewIsShown')\n\t\t\t\t|| this._configurationService.getValue('editor.inlineSuggest.keepOnBlur')\n\t\t\t\t|| editor.getOption(EditorOption.inlineSuggest).keepOnBlur\n\t\t\t\t|| InlineSuggestionHintsContentWidget.dropDownVisible) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!model) { return; }\n\t\t\tif (model.state.read(undefined)?.inlineCompletion?.isFromExplicitRequest && model.inlineEditAvailable.read(undefined)) {\n\t\t\t\t// dont hide inline edits on blur when requested explicitly\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttransaction(tx => {\n\t\t\t\t/** @description InlineCompletionsController.onDidBlurEditorWidget */\n\t\t\t\tmodel.stop('automatic', tx);\n\t\t\t});\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description InlineCompletionsController.forceRenderingAbove */\n\t\t\tconst state = this.model.read(reader)?.inlineCompletionState.read(reader);\n\t\t\tif (state?.suggestItem) {\n\t\t\t\tif (state.primaryGhostText.lineCount >= 2) {\n\t\t\t\t\tthis._suggestWidgetAdapter.forceRenderingAbove();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._suggestWidgetAdapter.stopForceRenderingAbove();\n\t\t\t}\n\t\t}));\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis._suggestWidgetAdapter.stopForceRenderingAbove();\n\t\t}));\n\n\t\tconst currentInlineCompletionBySemanticId = derivedObservableWithCache<string | undefined>(this, (reader, last) => {\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst state = model?.state.read(reader);\n\t\t\tif (this._suggestWidgetAdapter.selectedItem.get()) {\n\t\t\t\treturn last;\n\t\t\t}\n\t\t\treturn state?.inlineCompletion?.semanticId;\n\t\t});\n\t\tthis._register(runOnChangeWithStore(derived(reader => {\n\t\t\tthis._playAccessibilitySignal.read(reader);\n\t\t\tcurrentInlineCompletionBySemanticId.read(reader);\n\t\t\treturn {};\n\t\t}), async (_value, _, _deltas, store) => {\n\t\t\t/** @description InlineCompletionsController.playAccessibilitySignalAndReadSuggestion */\n\t\t\tlet model = this.model.get();\n\t\t\tlet state = model?.state.get();\n\t\t\tif (!state || !model) { return; }\n\n\t\t\tawait timeout(50, cancelOnDispose(store));\n\t\t\tawait waitForState(this._suggestWidgetAdapter.selectedItem, isUndefined, () => false, cancelOnDispose(store));\n\n\t\t\tmodel = this.model.get();\n\t\t\tstate = model?.state.get();\n\t\t\tif (!state || !model) { return; }\n\t\t\tconst lineText = state.kind === 'ghostText' ? model.textModel.getLineContent(state.primaryGhostText.lineNumber) : '';\n\t\t\tthis._accessibilitySignalService.playSignal(state.kind === 'ghostText' ? AccessibilitySignal.inlineSuggestion : AccessibilitySignal.nextEditSuggestion);\n\n\t\t\tif (this.editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) {\n\t\t\t\tif (state.kind === 'ghostText') {\n\t\t\t\t\tthis._provideScreenReaderUpdate(state.primaryGhostText.renderForScreenReader(lineText));\n\t\t\t\t} else {\n\t\t\t\t\tthis._provideScreenReaderUpdate(''); // Only announce Alt+F2\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// TODO@hediet\n\t\tthis._register(this._configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration('accessibility.verbosity.inlineCompletions')) {\n\t\t\t\tthis.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue('accessibility.verbosity.inlineCompletions') });\n\t\t\t}\n\t\t}));\n\t\tthis.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue('accessibility.verbosity.inlineCompletions') });\n\n\t\tconst contextKeySvcObs = new ObservableContextKeyService(this._contextKeyService);\n\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorInIndentation, this._cursorIsInIndentation));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.hasSelection, reader => !this._editorObs.cursorSelection.read(reader)?.isEmpty()));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorAtInlineEdit, this.model.map((m, reader) => m?.inlineEditState?.read(reader)?.cursorAtInlineEdit.read(reader))));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.tabShouldAcceptInlineEdit, this.model.map((m, r) => !!m?.tabShouldAcceptInlineEdit.read(r))));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.tabShouldJumpToInlineEdit, this.model.map((m, r) => !!m?.tabShouldJumpToInlineEdit.read(r))));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineEditVisible, reader => this.model.read(reader)?.inlineEditState.read(reader) !== undefined));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionHasIndentation,\n\t\t\treader => this.model.read(reader)?.getIndentationInfo(reader)?.startsWithIndentation\n\t\t));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize,\n\t\t\treader => this.model.read(reader)?.getIndentationInfo(reader)?.startsWithIndentationLessThanTabSize\n\t\t));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.suppressSuggestions, reader => {\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst state = model?.inlineCompletionState.read(reader);\n\t\t\treturn state?.primaryGhostText && state?.inlineCompletion ? state.inlineCompletion.source.inlineSuggestions.suppressSuggestions : undefined;\n\t\t}));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionVisible, reader => {\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst state = model?.inlineCompletionState.read(reader);\n\t\t\treturn !!state?.inlineCompletion && state?.primaryGhostText !== undefined && !state?.primaryGhostText.isEmpty();\n\t\t}));\n\t\tconst firstGhostTextPos = derived(this, reader => {\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst state = model?.inlineCompletionState.read(reader);\n\t\t\tconst primaryGhostText = state?.primaryGhostText;\n\t\t\tif (!primaryGhostText || primaryGhostText.isEmpty()) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst firstPartPos = new Position(primaryGhostText.lineNumber, primaryGhostText.parts[0].column);\n\t\t\treturn firstPartPos;\n\t\t});\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorBeforeGhostText, reader => {\n\t\t\tconst firstPartPos = firstGhostTextPos.read(reader);\n\t\t\tif (!firstPartPos) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst cursorPos = this._editorObs.cursorPosition.read(reader);\n\t\t\tif (!cursorPos) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn firstPartPos.equals(cursorPos);\n\t\t}));\n\n\t\tthis._register(this._instantiationService.createInstance(TextModelChangeRecorder, this.editor));\n\t}\n\n\tpublic playAccessibilitySignal(tx: ITransaction) {\n\t\tthis._playAccessibilitySignal.trigger(tx);\n\t}\n\n\tprivate _provideScreenReaderUpdate(content: string): void {\n\t\tconst accessibleViewShowing = this._contextKeyService.getContextKeyValue<boolean>('accessibleViewIsShown');\n\t\tconst accessibleViewKeybinding = this._keybindingService.lookupKeybinding('editor.action.accessibleView');\n\t\tlet hint: string | undefined;\n\t\tif (!accessibleViewShowing && accessibleViewKeybinding && this.editor.getOption(EditorOption.inlineCompletionsAccessibilityVerbose)) {\n\t\t\thint = localize('showAccessibleViewHint', \"Inspect this in the accessible view ({0})\", accessibleViewKeybinding.getAriaLabel());\n\t\t}\n\t\talert(hint ? content + ', ' + hint : content);\n\t}\n\n\tpublic shouldShowHoverAt(range: Range) {\n\t\tconst ghostText = this.model.get()?.primaryGhostText.get();\n\t\tif (!ghostText) {\n\t\t\treturn false;\n\t\t}\n\t\treturn ghostText.parts.some(p => range.containsPosition(new Position(ghostText.lineNumber, p.column)));\n\t}\n\n\tpublic shouldShowHoverAtViewZone(viewZoneId: string): boolean {\n\t\treturn this._view.shouldShowHoverAtViewZone(viewZoneId);\n\t}\n\n\tpublic reject(): void {\n\t\ttransaction(tx => {\n\t\t\tconst m = this.model.get();\n\t\t\tif (m) {\n\t\t\t\tm.stop('explicitCancel', tx);\n\t\t\t\t// Only if this controller is in focus can we cancel others.\n\t\t\t\tif (this._focusIsInEditorOrMenu.get()) {\n\t\t\t\t\tfor (const ctrl of InlineCompletionsController._instances) {\n\t\t\t\t\t\tif (ctrl !== this) {\n\t\t\t\t\t\t\tctrl.model.get()?.stop('automatic', tx);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic jump(): void {\n\t\tconst m = this.model.get();\n\t\tif (m) {\n\t\t\tm.jump();\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,6CAA6C,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAgB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE,WAAW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AAC,UAAU,CAAC,CAAC;IACzD,CAAC;IAEM,MAAM;QACZ,WAAW,CAAC,EAAE,CAAC,EAAE;YAChB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAC3B,IAAI,CAAC,EAAE,CAAC;gBACP,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;gBAC7B,4DAA4D;gBAC5D,IAAI,IAAI,CAAC,sBAAsB,CAAC,GAAG,EAAE,EAAE,CAAC;oBACvC,KAAK,MAAM,IAAI,IAAI,6BAA2B,CAAC,UAAU,EAAE,CAAC;wBAC3D,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;4BACnB,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;wBACzC,CAAC;oBACF,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,IAAI;QACV,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,EAAE,CAAC;YACP,CAAC,CAAC,IAAI,EAAE,CAAC;QACV,CAAC;IACF,CAAC;;AAxZW,2BAA2B;IAgDrC,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;IAClB,WAAA,qBAAqB,CAAA;IACrB,WAAA,eAAe,CAAA;IACf,WAAA,+BAA+B,CAAA;IAC/B,WAAA,wBAAwB,CAAA;IACxB,WAAA,2BAA2B,CAAA;IAC3B,WAAA,kBAAkB,CAAA;IAClB,WAAA,qBAAqB,CAAA;GAxDX,2BAA2B,CAyZvC","file":"inlineCompletionsController.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 { alert } from '../../../../../base/browser/ui/aria/aria.js';\nimport { timeout } from '../../../../../base/common/async.js';\nimport { cancelOnDispose } from '../../../../../base/common/cancellation.js';\nimport { createHotClass } from '../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable, toDisposable } from '../../../../../base/common/lifecycle.js';\nimport { ITransaction, autorun, derived, derivedDisposable, derivedObservableWithCache, observableFromEvent, observableSignal, observableValue, runOnChange, runOnChangeWithStore, transaction, waitForState } from '../../../../../base/common/observable.js';\nimport { isEqual } from '../../../../../base/common/resources.js';\nimport { isUndefined } from '../../../../../base/common/types.js';\nimport { localize } from '../../../../../nls.js';\nimport { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { AccessibilitySignal, IAccessibilitySignalService } from '../../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService, ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js';\nimport { hotClassGetOriginalInstance } from '../../../../../platform/observable/common/wrapInHotClass.js';\nimport { CoreEditingCommands } from '../../../../browser/coreCommands.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { TriggerInlineEditCommandsRegistry } from '../../../../browser/triggerInlineEditCommandsRegistry.js';\nimport { getOuterEditor } from '../../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { CursorChangeReason } from '../../../../common/cursorEvents.js';\nimport { ILanguageFeatureDebounceService } from '../../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { FIND_IDS } from '../../../find/browser/findModel.js';\nimport { InsertLineAfterAction, InsertLineBeforeAction } from '../../../linesOperations/browser/linesOperations.js';\nimport { InlineSuggestionHintsContentWidget } from '../hintsWidget/inlineCompletionsHintsWidget.js';\nimport { TextModelChangeRecorder } from '../model/changeRecorder.js';\nimport { InlineCompletionsModel } from '../model/inlineCompletionsModel.js';\nimport { ObservableSuggestWidgetAdapter } from '../model/suggestWidgetAdapter.js';\nimport { ObservableContextKeyService } from '../utils.js';\nimport { InlineCompletionsView } from '../view/inlineCompletionsView.js';\nimport { inlineSuggestCommitId } from './commandIds.js';\nimport { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js';\n\nexport class InlineCompletionsController extends Disposable {\n\tprivate static readonly _instances = new Set<InlineCompletionsController>();\n\n\tpublic static hot = createHotClass(this);\n\tpublic static ID = 'editor.contrib.inlineCompletionsController';\n\n\t/**\n\t * Find the controller in the focused editor or in the outer editor (if applicable)\n\t */\n\tpublic static getInFocusedEditorOrParent(accessor: ServicesAccessor): InlineCompletionsController | null {\n\t\tconst outerEditor = getOuterEditor(accessor);\n\t\tif (!outerEditor) {\n\t\t\treturn null;\n\t\t}\n\t\treturn InlineCompletionsController.get(outerEditor);\n\t}\n\n\tpublic static get(editor: ICodeEditor): InlineCompletionsController | null {\n\t\treturn hotClassGetOriginalInstance(editor.getContribution<InlineCompletionsController>(InlineCompletionsController.ID));\n\t}\n\n\tprivate readonly _editorObs;\n\tprivate readonly _positions;\n\n\tprivate readonly _suggestWidgetAdapter;\n\n\tprivate readonly _enabledInConfig;\n\tprivate readonly _isScreenReaderEnabled;\n\tprivate readonly _editorDictationInProgress;\n\tprivate readonly _enabled;\n\n\tprivate readonly _debounceValue;\n\n\tprivate readonly _focusIsInMenu;\n\tprivate readonly _focusIsInEditorOrMenu;\n\n\tprivate readonly _cursorIsInIndentation;\n\n\tpublic readonly model;\n\n\tprivate readonly _playAccessibilitySignal;\n\n\tprivate readonly _hideInlineEditOnSelectionChange;\n\n\tprotected readonly _view;\n\n\tconstructor(\n\t\tpublic readonly editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ILanguageFeatureDebounceService private readonly _debounceService: ILanguageFeatureDebounceService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t) {\n\t\tsuper();\n\t\tthis._editorObs = observableCodeEditor(this.editor);\n\t\tthis._positions = derived(this, reader => this._editorObs.selections.read(reader)?.map(s => s.getEndPosition()) ?? [new Position(1, 1)]);\n\t\tthis._suggestWidgetAdapter = this._register(new ObservableSuggestWidgetAdapter(\n\t\t\tthis._editorObs,\n\t\t\titem => this.model.get()?.handleSuggestAccepted(item),\n\t\t\t() => this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit(),\n\t\t));\n\t\tthis._enabledInConfig = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).enabled);\n\t\tthis._isScreenReaderEnabled = observableFromEvent(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized());\n\t\tthis._editorDictationInProgress = observableFromEvent(this,\n\t\t\tthis._contextKeyService.onDidChangeContext,\n\t\t\t() => this._contextKeyService.getContext(this.editor.getDomNode()).getValue('editorDictation.inProgress') === true\n\t\t);\n\t\tthis._enabled = derived(this, reader => this._enabledInConfig.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader)));\n\t\tthis._debounceValue = this._debounceService.for(\n\t\t\tthis._languageFeaturesService.inlineCompletionsProvider,\n\t\t\t'InlineCompletionsDebounce',\n\t\t\t{ min: 50, max: 50 }\n\t\t);\n\t\tthis._focusIsInMenu = observableValue<boolean>(this, false);\n\t\tthis._focusIsInEditorOrMenu = derived(this, reader => {\n\t\t\tconst editorHasFocus = this._editorObs.isFocused.read(reader);\n\t\t\tconst menuHasFocus = this._focusIsInMenu.read(reader);\n\t\t\treturn editorHasFocus || menuHasFocus;\n\t\t});\n\t\tthis._cursorIsInIndentation = derived(this, reader => {\n\t\t\tconst cursorPos = this._editorObs.cursorPosition.read(reader);\n\t\t\tif (cursorPos === null) { return false; }\n\t\t\tconst model = this._editorObs.model.read(reader);\n\t\t\tif (!model) { return false; }\n\t\t\tthis._editorObs.versionId.read(reader);\n\t\t\tconst indentMaxColumn = model.getLineIndentColumn(cursorPos.lineNumber);\n\t\t\treturn cursorPos.column <= indentMaxColumn;\n\t\t});\n\t\tthis.model = derivedDisposable<InlineCompletionsModel | undefined>(this, reader => {\n\t\t\tif (this._editorObs.isReadonly.read(reader)) { return undefined; }\n\t\t\tconst textModel = this._editorObs.model.read(reader);\n\t\t\tif (!textModel) { return undefined; }\n\n\t\t\tconst model: InlineCompletionsModel = this._instantiationService.createInstance(\n\t\t\t\tInlineCompletionsModel,\n\t\t\t\ttextModel,\n\t\t\t\tthis._suggestWidgetAdapter.selectedItem,\n\t\t\t\tthis._editorObs.versionId,\n\t\t\t\tthis._positions,\n\t\t\t\tthis._debounceValue,\n\t\t\t\tthis._enabled,\n\t\t\t\tthis.editor,\n\t\t\t);\n\t\t\treturn model;\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._playAccessibilitySignal = observableSignal(this);\n\t\tthis._hideInlineEditOnSelectionChange = this._editorObs.getOption(EditorOption.inlineSuggest).map(val => true);\n\t\tthis._view = this._register(this._instantiationService.createInstance(InlineCompletionsView, this.editor, this.model, this._focusIsInMenu));\n\n\t\tInlineCompletionsController._instances.add(this);\n\t\tthis._register(toDisposable(() => InlineCompletionsController._instances.delete(this)));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t// Cancel all other inline completions when a new one starts\n\t\t\tconst model = this.model.read(reader);\n\t\t\tif (!model) { return; }\n\t\t\tconst state = model.state.read(reader);\n\t\t\tif (!state) { return; }\n\t\t\tif (!this._focusIsInEditorOrMenu.read(undefined)) { return; }\n\n\t\t\t// This controller is in focus, hence reject others.\n\t\t\t// However if we display a NES that relates to another edit then trigger NES on that related controller\n\t\t\tconst nextEditUri = state.kind === 'inlineEdit' ? state.nextEditUri : undefined;\n\t\t\tfor (const ctrl of InlineCompletionsController._instances) {\n\t\t\t\tif (ctrl === this) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (nextEditUri && isEqual(nextEditUri, ctrl.editor.getModel()?.uri)) {\n\t\t\t\t\t// The next edit in other edito is related to this controller, trigger it.\n\t\t\t\t\tctrl.model.read(undefined)?.trigger();\n\t\t\t\t} else {\n\t\t\t\t\tctrl.reject();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._register(autorun(reader => {\n\t\t\t// Cancel all other inline completions when a new one starts\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst uri = this.editor.getModel()?.uri;\n\t\t\tif (!model || !uri) { return; }\n\n\t\t\t// This NES was accepted, its possible there is an NES that points to this editor.\n\t\t\t// I.e. there's an NES that reads `Go To Next Edit`,\n\t\t\t// If there is one that points to this editor, then we need to hide that as this NES was accepted.\n\t\t\treader.store.add(model.onDidAccept(() => {\n\t\t\t\tfor (const ctrl of InlineCompletionsController._instances) {\n\t\t\t\t\tif (ctrl === this) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Find the nes from another editor that points to this.\n\t\t\t\t\tconst state = ctrl.model.read(undefined)?.state.read(undefined);\n\t\t\t\t\tif (state?.kind === 'inlineEdit' && isEqual(state.nextEditUri, uri)) {\n\t\t\t\t\t\tctrl.model.read(undefined)?.stop('automatic');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\n\t\t}));\n\n\t\tthis._register(runOnChange(this._editorObs.onDidType, (_value, _changes) => {\n\t\t\tif (this._enabled.get()) {\n\t\t\t\tthis.model.get()?.trigger();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(runOnChange(this._editorObs.onDidPaste, (_value, _changes) => {\n\t\t\tif (this._enabled.get()) {\n\t\t\t\tthis.model.get()?.trigger();\n\t\t\t}\n\t\t}));\n\n\t\t// These commands don't trigger onDidType.\n\t\tconst triggerCommands = new Set([\n\t\t\tCoreEditingCommands.Tab.id,\n\t\t\tCoreEditingCommands.DeleteLeft.id,\n\t\t\tCoreEditingCommands.DeleteRight.id,\n\t\t\tinlineSuggestCommitId,\n\t\t\t'acceptSelectedSuggestion',\n\t\t\tInsertLineAfterAction.ID,\n\t\t\tInsertLineBeforeAction.ID,\n\t\t\tFIND_IDS.NextMatchFindAction,\n\t\t\t...TriggerInlineEditCommandsRegistry.getRegisteredCommands(),\n\t\t]);\n\t\tthis._register(this._commandService.onDidExecuteCommand((e) => {\n\t\t\tif (triggerCommands.has(e.commandId) && editor.hasTextFocus() && this._enabled.get()) {\n\t\t\t\tlet noDelay = false;\n\t\t\t\tif (e.commandId === inlineSuggestCommitId) {\n\t\t\t\t\tnoDelay = true;\n\t\t\t\t}\n\t\t\t\tthis._editorObs.forceUpdate(tx => {\n\t\t\t\t\t/** @description onDidExecuteCommand */\n\t\t\t\t\tthis.model.get()?.trigger(tx, { noDelay });\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(runOnChange(this._editorObs.selections, (_value, _, changes) => {\n\t\t\tif (changes.some(e => e.reason === CursorChangeReason.Explicit || e.source === 'api')) {\n\t\t\t\tif (!this._hideInlineEditOnSelectionChange.get() && this.model.get()?.state.get()?.kind === 'inlineEdit') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst m = this.model.get();\n\t\t\t\tif (!m) { return; }\n\t\t\t\tif (m.state.get()?.kind === 'ghostText') {\n\t\t\t\t\tthis.model.get()?.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst isFocused = this._focusIsInEditorOrMenu.read(reader);\n\t\t\tconst model = this.model.read(undefined);\n\t\t\tif (isFocused) {\n\t\t\t\t// If this model already has an NES for another editor, then leave as is\n\t\t\t\t// Else stop other models.\n\t\t\t\tconst state = model?.state.read(undefined);\n\t\t\t\tif (!state || state.kind !== 'inlineEdit' || !state.nextEditUri) {\n\t\t\t\t\ttransaction(tx => {\n\t\t\t\t\t\tfor (const ctrl of InlineCompletionsController._instances) {\n\t\t\t\t\t\t\tif (ctrl !== this) {\n\t\t\t\t\t\t\t\tctrl.model.read(undefined)?.stop('automatic', tx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// This is a hidden setting very useful for debugging\n\t\t\tif (this._contextKeyService.getContextKeyValue<boolean>('accessibleViewIsShown')\n\t\t\t\t|| this._configurationService.getValue('editor.inlineSuggest.keepOnBlur')\n\t\t\t\t|| editor.getOption(EditorOption.inlineSuggest).keepOnBlur\n\t\t\t\t|| InlineSuggestionHintsContentWidget.dropDownVisible) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!model) { return; }\n\t\t\tif (model.state.read(undefined)?.inlineCompletion?.isFromExplicitRequest && model.inlineEditAvailable.read(undefined)) {\n\t\t\t\t// dont hide inline edits on blur when requested explicitly\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttransaction(tx => {\n\t\t\t\t/** @description InlineCompletionsController.onDidBlurEditorWidget */\n\t\t\t\tmodel.stop('automatic', tx);\n\t\t\t});\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description InlineCompletionsController.forceRenderingAbove */\n\t\t\tconst state = this.model.read(reader)?.inlineCompletionState.read(reader);\n\t\t\tif (state?.suggestItem) {\n\t\t\t\tif (state.primaryGhostText.lineCount >= 2) {\n\t\t\t\t\tthis._suggestWidgetAdapter.forceRenderingAbove();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._suggestWidgetAdapter.stopForceRenderingAbove();\n\t\t\t}\n\t\t}));\n\t\tthis._register(toDisposable(() => {\n\t\t\tthis._suggestWidgetAdapter.stopForceRenderingAbove();\n\t\t}));\n\n\t\tconst currentInlineCompletionBySemanticId = derivedObservableWithCache<string | undefined>(this, (reader, last) => {\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst state = model?.state.read(reader);\n\t\t\tif (this._suggestWidgetAdapter.selectedItem.get()) {\n\t\t\t\treturn last;\n\t\t\t}\n\t\t\treturn state?.inlineCompletion?.semanticId;\n\t\t});\n\t\tthis._register(runOnChangeWithStore(derived(reader => {\n\t\t\tthis._playAccessibilitySignal.read(reader);\n\t\t\tcurrentInlineCompletionBySemanticId.read(reader);\n\t\t\treturn {};\n\t\t}), async (_value, _, _deltas, store) => {\n\t\t\t/** @description InlineCompletionsController.playAccessibilitySignalAndReadSuggestion */\n\t\t\tlet model = this.model.get();\n\t\t\tlet state = model?.state.get();\n\t\t\tif (!state || !model) { return; }\n\n\t\t\tawait timeout(50, cancelOnDispose(store));\n\t\t\tawait waitForState(this._suggestWidgetAdapter.selectedItem, isUndefined, () => false, cancelOnDispose(store));\n\n\t\t\tmodel = this.model.get();\n\t\t\tstate = model?.state.get();\n\t\t\tif (!state || !model) { return; }\n\t\t\tconst lineText = state.kind === 'ghostText' ? model.textModel.getLineContent(state.primaryGhostText.lineNumber) : '';\n\t\t\tthis._accessibilitySignalService.playSignal(state.kind === 'ghostText' ? AccessibilitySignal.inlineSuggestion : AccessibilitySignal.nextEditSuggestion);\n\n\t\t\tif (this.editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) {\n\t\t\t\tif (state.kind === 'ghostText') {\n\t\t\t\t\tthis._provideScreenReaderUpdate(state.primaryGhostText.renderForScreenReader(lineText));\n\t\t\t\t} else {\n\t\t\t\t\tthis._provideScreenReaderUpdate(''); // Only announce Alt+F2\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// TODO@hediet\n\t\tthis._register(this._configurationService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration('accessibility.verbosity.inlineCompletions')) {\n\t\t\t\tthis.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue('accessibility.verbosity.inlineCompletions') });\n\t\t\t}\n\t\t}));\n\t\tthis.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue('accessibility.verbosity.inlineCompletions') });\n\n\t\tconst contextKeySvcObs = new ObservableContextKeyService(this._contextKeyService);\n\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorInIndentation, this._cursorIsInIndentation));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.hasSelection, reader => !this._editorObs.cursorSelection.read(reader)?.isEmpty()));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorAtInlineEdit, this.model.map((m, reader) => m?.inlineEditState?.read(reader)?.cursorAtInlineEdit.read(reader))));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.tabShouldAcceptInlineEdit, this.model.map((m, r) => !!m?.tabShouldAcceptInlineEdit.read(r))));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.tabShouldJumpToInlineEdit, this.model.map((m, r) => !!m?.tabShouldJumpToInlineEdit.read(r))));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineEditVisible, reader => this.model.read(reader)?.inlineEditState.read(reader) !== undefined));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionHasIndentation,\n\t\t\treader => this.model.read(reader)?.getIndentationInfo(reader)?.startsWithIndentation\n\t\t));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize,\n\t\t\treader => this.model.read(reader)?.getIndentationInfo(reader)?.startsWithIndentationLessThanTabSize\n\t\t));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.suppressSuggestions, reader => {\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst state = model?.inlineCompletionState.read(reader);\n\t\t\treturn state?.primaryGhostText && state?.inlineCompletion ? state.inlineCompletion.source.inlineSuggestions.suppressSuggestions : undefined;\n\t\t}));\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionVisible, reader => {\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst state = model?.inlineCompletionState.read(reader);\n\t\t\treturn !!state?.inlineCompletion && state?.primaryGhostText !== undefined && !state?.primaryGhostText.isEmpty();\n\t\t}));\n\t\tconst firstGhostTextPos = derived(this, reader => {\n\t\t\tconst model = this.model.read(reader);\n\t\t\tconst state = model?.inlineCompletionState.read(reader);\n\t\t\tconst primaryGhostText = state?.primaryGhostText;\n\t\t\tif (!primaryGhostText || primaryGhostText.isEmpty()) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst firstPartPos = new Position(primaryGhostText.lineNumber, primaryGhostText.parts[0].column);\n\t\t\treturn firstPartPos;\n\t\t});\n\t\tthis._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorBeforeGhostText, reader => {\n\t\t\tconst firstPartPos = firstGhostTextPos.read(reader);\n\t\t\tif (!firstPartPos) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst cursorPos = this._editorObs.cursorPosition.read(reader);\n\t\t\tif (!cursorPos) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn firstPartPos.equals(cursorPos);\n\t\t}));\n\n\t\tthis._register(this._instantiationService.createInstance(TextModelChangeRecorder, this.editor));\n\t}\n\n\tpublic playAccessibilitySignal(tx: ITransaction) {\n\t\tthis._playAccessibilitySignal.trigger(tx);\n\t}\n\n\tprivate _provideScreenReaderUpdate(content: string): void {\n\t\tconst accessibleViewShowing = this._contextKeyService.getContextKeyValue<boolean>('accessibleViewIsShown');\n\t\tconst accessibleViewKeybinding = this._keybindingService.lookupKeybinding('editor.action.accessibleView');\n\t\tlet hint: string | undefined;\n\t\tif (!accessibleViewShowing && accessibleViewKeybinding && this.editor.getOption(EditorOption.inlineCompletionsAccessibilityVerbose)) {\n\t\t\thint = localize('showAccessibleViewHint', \"Inspect this in the accessible view ({0})\", accessibleViewKeybinding.getAriaLabel());\n\t\t}\n\t\talert(hint ? content + ', ' + hint : content);\n\t}\n\n\tpublic shouldShowHoverAt(range: Range) {\n\t\tconst ghostText = this.model.get()?.primaryGhostText.get();\n\t\tif (!ghostText) {\n\t\t\treturn false;\n\t\t}\n\t\treturn ghostText.parts.some(p => range.containsPosition(new Position(ghostText.lineNumber, p.column)));\n\t}\n\n\tpublic shouldShowHoverAtViewZone(viewZoneId: string): boolean {\n\t\treturn this._view.shouldShowHoverAtViewZone(viewZoneId);\n\t}\n\n\tpublic reject(): void {\n\t\ttransaction(tx => {\n\t\t\tconst m = this.model.get();\n\t\t\tif (m) {\n\t\t\t\tm.stop('explicitCancel', tx);\n\t\t\t\t// Only if this controller is in focus can we cancel others.\n\t\t\t\tif (this._focusIsInEditorOrMenu.get()) {\n\t\t\t\t\tfor (const ctrl of InlineCompletionsController._instances) {\n\t\t\t\t\t\tif (ctrl !== this) {\n\t\t\t\t\t\t\tctrl.model.get()?.stop('automatic', tx);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic jump(): void {\n\t\tconst m = this.model.get();\n\t\tif (m) {\n\t\t\tm.jump();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -114,13 +114,16 @@ let InlineCompletionsHoverParticipant = class InlineCompletionsHoverParticipant
|
|
|
114
114
|
};
|
|
115
115
|
return new RenderedHoverParts([renderedHoverPart]);
|
|
116
116
|
}
|
|
117
|
+
getAccessibleContent(hoverPart) {
|
|
118
|
+
return nls.localize(1204, 'There are inline completions here');
|
|
119
|
+
}
|
|
117
120
|
renderScreenReaderText(context, part) {
|
|
118
121
|
const disposables = new DisposableStore();
|
|
119
122
|
const $ = dom.$;
|
|
120
123
|
const markdownHoverElement = $('div.hover-row.markdown-hover');
|
|
121
124
|
const hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' }));
|
|
122
125
|
const render = (code) => {
|
|
123
|
-
const inlineSuggestionAvailable = nls.localize(
|
|
126
|
+
const inlineSuggestionAvailable = nls.localize(1205, "Suggestion:");
|
|
124
127
|
const renderedContents = disposables.add(this._markdownRendererService.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code), {
|
|
125
128
|
context: this._editor,
|
|
126
129
|
asyncRenderCallback: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAe,MAAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAGtG,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAAgC,yBAAyB,EAA2G,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC5O,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AACxG,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM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,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACP,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACjC,CAAC;QACF,CAAC,CAAC,CAAC,CAAC;QAEJ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QACnD,OAAO,WAAW,CAAC;IACpB,CAAC;CACD,CAAA;AAxIY,iCAAiC;IAM3C,WAAA,qBAAqB,CAAA;IACrB,WAAA,qBAAqB,CAAA;IACrB,WAAA,iBAAiB,CAAA;IACjB,WAAA,wBAAwB,CAAA;GATd,iCAAiC,CAwI7C","file":"hoverParticipant.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../../../base/browser/dom.js';\nimport { MarkdownString } from '../../../../../base/common/htmlContent.js';\nimport { DisposableStore, IDisposable } from '../../../../../base/common/lifecycle.js';\nimport { autorun, autorunWithStore, constObservable } from '../../../../../base/common/observable.js';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { IModelDecoration } from '../../../../common/model.js';\nimport { HoverAnchor, HoverAnchorType, HoverForeignElementAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverPart, IRenderedHoverParts, RenderedHoverParts } from '../../../hover/browser/hoverTypes.js';\nimport { InlineCompletionsController } from '../controller/inlineCompletionsController.js';\nimport { InlineSuggestionHintsContentWidget } from './inlineCompletionsHintsWidget.js';\nimport { IMarkdownRendererService } from '../../../../../platform/markdown/browser/markdownRenderer.js';\nimport * as nls from '../../../../../nls.js';\nimport { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js';\nimport { GhostTextView } from '../view/ghostText/ghostTextView.js';\n\nexport class InlineCompletionsHover implements IHoverPart {\n\tconstructor(\n\t\tpublic readonly owner: IEditorHoverParticipant<InlineCompletionsHover>,\n\t\tpublic readonly range: Range,\n\t\tpublic readonly controller: InlineCompletionsController\n\t) { }\n\n\tpublic isValidForHoverAnchor(anchor: HoverAnchor): boolean {\n\t\treturn (\n\t\t\tanchor.type === HoverAnchorType.Range\n\t\t\t&& this.range.startColumn <= anchor.range.startColumn\n\t\t\t&& this.range.endColumn >= anchor.range.endColumn\n\t\t);\n\t}\n}\n\nexport class InlineCompletionsHoverParticipant implements IEditorHoverParticipant<InlineCompletionsHover> {\n\n\tpublic readonly hoverOrdinal: number = 4;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IAccessibilityService private readonly accessibilityService: IAccessibilityService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ITelemetryService private readonly _telemetryService: ITelemetryService,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t}\n\n\tsuggestHoverAnchor(mouseEvent: IEditorMouseEvent): HoverAnchor | null {\n\t\tconst controller = InlineCompletionsController.get(this._editor);\n\t\tif (!controller) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.CONTENT_VIEW_ZONE) {\n\t\t\t// handle the case where the mouse is over the view zone\n\t\t\tconst viewZoneData = target.detail;\n\t\t\tif (controller.shouldShowHoverAtViewZone(viewZoneData.viewZoneId)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, Range.fromPositions(this._editor.getModel()!.validatePosition(viewZoneData.positionBefore || viewZoneData.position)), mouseEvent.event.posx, mouseEvent.event.posy, false);\n\t\t\t}\n\t\t}\n\t\tif (target.type === MouseTargetType.CONTENT_EMPTY) {\n\t\t\t// handle the case where the mouse is over the empty portion of a line following ghost text\n\t\t\tif (controller.shouldShowHoverAt(target.range)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n\t\t\t}\n\t\t}\n\t\tif (target.type === MouseTargetType.CONTENT_TEXT) {\n\t\t\t// handle the case where the mouse is directly over ghost text\n\t\t\tconst mightBeForeignElement = target.detail.mightBeForeignElement;\n\t\t\tif (mightBeForeignElement && controller.shouldShowHoverAt(target.range)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n\t\t\t}\n\t\t}\n\t\tif (target.type === MouseTargetType.CONTENT_WIDGET && target.element) {\n\t\t\tconst ctx = GhostTextView.getWarningWidgetContext(target.element);\n\t\t\tif (ctx && controller.shouldShowHoverAt(ctx.range)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, ctx.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tcomputeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): InlineCompletionsHover[] {\n\t\tif (this._editor.getOption(EditorOption.inlineSuggest).showToolbar !== 'onHover') {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst controller = InlineCompletionsController.get(this._editor);\n\t\tif (controller && controller.shouldShowHoverAt(anchor.range)) {\n\t\t\treturn [new InlineCompletionsHover(this, anchor.range, controller)];\n\t\t}\n\t\treturn [];\n\t}\n\n\trenderHoverParts(context: IEditorHoverRenderContext, hoverParts: InlineCompletionsHover[]): IRenderedHoverParts<InlineCompletionsHover> {\n\t\tconst disposables = new DisposableStore();\n\t\tconst part = hoverParts[0];\n\n\t\tthis._telemetryService.publicLog2<{}, {\n\t\t\towner: 'hediet';\n\t\t\tcomment: 'This event tracks whenever an inline completion hover is shown.';\n\t\t}>('inlineCompletionHover.shown');\n\n\t\tif (this.accessibilityService.isScreenReaderOptimized() && !this._editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) {\n\t\t\tdisposables.add(this.renderScreenReaderText(context, part));\n\t\t}\n\n\t\tconst model = part.controller.model.get()!;\n\t\tconst widgetNode: HTMLElement = document.createElement('div');\n\t\tcontext.fragment.appendChild(widgetNode);\n\n\t\tdisposables.add(autorunWithStore((reader, store) => {\n\t\t\tconst w = store.add(this._instantiationService.createInstance(\n\t\t\t\tInlineSuggestionHintsContentWidget.hot.read(reader),\n\t\t\t\tthis._editor,\n\t\t\t\tfalse,\n\t\t\t\tconstObservable(null),\n\t\t\t\tmodel.selectedInlineCompletionIndex,\n\t\t\t\tmodel.inlineCompletionsCount,\n\t\t\t\tmodel.activeCommands,\n\t\t\t\tmodel.warning,\n\t\t\t\t() => {\n\t\t\t\t\tcontext.onContentsChanged();\n\t\t\t\t},\n\t\t\t));\n\t\t\twidgetNode.replaceChildren(w.getDomNode());\n\t\t}));\n\n\t\tmodel.triggerExplicitly();\n\n\t\tconst renderedHoverPart: IRenderedHoverPart<InlineCompletionsHover> = {\n\t\t\thoverPart: part,\n\t\t\thoverElement: widgetNode,\n\t\t\tdispose() { disposables.dispose(); }\n\t\t};\n\t\treturn new RenderedHoverParts([renderedHoverPart]);\n\t}\n\n\tprivate renderScreenReaderText(context: IEditorHoverRenderContext, part: InlineCompletionsHover): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tconst $ = dom.$;\n\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' }));\n\t\tconst render = (code: string) => {\n\t\t\tconst inlineSuggestionAvailable = nls.localize('inlineSuggestionFollows', \"Suggestion:\");\n\t\t\tconst renderedContents = disposables.add(this._markdownRendererService.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code), {\n\t\t\t\tcontext: this._editor,\n\t\t\t\tasyncRenderCallback: () => {\n\t\t\t\t\thoverContentsElement.className = 'hover-contents code-hover-contents';\n\t\t\t\t\tcontext.onContentsChanged();\n\t\t\t\t}\n\t\t\t}));\n\t\t\thoverContentsElement.replaceChildren(renderedContents.element);\n\t\t};\n\n\t\tdisposables.add(autorun(reader => {\n\t\t\t/** @description update hover */\n\t\t\tconst ghostText = part.controller.model.read(reader)?.primaryGhostText.read(reader);\n\t\t\tif (ghostText) {\n\t\t\t\tconst lineText = this._editor.getModel()!.getLineContent(ghostText.lineNumber);\n\t\t\t\trender(ghostText.renderForScreenReader(lineText));\n\t\t\t} else {\n\t\t\t\tdom.reset(hoverContentsElement);\n\t\t\t}\n\t\t}));\n\n\t\tcontext.fragment.appendChild(markdownHoverElement);\n\t\treturn disposables;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAe,MAAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAGtG,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAAgC,yBAAyB,EAA2G,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC5O,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AACxG,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,M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G,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAG,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;gBAC/E,MAAM,CAAC,SAAS,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACP,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACjC,CAAC;QACF,CAAC,CAAC,CAAC,CAAC;QAEJ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QACnD,OAAO,WAAW,CAAC;IACpB,CAAC;CACD,CAAA;AA5IY,iCAAiC;IAM3C,WAAA,qBAAqB,CAAA;IACrB,WAAA,qBAAqB,CAAA;IACrB,WAAA,iBAAiB,CAAA;IACjB,WAAA,wBAAwB,CAAA;GATd,iCAAiC,CA4I7C","file":"hoverParticipant.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../../../base/browser/dom.js';\nimport { MarkdownString } from '../../../../../base/common/htmlContent.js';\nimport { DisposableStore, IDisposable } from '../../../../../base/common/lifecycle.js';\nimport { autorun, autorunWithStore, constObservable } from '../../../../../base/common/observable.js';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { IModelDecoration } from '../../../../common/model.js';\nimport { HoverAnchor, HoverAnchorType, HoverForeignElementAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverPart, IRenderedHoverParts, RenderedHoverParts } from '../../../hover/browser/hoverTypes.js';\nimport { InlineCompletionsController } from '../controller/inlineCompletionsController.js';\nimport { InlineSuggestionHintsContentWidget } from './inlineCompletionsHintsWidget.js';\nimport { IMarkdownRendererService } from '../../../../../platform/markdown/browser/markdownRenderer.js';\nimport * as nls from '../../../../../nls.js';\nimport { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js';\nimport { GhostTextView } from '../view/ghostText/ghostTextView.js';\n\nexport class InlineCompletionsHover implements IHoverPart {\n\tconstructor(\n\t\tpublic readonly owner: IEditorHoverParticipant<InlineCompletionsHover>,\n\t\tpublic readonly range: Range,\n\t\tpublic readonly controller: InlineCompletionsController\n\t) { }\n\n\tpublic isValidForHoverAnchor(anchor: HoverAnchor): boolean {\n\t\treturn (\n\t\t\tanchor.type === HoverAnchorType.Range\n\t\t\t&& this.range.startColumn <= anchor.range.startColumn\n\t\t\t&& this.range.endColumn >= anchor.range.endColumn\n\t\t);\n\t}\n}\n\nexport class InlineCompletionsHoverParticipant implements IEditorHoverParticipant<InlineCompletionsHover> {\n\n\tpublic readonly hoverOrdinal: number = 4;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IAccessibilityService private readonly accessibilityService: IAccessibilityService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ITelemetryService private readonly _telemetryService: ITelemetryService,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t}\n\n\tsuggestHoverAnchor(mouseEvent: IEditorMouseEvent): HoverAnchor | null {\n\t\tconst controller = InlineCompletionsController.get(this._editor);\n\t\tif (!controller) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.CONTENT_VIEW_ZONE) {\n\t\t\t// handle the case where the mouse is over the view zone\n\t\t\tconst viewZoneData = target.detail;\n\t\t\tif (controller.shouldShowHoverAtViewZone(viewZoneData.viewZoneId)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, Range.fromPositions(this._editor.getModel()!.validatePosition(viewZoneData.positionBefore || viewZoneData.position)), mouseEvent.event.posx, mouseEvent.event.posy, false);\n\t\t\t}\n\t\t}\n\t\tif (target.type === MouseTargetType.CONTENT_EMPTY) {\n\t\t\t// handle the case where the mouse is over the empty portion of a line following ghost text\n\t\t\tif (controller.shouldShowHoverAt(target.range)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n\t\t\t}\n\t\t}\n\t\tif (target.type === MouseTargetType.CONTENT_TEXT) {\n\t\t\t// handle the case where the mouse is directly over ghost text\n\t\t\tconst mightBeForeignElement = target.detail.mightBeForeignElement;\n\t\t\tif (mightBeForeignElement && controller.shouldShowHoverAt(target.range)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n\t\t\t}\n\t\t}\n\t\tif (target.type === MouseTargetType.CONTENT_WIDGET && target.element) {\n\t\t\tconst ctx = GhostTextView.getWarningWidgetContext(target.element);\n\t\t\tif (ctx && controller.shouldShowHoverAt(ctx.range)) {\n\t\t\t\treturn new HoverForeignElementAnchor(1000, this, ctx.range, mouseEvent.event.posx, mouseEvent.event.posy, false);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tcomputeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): InlineCompletionsHover[] {\n\t\tif (this._editor.getOption(EditorOption.inlineSuggest).showToolbar !== 'onHover') {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst controller = InlineCompletionsController.get(this._editor);\n\t\tif (controller && controller.shouldShowHoverAt(anchor.range)) {\n\t\t\treturn [new InlineCompletionsHover(this, anchor.range, controller)];\n\t\t}\n\t\treturn [];\n\t}\n\n\trenderHoverParts(context: IEditorHoverRenderContext, hoverParts: InlineCompletionsHover[]): IRenderedHoverParts<InlineCompletionsHover> {\n\t\tconst disposables = new DisposableStore();\n\t\tconst part = hoverParts[0];\n\n\t\tthis._telemetryService.publicLog2<{}, {\n\t\t\towner: 'hediet';\n\t\t\tcomment: 'This event tracks whenever an inline completion hover is shown.';\n\t\t}>('inlineCompletionHover.shown');\n\n\t\tif (this.accessibilityService.isScreenReaderOptimized() && !this._editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) {\n\t\t\tdisposables.add(this.renderScreenReaderText(context, part));\n\t\t}\n\n\t\tconst model = part.controller.model.get()!;\n\t\tconst widgetNode: HTMLElement = document.createElement('div');\n\t\tcontext.fragment.appendChild(widgetNode);\n\n\t\tdisposables.add(autorunWithStore((reader, store) => {\n\t\t\tconst w = store.add(this._instantiationService.createInstance(\n\t\t\t\tInlineSuggestionHintsContentWidget.hot.read(reader),\n\t\t\t\tthis._editor,\n\t\t\t\tfalse,\n\t\t\t\tconstObservable(null),\n\t\t\t\tmodel.selectedInlineCompletionIndex,\n\t\t\t\tmodel.inlineCompletionsCount,\n\t\t\t\tmodel.activeCommands,\n\t\t\t\tmodel.warning,\n\t\t\t\t() => {\n\t\t\t\t\tcontext.onContentsChanged();\n\t\t\t\t},\n\t\t\t));\n\t\t\twidgetNode.replaceChildren(w.getDomNode());\n\t\t}));\n\n\t\tmodel.triggerExplicitly();\n\n\t\tconst renderedHoverPart: IRenderedHoverPart<InlineCompletionsHover> = {\n\t\t\thoverPart: part,\n\t\t\thoverElement: widgetNode,\n\t\t\tdispose() { disposables.dispose(); }\n\t\t};\n\t\treturn new RenderedHoverParts([renderedHoverPart]);\n\t}\n\n\tgetAccessibleContent(hoverPart: InlineCompletionsHover): string {\n\t\treturn nls.localize('hoverAccessibilityStatusBar', 'There are inline completions here');\n\t}\n\n\tprivate renderScreenReaderText(context: IEditorHoverRenderContext, part: InlineCompletionsHover): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tconst $ = dom.$;\n\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' }));\n\t\tconst render = (code: string) => {\n\t\t\tconst inlineSuggestionAvailable = nls.localize('inlineSuggestionFollows', \"Suggestion:\");\n\t\t\tconst renderedContents = disposables.add(this._markdownRendererService.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code), {\n\t\t\t\tcontext: this._editor,\n\t\t\t\tasyncRenderCallback: () => {\n\t\t\t\t\thoverContentsElement.className = 'hover-contents code-hover-contents';\n\t\t\t\t\tcontext.onContentsChanged();\n\t\t\t\t}\n\t\t\t}));\n\t\t\thoverContentsElement.replaceChildren(renderedContents.element);\n\t\t};\n\n\t\tdisposables.add(autorun(reader => {\n\t\t\t/** @description update hover */\n\t\t\tconst ghostText = part.controller.model.read(reader)?.primaryGhostText.read(reader);\n\t\t\tif (ghostText) {\n\t\t\t\tconst lineText = this._editor.getModel()!.getLineContent(ghostText.lineNumber);\n\t\t\t\trender(ghostText.renderForScreenReader(lineText));\n\t\t\t} else {\n\t\t\t\tdom.reset(hoverContentsElement);\n\t\t\t}\n\t\t}));\n\n\t\tcontext.fragment.appendChild(markdownHoverElement);\n\t\treturn disposables;\n\t}\n}\n"]}
|
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(1206, 'Icon for show next parameter hint.'));
|
|
101
|
+
const inlineSuggestionHintsPreviousIcon = registerIcon('inline-suggestion-hints-previous', Codicon.chevronLeft, localize(1207, '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); }
|
|
@@ -110,7 +110,7 @@ let InlineSuggestionHintsContentWidget = class InlineSuggestionHintsContentWidge
|
|
|
110
110
|
const kb = this.keybindingService.lookupKeybinding(commandId, this._contextKeyService);
|
|
111
111
|
let tooltip = label;
|
|
112
112
|
if (kb) {
|
|
113
|
-
tooltip = localize(
|
|
113
|
+
tooltip = localize(1208, '{0} ({1})', label, kb.getLabel());
|
|
114
114
|
}
|
|
115
115
|
action.tooltip = tooltip;
|
|
116
116
|
return action;
|
|
@@ -158,9 +158,9 @@ let InlineSuggestionHintsContentWidget = class InlineSuggestionHintsContentWidge
|
|
|
158
158
|
this._warningMessageNode.element,
|
|
159
159
|
h('div@toolBar'),
|
|
160
160
|
]);
|
|
161
|
-
this.previousAction = this._register(this.createCommandAction(showPreviousInlineSuggestionActionId, localize(
|
|
161
|
+
this.previousAction = this._register(this.createCommandAction(showPreviousInlineSuggestionActionId, localize(1209, 'Previous'), ThemeIcon.asClassName(inlineSuggestionHintsPreviousIcon)));
|
|
162
162
|
this.availableSuggestionCountAction = this._register(new Action('inlineSuggestionHints.availableSuggestionCount', '', undefined, false));
|
|
163
|
-
this.nextAction = this._register(this.createCommandAction(showNextInlineSuggestionActionId, localize(
|
|
163
|
+
this.nextAction = this._register(this.createCommandAction(showNextInlineSuggestionActionId, localize(1210, 'Next'), ThemeIcon.asClassName(inlineSuggestionHintsNextIcon)));
|
|
164
164
|
this.inlineCompletionsActionsMenus = this._register(this._menuService.createMenu(MenuId.InlineCompletionsActions, this._contextKeyService));
|
|
165
165
|
this.clearAvailableSuggestionCountLabelDebounced = this._register(new RunOnceScheduler(() => {
|
|
166
166
|
this.availableSuggestionCountAction.label = '';
|
|
@@ -62,13 +62,13 @@ let GutterIndicatorMenuContent = class GutterIndicatorMenuContent {
|
|
|
62
62
|
const title = header(this._model.displayName);
|
|
63
63
|
const gotoAndAccept = option(createOptionArgs({
|
|
64
64
|
id: 'gotoAndAccept',
|
|
65
|
-
title: `${localize(
|
|
65
|
+
title: `${localize(1211, "Go To")} / ${localize(1212, "Accept")}`,
|
|
66
66
|
icon: Codicon.check,
|
|
67
67
|
commandId: inlineSuggestCommitId
|
|
68
68
|
}));
|
|
69
69
|
const reject = option(createOptionArgs({
|
|
70
70
|
id: 'reject',
|
|
71
|
-
title: localize(
|
|
71
|
+
title: localize(1213, "Reject"),
|
|
72
72
|
icon: Codicon.close,
|
|
73
73
|
commandId: hideInlineCompletionId
|
|
74
74
|
}));
|
|
@@ -82,25 +82,25 @@ let GutterIndicatorMenuContent = class GutterIndicatorMenuContent {
|
|
|
82
82
|
const toggleCollapsedMode = this._inlineEditsShowCollapsed.map(showCollapsed => showCollapsed ?
|
|
83
83
|
option(createOptionArgs({
|
|
84
84
|
id: 'showExpanded',
|
|
85
|
-
title: localize(
|
|
85
|
+
title: localize(1214, "Show Expanded"),
|
|
86
86
|
icon: Codicon.expandAll,
|
|
87
87
|
commandId: toggleShowCollapsedId
|
|
88
88
|
}))
|
|
89
89
|
: option(createOptionArgs({
|
|
90
90
|
id: 'showCollapsed',
|
|
91
|
-
title: localize(
|
|
91
|
+
title: localize(1215, "Show Collapsed"),
|
|
92
92
|
icon: Codicon.collapseAll,
|
|
93
93
|
commandId: toggleShowCollapsedId
|
|
94
94
|
})));
|
|
95
95
|
const snooze = option(createOptionArgs({
|
|
96
96
|
id: 'snooze',
|
|
97
|
-
title: localize(
|
|
97
|
+
title: localize(1216, "Snooze"),
|
|
98
98
|
icon: Codicon.bellSlash,
|
|
99
99
|
commandId: 'editor.action.inlineSuggest.snooze'
|
|
100
100
|
}));
|
|
101
101
|
const settings = option(createOptionArgs({
|
|
102
102
|
id: 'settings',
|
|
103
|
-
title: localize(
|
|
103
|
+
title: localize(1217, "Settings"),
|
|
104
104
|
icon: Codicon.gear,
|
|
105
105
|
commandId: 'workbench.action.openSettings',
|
|
106
106
|
commandArgs: ['@tag:nextEditSuggestions']
|
|
@@ -92,7 +92,7 @@ let InlineEditsGutterIndicator = class InlineEditsGutterIndicator extends Dispos
|
|
|
92
92
|
}
|
|
93
93
|
return {
|
|
94
94
|
range,
|
|
95
|
-
lineOffsetRange: this._editorObs.observeLineOffsetRange(range,
|
|
95
|
+
lineOffsetRange: this._editorObs.observeLineOffsetRange(range, reader.store),
|
|
96
96
|
};
|
|
97
97
|
});
|
|
98
98
|
this._stickyScrollController = StickyScrollController.get(this._editorObs.editor);
|