monaco-editor-core 0.55.0-dev-20251021 → 0.55.0-dev-20251023
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 +23 -5
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/iconLabel/iconlabel.css +2 -3
- package/esm/vs/base/browser/ui/list/listPaging.js +5 -1
- package/esm/vs/base/browser/ui/list/listPaging.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listView.js +4 -3
- package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
- package/esm/vs/base/common/arrays.js +10 -0
- package/esm/vs/base/common/arrays.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +1 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/paging.js.map +1 -1
- package/esm/vs/base/common/platform.js +1 -0
- package/esm/vs/base/common/platform.js.map +1 -1
- package/esm/vs/base/common/policy.js +40 -1
- package/esm/vs/base/common/policy.js.map +1 -1
- package/esm/vs/base/common/validation.js +157 -0
- package/esm/vs/base/common/validation.js.map +1 -0
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
- package/esm/vs/editor/browser/coreCommands.js +3 -3
- package/esm/vs/editor/browser/editorExtensions.js +9 -9
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
- package/esm/vs/editor/browser/services/hoverService/updatableHoverWidget.js +1 -1
- package/esm/vs/editor/browser/services/inlineCompletionsService.js +4 -4
- package/esm/vs/editor/browser/services/inlineCompletionsService.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +54 -54
- package/esm/vs/editor/common/config/editorOptions.js +406 -406
- package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
- package/esm/vs/editor/common/editorContextKeys.js +46 -46
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +66 -56
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/treeSitter/treeSitterSyntaxTokenBackend.js +1 -1
- package/esm/vs/editor/common/model/tokens/treeSitter/treeSitterSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/services/treeSitter/treeSitterLibraryService.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +10 -10
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/common/viewModel/viewModelLines.js.map +1 -1
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
- package/esm/vs/editor/contrib/find/browser/findWidget.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/folding/browser/foldingDecorations.js.map +1 -1
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +63 -52
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +11 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +4 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +3 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.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/inlineEditsView.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +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 +31 -31
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +35 -28
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +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 +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/esm/vs/editor/standalone/browser/standaloneTreeSitterLibraryService.js +2 -12
- package/esm/vs/editor/standalone/browser/standaloneTreeSitterLibraryService.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 +1 -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/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 +19 -9
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
- 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 +2 -2
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js.map +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 +15 -15
- 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
- package/version.txt +1 -1
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { asyncTransaction, transaction } from '../../../../../base/common/observable.js';
|
|
6
6
|
import { splitLines } from '../../../../../base/common/strings.js';
|
|
7
|
+
import { vBoolean, vObj, vOptionalProp, vString, vUndefined, vUnion, vWithJsonSchemaRef } from '../../../../../base/common/validation.js';
|
|
7
8
|
import * as nls from '../../../../../nls.js';
|
|
8
9
|
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '../../../../../platform/accessibility/common/accessibility.js';
|
|
9
10
|
import { Action2, MenuId } from '../../../../../platform/actions/common/actions.js';
|
|
@@ -12,8 +13,9 @@ import { IConfigurationService } from '../../../../../platform/configuration/com
|
|
|
12
13
|
import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js';
|
|
13
14
|
import { KeybindingsRegistry } from '../../../../../platform/keybinding/common/keybindingsRegistry.js';
|
|
14
15
|
import { INotificationService, Severity } from '../../../../../platform/notification/common/notification.js';
|
|
15
|
-
import { EditorAction
|
|
16
|
+
import { EditorAction } from '../../../../browser/editorExtensions.js';
|
|
16
17
|
import { EditorContextKeys } from '../../../../common/editorContextKeys.js';
|
|
18
|
+
import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';
|
|
17
19
|
import { Context as SuggestContext } from '../../../suggest/browser/suggest.js';
|
|
18
20
|
import { hideInlineCompletionId, inlineSuggestCommitId, jumpToNextInlineEditId, showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId, toggleShowCollapsedId } from './commandIds.js';
|
|
19
21
|
import { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js';
|
|
@@ -23,7 +25,7 @@ export class ShowNextInlineSuggestionAction extends EditorAction {
|
|
|
23
25
|
constructor() {
|
|
24
26
|
super({
|
|
25
27
|
id: ShowNextInlineSuggestionAction.ID,
|
|
26
|
-
label: nls.localize2(
|
|
28
|
+
label: nls.localize2(1182, "Show Next Inline Suggestion"),
|
|
27
29
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
28
30
|
kbOpts: {
|
|
29
31
|
weight: 100,
|
|
@@ -41,7 +43,7 @@ export class ShowPreviousInlineSuggestionAction extends EditorAction {
|
|
|
41
43
|
constructor() {
|
|
42
44
|
super({
|
|
43
45
|
id: ShowPreviousInlineSuggestionAction.ID,
|
|
44
|
-
label: nls.localize2(
|
|
46
|
+
label: nls.localize2(1183, "Show Previous Inline Suggestion"),
|
|
45
47
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
46
48
|
kbOpts: {
|
|
47
49
|
weight: 100,
|
|
@@ -54,60 +56,69 @@ export class ShowPreviousInlineSuggestionAction extends EditorAction {
|
|
|
54
56
|
controller?.model.get()?.previous();
|
|
55
57
|
}
|
|
56
58
|
}
|
|
59
|
+
export const providerIdSchemaUri = 'vscode://schemas/inlineCompletionProviderIdArgs';
|
|
60
|
+
export function inlineCompletionProviderGetMatcher(provider) {
|
|
61
|
+
const result = [];
|
|
62
|
+
if (provider.providerId) {
|
|
63
|
+
result.push(provider.providerId.toStringWithoutVersion());
|
|
64
|
+
result.push(provider.providerId.extensionId + ':*');
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
const argsValidator = vUnion(vObj({
|
|
69
|
+
showNoResultNotification: vOptionalProp(vBoolean()),
|
|
70
|
+
providerId: vOptionalProp(vWithJsonSchemaRef(providerIdSchemaUri, vString())),
|
|
71
|
+
explicit: vOptionalProp(vBoolean()),
|
|
72
|
+
}), vUndefined());
|
|
57
73
|
export class TriggerInlineSuggestionAction extends EditorAction {
|
|
58
74
|
constructor() {
|
|
59
75
|
super({
|
|
60
76
|
id: 'editor.action.inlineSuggest.trigger',
|
|
61
|
-
label: nls.localize2(
|
|
62
|
-
precondition: EditorContextKeys.writable
|
|
77
|
+
label: nls.localize2(1184, "Trigger Inline Suggestion"),
|
|
78
|
+
precondition: EditorContextKeys.writable,
|
|
79
|
+
metadata: {
|
|
80
|
+
description: nls.localize(1171, "Triggers an inline suggestion in the editor."),
|
|
81
|
+
args: [{
|
|
82
|
+
name: 'args',
|
|
83
|
+
description: nls.localize(1172, "Options for triggering inline suggestions."),
|
|
84
|
+
isOptional: true,
|
|
85
|
+
schema: argsValidator.getJSONSchema(),
|
|
86
|
+
}]
|
|
87
|
+
}
|
|
63
88
|
});
|
|
64
89
|
}
|
|
65
|
-
async run(accessor, editor) {
|
|
90
|
+
async run(accessor, editor, args) {
|
|
91
|
+
const notificationService = accessor.get(INotificationService);
|
|
92
|
+
const languageFeaturesService = accessor.get(ILanguageFeaturesService);
|
|
66
93
|
const controller = InlineCompletionsController.get(editor);
|
|
94
|
+
const validatedArgs = argsValidator.validateOrThrow(args);
|
|
95
|
+
const provider = validatedArgs?.providerId ?
|
|
96
|
+
languageFeaturesService.inlineCompletionsProvider.all(editor.getModel())
|
|
97
|
+
.find(p => inlineCompletionProviderGetMatcher(p).some(m => m === validatedArgs.providerId))
|
|
98
|
+
: undefined;
|
|
67
99
|
await asyncTransaction(async (tx) => {
|
|
68
100
|
/** @description triggerExplicitly from command */
|
|
69
|
-
await controller?.model.get()?.
|
|
101
|
+
await controller?.model.get()?.trigger(tx, {
|
|
102
|
+
provider: provider,
|
|
103
|
+
explicit: validatedArgs?.explicit ?? true,
|
|
104
|
+
});
|
|
70
105
|
controller?.playAccessibilitySignal(tx);
|
|
71
106
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
precondition: EditorContextKeys.writable,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
async run(accessor, editor) {
|
|
83
|
-
const notificationService = accessor.get(INotificationService);
|
|
84
|
-
const controller = InlineCompletionsController.get(editor);
|
|
85
|
-
await controller?.model.get()?.triggerExplicitly(undefined, true);
|
|
86
|
-
if (!controller?.model.get()?.inlineEditAvailable.get()) {
|
|
87
|
-
notificationService.notify({
|
|
88
|
-
severity: Severity.Info,
|
|
89
|
-
message: nls.localize(1166, "No inline edit is available.")
|
|
90
|
-
});
|
|
107
|
+
if (validatedArgs?.showNoResultNotification) {
|
|
108
|
+
if (!controller?.model.get()?.state.get()) {
|
|
109
|
+
notificationService.notify({
|
|
110
|
+
severity: Severity.Info,
|
|
111
|
+
message: nls.localize(1173, "No inline suggestion is available.")
|
|
112
|
+
});
|
|
113
|
+
}
|
|
91
114
|
}
|
|
92
115
|
}
|
|
93
116
|
}
|
|
94
|
-
export class TriggerInlineEditAction extends EditorCommand {
|
|
95
|
-
constructor() {
|
|
96
|
-
super({
|
|
97
|
-
id: 'editor.action.inlineSuggest.triggerInlineEdit',
|
|
98
|
-
precondition: EditorContextKeys.writable,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
async runEditorCommand(accessor, editor, args) {
|
|
102
|
-
const controller = InlineCompletionsController.get(editor);
|
|
103
|
-
await controller?.model.get()?.trigger(undefined, { onlyFetchInlineEdits: true });
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
117
|
export class AcceptNextWordOfInlineCompletion extends EditorAction {
|
|
107
118
|
constructor() {
|
|
108
119
|
super({
|
|
109
120
|
id: 'editor.action.inlineSuggest.acceptNextWord',
|
|
110
|
-
label: nls.localize2(
|
|
121
|
+
label: nls.localize2(1185, "Accept Next Word Of Inline Suggestion"),
|
|
111
122
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
112
123
|
kbOpts: {
|
|
113
124
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 1,
|
|
@@ -116,7 +127,7 @@ export class AcceptNextWordOfInlineCompletion extends EditorAction {
|
|
|
116
127
|
},
|
|
117
128
|
menuOpts: [{
|
|
118
129
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
119
|
-
title: nls.localize(
|
|
130
|
+
title: nls.localize(1174, 'Accept Word'),
|
|
120
131
|
group: 'primary',
|
|
121
132
|
order: 2,
|
|
122
133
|
}],
|
|
@@ -131,14 +142,14 @@ export class AcceptNextLineOfInlineCompletion extends EditorAction {
|
|
|
131
142
|
constructor() {
|
|
132
143
|
super({
|
|
133
144
|
id: 'editor.action.inlineSuggest.acceptNextLine',
|
|
134
|
-
label: nls.localize2(
|
|
145
|
+
label: nls.localize2(1186, "Accept Next Line Of Inline Suggestion"),
|
|
135
146
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
136
147
|
kbOpts: {
|
|
137
148
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 1,
|
|
138
149
|
},
|
|
139
150
|
menuOpts: [{
|
|
140
151
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
141
|
-
title: nls.localize(
|
|
152
|
+
title: nls.localize(1175, 'Accept Line'),
|
|
142
153
|
group: 'secondary',
|
|
143
154
|
order: 2,
|
|
144
155
|
}],
|
|
@@ -153,16 +164,16 @@ export class AcceptInlineCompletion extends EditorAction {
|
|
|
153
164
|
constructor() {
|
|
154
165
|
super({
|
|
155
166
|
id: inlineSuggestCommitId,
|
|
156
|
-
label: nls.localize2(
|
|
167
|
+
label: nls.localize2(1187, "Accept Inline Suggestion"),
|
|
157
168
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),
|
|
158
169
|
menuOpts: [{
|
|
159
170
|
menuId: MenuId.InlineSuggestionToolbar,
|
|
160
|
-
title: nls.localize(
|
|
171
|
+
title: nls.localize(1176, "Accept"),
|
|
161
172
|
group: 'primary',
|
|
162
173
|
order: 2,
|
|
163
174
|
}, {
|
|
164
175
|
menuId: MenuId.InlineEditsActions,
|
|
165
|
-
title: nls.localize(
|
|
176
|
+
title: nls.localize(1177, "Accept"),
|
|
166
177
|
group: 'primary',
|
|
167
178
|
order: 2,
|
|
168
179
|
}],
|
|
@@ -193,11 +204,11 @@ export class JumpToNextInlineEdit extends EditorAction {
|
|
|
193
204
|
constructor() {
|
|
194
205
|
super({
|
|
195
206
|
id: jumpToNextInlineEditId,
|
|
196
|
-
label: nls.localize2(
|
|
207
|
+
label: nls.localize2(1188, "Jump to next inline edit"),
|
|
197
208
|
precondition: InlineCompletionContextKeys.inlineEditVisible,
|
|
198
209
|
menuOpts: [{
|
|
199
210
|
menuId: MenuId.InlineEditsActions,
|
|
200
|
-
title: nls.localize(
|
|
211
|
+
title: nls.localize(1178, "Jump"),
|
|
201
212
|
group: 'primary',
|
|
202
213
|
order: 1,
|
|
203
214
|
when: InlineCompletionContextKeys.cursorAtInlineEdit.toNegated(),
|
|
@@ -221,7 +232,7 @@ export class HideInlineCompletion extends EditorAction {
|
|
|
221
232
|
constructor() {
|
|
222
233
|
super({
|
|
223
234
|
id: HideInlineCompletion.ID,
|
|
224
|
-
label: nls.localize2(
|
|
235
|
+
label: nls.localize2(1189, "Hide Inline Suggestion"),
|
|
225
236
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),
|
|
226
237
|
kbOpts: {
|
|
227
238
|
weight: 100 /* KeybindingWeight.EditorContrib */ + 90, // same as hiding the suggest widget
|
|
@@ -229,7 +240,7 @@ export class HideInlineCompletion extends EditorAction {
|
|
|
229
240
|
},
|
|
230
241
|
menuOpts: [{
|
|
231
242
|
menuId: MenuId.InlineEditsActions,
|
|
232
|
-
title: nls.localize(
|
|
243
|
+
title: nls.localize(1179, "Reject"),
|
|
233
244
|
group: 'primary',
|
|
234
245
|
order: 3,
|
|
235
246
|
}]
|
|
@@ -248,7 +259,7 @@ export class ToggleInlineCompletionShowCollapsed extends EditorAction {
|
|
|
248
259
|
constructor() {
|
|
249
260
|
super({
|
|
250
261
|
id: ToggleInlineCompletionShowCollapsed.ID,
|
|
251
|
-
label: nls.localize2(
|
|
262
|
+
label: nls.localize2(1190, "Toggle Inline Suggestions Show Collapsed"),
|
|
252
263
|
precondition: ContextKeyExpr.true(),
|
|
253
264
|
});
|
|
254
265
|
}
|
|
@@ -270,7 +281,7 @@ export class ToggleAlwaysShowInlineSuggestionToolbar extends Action2 {
|
|
|
270
281
|
constructor() {
|
|
271
282
|
super({
|
|
272
283
|
id: ToggleAlwaysShowInlineSuggestionToolbar.ID,
|
|
273
|
-
title: nls.localize(
|
|
284
|
+
title: nls.localize(1180, "Always Show Toolbar"),
|
|
274
285
|
f1: false,
|
|
275
286
|
precondition: undefined,
|
|
276
287
|
menu: [{
|
|
@@ -292,7 +303,7 @@ export class DevExtractReproSample extends EditorAction {
|
|
|
292
303
|
constructor() {
|
|
293
304
|
super({
|
|
294
305
|
id: 'editor.action.inlineSuggest.dev.extractRepro',
|
|
295
|
-
label: nls.localize(
|
|
306
|
+
label: nls.localize(1181, "Developer: Extract Inline Suggest State"),
|
|
296
307
|
alias: 'Developer: Inline Suggest Extract Repro',
|
|
297
308
|
precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineEditVisible, InlineCompletionContextKeys.inlineSuggestionVisible),
|
|
298
309
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/controller/commands.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,kCAAkC,EAAE,MAAM,+DAA+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,EAAE,yCAAyC;YAChD,YAAY,EAAE,cAAc,CAAC,EAAE,CAAC,2BAA2B,CAAC,iBAAiB,EAAE,2BAA2B,CAAC,uBAAuB,CAAC;SACnI,CAAC,CAAC;IACJ,CAAC;IAEe,KAAK,CAAC,GAAG,CAAC,QAA0B,EAAE,MAAmB;QACxE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAEzD,MAAM,UAAU,GAAG,2BAA2B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,CAAC,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QACnB,MAAM,KAAK,GAAG,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAErC,MAAM,qBAAqB,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAEhH,MAAM,IAAI,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElE,MAAM,QAAQ,GAAG,GAAG,KAAK,CAAC,aAAa,kBAAkB,IAAI,gBAAgB,CAAC;QAE9E,MAAM,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAE3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IAChC,CAAC;CACD","file":"commands.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 { KeyCode, KeyMod } from '../../../../../base/common/keyCodes.js';\nimport { asyncTransaction, transaction } from '../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../base/common/strings.js';\nimport * as nls from '../../../../../nls.js';\nimport { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { Action2, MenuId } from '../../../../../platform/actions/common/actions.js';\nimport { IClipboardService } from '../../../../../platform/clipboard/common/clipboardService.js';\nimport { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';\nimport { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { INotificationService, Severity } from '../../../../../platform/notification/common/notification.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { EditorAction, EditorCommand, ServicesAccessor } from '../../../../browser/editorExtensions.js';\nimport { EditorContextKeys } from '../../../../common/editorContextKeys.js';\nimport { Context as SuggestContext } from '../../../suggest/browser/suggest.js';\nimport { hideInlineCompletionId, inlineSuggestCommitId, jumpToNextInlineEditId, showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId, toggleShowCollapsedId } from './commandIds.js';\nimport { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js';\nimport { InlineCompletionsController } from './inlineCompletionsController.js';\n\nexport class ShowNextInlineSuggestionAction extends EditorAction {\n\tpublic static ID = showNextInlineSuggestionActionId;\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ShowNextInlineSuggestionAction.ID,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.showNext', \"Show Next Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: 100,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.BracketRight,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tcontroller?.model.get()?.next();\n\t}\n}\n\nexport class ShowPreviousInlineSuggestionAction extends EditorAction {\n\tpublic static ID = showPreviousInlineSuggestionActionId;\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ShowPreviousInlineSuggestionAction.ID,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.showPrevious', \"Show Previous Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: 100,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.BracketLeft,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tcontroller?.model.get()?.previous();\n\t}\n}\n\nexport class TriggerInlineSuggestionAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.trigger',\n\t\t\tlabel: nls.localize2('action.inlineSuggest.trigger', \"Trigger Inline Suggestion\"),\n\t\t\tprecondition: EditorContextKeys.writable\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tawait asyncTransaction(async tx => {\n\t\t\t/** @description triggerExplicitly from command */\n\t\t\tawait controller?.model.get()?.triggerExplicitly(tx);\n\t\t\tcontroller?.playAccessibilitySignal(tx);\n\t\t});\n\t}\n}\n\nexport class ExplicitTriggerInlineEditAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.triggerInlineEditExplicit',\n\t\t\tlabel: nls.localize2('action.inlineSuggest.trigger.explicitInlineEdit', \"Trigger Next Edit Suggestion\"),\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst notificationService = accessor.get(INotificationService);\n\t\tconst controller = InlineCompletionsController.get(editor);\n\n\t\tawait controller?.model.get()?.triggerExplicitly(undefined, true);\n\t\tif (!controller?.model.get()?.inlineEditAvailable.get()) {\n\t\t\tnotificationService.notify({\n\t\t\t\tseverity: Severity.Info,\n\t\t\t\tmessage: nls.localize('noInlineEditAvailable', \"No inline edit is available.\")\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport class TriggerInlineEditAction extends EditorCommand {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.triggerInlineEdit',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t});\n\t}\n\n\tpublic override async runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: { triggerKind?: 'automatic' | 'explicit' }): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tawait controller?.model.get()?.trigger(undefined, { onlyFetchInlineEdits: true });\n\t}\n}\n\nexport class AcceptNextWordOfInlineCompletion extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.acceptNextWord',\n\t\t\tlabel: nls.localize2('action.inlineSuggest.acceptNextWord', \"Accept Next Word Of Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorContrib + 1,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.RightArrow,\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.cursorBeforeGhostText, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),\n\t\t\t},\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineSuggestionToolbar,\n\t\t\t\ttitle: nls.localize('acceptWord', 'Accept Word'),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 2,\n\t\t\t}],\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tawait controller?.model.get()?.acceptNextWord();\n\t}\n}\n\nexport class AcceptNextLineOfInlineCompletion extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.acceptNextLine',\n\t\t\tlabel: nls.localize2('action.inlineSuggest.acceptNextLine', \"Accept Next Line Of Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorContrib + 1,\n\t\t\t},\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineSuggestionToolbar,\n\t\t\t\ttitle: nls.localize('acceptLine', 'Accept Line'),\n\t\t\t\tgroup: 'secondary',\n\t\t\t\torder: 2,\n\t\t\t}],\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tawait controller?.model.get()?.acceptNextLine();\n\t}\n}\n\nexport class AcceptInlineCompletion extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: inlineSuggestCommitId,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.accept', \"Accept Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineSuggestionToolbar,\n\t\t\t\ttitle: nls.localize('accept', \"Accept\"),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 2,\n\t\t\t}, {\n\t\t\t\tmenuId: MenuId.InlineEditsActions,\n\t\t\t\ttitle: nls.localize('accept', \"Accept\"),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 2,\n\t\t\t}],\n\t\t\tkbOpts: [\n\t\t\t\t{\n\t\t\t\t\tprimary: KeyCode.Tab,\n\t\t\t\t\tweight: 200,\n\t\t\t\t\tkbExpr: ContextKeyExpr.or(\n\t\t\t\t\t\tContextKeyExpr.and(\n\t\t\t\t\t\t\tInlineCompletionContextKeys.inlineSuggestionVisible,\n\t\t\t\t\t\t\tEditorContextKeys.tabMovesFocus.toNegated(),\n\t\t\t\t\t\t\tSuggestContext.Visible.toNegated(),\n\t\t\t\t\t\t\tEditorContextKeys.hoverFocused.toNegated(),\n\t\t\t\t\t\t\tInlineCompletionContextKeys.hasSelection.toNegated(),\n\n\t\t\t\t\t\t\tInlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tContextKeyExpr.and(\n\t\t\t\t\t\t\tInlineCompletionContextKeys.inlineEditVisible,\n\t\t\t\t\t\t\tEditorContextKeys.tabMovesFocus.toNegated(),\n\t\t\t\t\t\t\tSuggestContext.Visible.toNegated(),\n\t\t\t\t\t\t\tEditorContextKeys.hoverFocused.toNegated(),\n\n\t\t\t\t\t\t\tInlineCompletionContextKeys.tabShouldAcceptInlineEdit,\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 async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.getInFocusedEditorOrParent(accessor);\n\t\tif (controller) {\n\t\t\tcontroller.model.get()?.accept(controller.editor);\n\t\t\tcontroller.editor.focus();\n\t\t}\n\t}\n}\nKeybindingsRegistry.registerKeybindingRule({\n\tid: inlineSuggestCommitId,\n\tweight: 202, // greater than jump\n\tprimary: KeyCode.Tab,\n\twhen: ContextKeyExpr.and(InlineCompletionContextKeys.inInlineEditsPreviewEditor)\n});\n\nexport class JumpToNextInlineEdit extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: jumpToNextInlineEditId,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.jump', \"Jump to next inline edit\"),\n\t\t\tprecondition: InlineCompletionContextKeys.inlineEditVisible,\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineEditsActions,\n\t\t\t\ttitle: nls.localize('jump', \"Jump\"),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 1,\n\t\t\t\twhen: InlineCompletionContextKeys.cursorAtInlineEdit.toNegated(),\n\t\t\t}],\n\t\t\tkbOpts: {\n\t\t\t\tprimary: KeyCode.Tab,\n\t\t\t\tweight: 201,\n\t\t\t\tkbExpr: ContextKeyExpr.and(\n\t\t\t\t\tInlineCompletionContextKeys.inlineEditVisible,\n\t\t\t\t\tEditorContextKeys.tabMovesFocus.toNegated(),\n\t\t\t\t\tSuggestContext.Visible.toNegated(),\n\t\t\t\t\tEditorContextKeys.hoverFocused.toNegated(),\n\t\t\t\t\tInlineCompletionContextKeys.tabShouldJumpToInlineEdit,\n\t\t\t\t),\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.jump();\n\t\t}\n\t}\n}\n\nexport class HideInlineCompletion extends EditorAction {\n\tpublic static ID = hideInlineCompletionId;\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: HideInlineCompletion.ID,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.hide', \"Hide Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorContrib + 90, // same as hiding the suggest widget\n\t\t\t\tprimary: KeyCode.Escape,\n\t\t\t},\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineEditsActions,\n\t\t\t\ttitle: nls.localize('reject', \"Reject\"),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 3,\n\t\t\t}]\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.getInFocusedEditorOrParent(accessor);\n\t\ttransaction(tx => {\n\t\t\tcontroller?.model.get()?.stop('explicitCancel', tx);\n\t\t});\n\t\tcontroller?.editor.focus();\n\t}\n}\n\nexport class ToggleInlineCompletionShowCollapsed extends EditorAction {\n\tpublic static ID = toggleShowCollapsedId;\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ToggleInlineCompletionShowCollapsed.ID,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.toggleShowCollapsed', \"Toggle Inline Suggestions Show Collapsed\"),\n\t\t\tprecondition: ContextKeyExpr.true(),\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst configurationService = accessor.get(IConfigurationService);\n\t\tconst showCollapsed = configurationService.getValue<boolean>('editor.inlineSuggest.edits.showCollapsed');\n\t\tconfigurationService.updateValue('editor.inlineSuggest.edits.showCollapsed', !showCollapsed);\n\t}\n}\n\nKeybindingsRegistry.registerKeybindingRule({\n\tid: HideInlineCompletion.ID,\n\tweight: -1, // very weak\n\tprimary: KeyCode.Escape,\n\tsecondary: [KeyMod.Shift | KeyCode.Escape],\n\twhen: ContextKeyExpr.and(InlineCompletionContextKeys.inInlineEditsPreviewEditor)\n});\n\nexport class ToggleAlwaysShowInlineSuggestionToolbar extends Action2 {\n\tpublic static ID = 'editor.action.inlineSuggest.toggleAlwaysShowToolbar';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ToggleAlwaysShowInlineSuggestionToolbar.ID,\n\t\t\ttitle: nls.localize('action.inlineSuggest.alwaysShowToolbar', \"Always Show Toolbar\"),\n\t\t\tf1: false,\n\t\t\tprecondition: undefined,\n\t\t\tmenu: [{\n\t\t\t\tid: MenuId.InlineSuggestionToolbar,\n\t\t\t\tgroup: 'secondary',\n\t\t\t\torder: 10,\n\t\t\t}],\n\t\t\ttoggled: ContextKeyExpr.equals('config.editor.inlineSuggest.showToolbar', 'always')\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor): Promise<void> {\n\t\tconst configService = accessor.get(IConfigurationService);\n\t\tconst currentValue = configService.getValue<'always' | 'onHover'>('editor.inlineSuggest.showToolbar');\n\t\tconst newValue = currentValue === 'always' ? 'onHover' : 'always';\n\t\tconfigService.updateValue('editor.inlineSuggest.showToolbar', newValue);\n\t}\n}\n\nexport class DevExtractReproSample extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.dev.extractRepro',\n\t\t\tlabel: nls.localize('action.inlineSuggest.dev.extractRepro', \"Developer: Extract Inline Suggest State\"),\n\t\t\talias: 'Developer: Inline Suggest Extract Repro',\n\t\t\tprecondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineEditVisible, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t});\n\t}\n\n\tpublic override async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<any> {\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tconst m = controller?.model.get();\n\t\tif (!m) { return; }\n\t\tconst repro = m.extractReproSample();\n\n\t\tconst inlineCompletionLines = splitLines(JSON.stringify({ inlineCompletion: repro.inlineCompletion }, null, 4));\n\n\t\tconst json = inlineCompletionLines.map(l => '// ' + l).join('\\n');\n\n\t\tconst reproStr = `${repro.documentValue}\\n\\n// <json>\\n${json}\\n// </json>\\n`;\n\n\t\tawait clipboardService.writeText(reproStr);\n\n\t\treturn { reproCase: reproStr };\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/controller/commands.ts"],"names":[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AEe,KAAK,CAAC,GAAG,CAAC,QAA0B,EAAE,MAAmB;QACxE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAEzD,MAAM,UAAU,GAAG,2BAA2B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,CAAC,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QACnB,MAAM,KAAK,GAAG,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAErC,MAAM,qBAAqB,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAEhH,MAAM,IAAI,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElE,MAAM,QAAQ,GAAG,GAAG,KAAK,CAAC,aAAa,kBAAkB,IAAI,gBAAgB,CAAC;QAE9E,MAAM,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAE3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IAChC,CAAC;CACD","file":"commands.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 { KeyCode, KeyMod } from '../../../../../base/common/keyCodes.js';\nimport { asyncTransaction, transaction } from '../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../base/common/strings.js';\nimport { vBoolean, vObj, vOptionalProp, vString, vUndefined, vUnion, vWithJsonSchemaRef } from '../../../../../base/common/validation.js';\nimport * as nls from '../../../../../nls.js';\nimport { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { Action2, MenuId } from '../../../../../platform/actions/common/actions.js';\nimport { IClipboardService } from '../../../../../platform/clipboard/common/clipboardService.js';\nimport { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';\nimport { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { INotificationService, Severity } from '../../../../../platform/notification/common/notification.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { EditorAction, ServicesAccessor } from '../../../../browser/editorExtensions.js';\nimport { EditorContextKeys } from '../../../../common/editorContextKeys.js';\nimport { InlineCompletionsProvider } from '../../../../common/languages.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { Context as SuggestContext } from '../../../suggest/browser/suggest.js';\nimport { hideInlineCompletionId, inlineSuggestCommitId, jumpToNextInlineEditId, showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId, toggleShowCollapsedId } from './commandIds.js';\nimport { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js';\nimport { InlineCompletionsController } from './inlineCompletionsController.js';\n\nexport class ShowNextInlineSuggestionAction extends EditorAction {\n\tpublic static ID = showNextInlineSuggestionActionId;\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ShowNextInlineSuggestionAction.ID,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.showNext', \"Show Next Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: 100,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.BracketRight,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tcontroller?.model.get()?.next();\n\t}\n}\n\nexport class ShowPreviousInlineSuggestionAction extends EditorAction {\n\tpublic static ID = showPreviousInlineSuggestionActionId;\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ShowPreviousInlineSuggestionAction.ID,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.showPrevious', \"Show Previous Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: 100,\n\t\t\t\tprimary: KeyMod.Alt | KeyCode.BracketLeft,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tcontroller?.model.get()?.previous();\n\t}\n}\n\nexport const providerIdSchemaUri = 'vscode://schemas/inlineCompletionProviderIdArgs';\n\nexport function inlineCompletionProviderGetMatcher(provider: InlineCompletionsProvider): string[] {\n\tconst result: string[] = [];\n\tif (provider.providerId) {\n\t\tresult.push(provider.providerId.toStringWithoutVersion());\n\t\tresult.push(provider.providerId.extensionId + ':*');\n\t}\n\treturn result;\n}\n\nconst argsValidator = vUnion(vObj({\n\tshowNoResultNotification: vOptionalProp(vBoolean()),\n\tproviderId: vOptionalProp(vWithJsonSchemaRef(providerIdSchemaUri, vString())),\n\texplicit: vOptionalProp(vBoolean()),\n}), vUndefined());\n\nexport class TriggerInlineSuggestionAction extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.trigger',\n\t\t\tlabel: nls.localize2('action.inlineSuggest.trigger', \"Trigger Inline Suggestion\"),\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tmetadata: {\n\t\t\t\tdescription: nls.localize('inlineSuggest.trigger.description', \"Triggers an inline suggestion in the editor.\"),\n\t\t\t\targs: [{\n\t\t\t\t\tname: 'args',\n\t\t\t\t\tdescription: nls.localize('inlineSuggest.trigger.args', \"Options for triggering inline suggestions.\"),\n\t\t\t\t\tisOptional: true,\n\t\t\t\t\tschema: argsValidator.getJSONSchema(),\n\t\t\t\t}]\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic override async run(accessor: ServicesAccessor, editor: ICodeEditor, args: unknown): Promise<void> {\n\t\tconst notificationService = accessor.get(INotificationService);\n\t\tconst languageFeaturesService = accessor.get(ILanguageFeaturesService);\n\n\t\tconst controller = InlineCompletionsController.get(editor);\n\n\t\tconst validatedArgs = argsValidator.validateOrThrow(args);\n\n\t\tconst provider = validatedArgs?.providerId ?\n\t\t\tlanguageFeaturesService.inlineCompletionsProvider.all(editor.getModel()!)\n\t\t\t\t.find(p => inlineCompletionProviderGetMatcher(p).some(m => m === validatedArgs!.providerId))\n\t\t\t: undefined;\n\n\t\tawait asyncTransaction(async tx => {\n\t\t\t/** @description triggerExplicitly from command */\n\t\t\tawait controller?.model.get()?.trigger(tx, {\n\t\t\t\tprovider: provider,\n\t\t\t\texplicit: validatedArgs?.explicit ?? true,\n\t\t\t});\n\t\t\tcontroller?.playAccessibilitySignal(tx);\n\t\t});\n\n\t\tif (validatedArgs?.showNoResultNotification) {\n\t\t\tif (!controller?.model.get()?.state.get()) {\n\t\t\t\tnotificationService.notify({\n\t\t\t\t\tseverity: Severity.Info,\n\t\t\t\t\tmessage: nls.localize('noInlineSuggestionAvailable', \"No inline suggestion is available.\")\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class AcceptNextWordOfInlineCompletion extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.acceptNextWord',\n\t\t\tlabel: nls.localize2('action.inlineSuggest.acceptNextWord', \"Accept Next Word Of Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorContrib + 1,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.RightArrow,\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.cursorBeforeGhostText, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),\n\t\t\t},\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineSuggestionToolbar,\n\t\t\t\ttitle: nls.localize('acceptWord', 'Accept Word'),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 2,\n\t\t\t}],\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tawait controller?.model.get()?.acceptNextWord();\n\t}\n}\n\nexport class AcceptNextLineOfInlineCompletion extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.acceptNextLine',\n\t\t\tlabel: nls.localize2('action.inlineSuggest.acceptNextLine', \"Accept Next Line Of Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorContrib + 1,\n\t\t\t},\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineSuggestionToolbar,\n\t\t\t\ttitle: nls.localize('acceptLine', 'Accept Line'),\n\t\t\t\tgroup: 'secondary',\n\t\t\t\torder: 2,\n\t\t\t}],\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tawait controller?.model.get()?.acceptNextLine();\n\t}\n}\n\nexport class AcceptInlineCompletion extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: inlineSuggestCommitId,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.accept', \"Accept Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineSuggestionToolbar,\n\t\t\t\ttitle: nls.localize('accept', \"Accept\"),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 2,\n\t\t\t}, {\n\t\t\t\tmenuId: MenuId.InlineEditsActions,\n\t\t\t\ttitle: nls.localize('accept', \"Accept\"),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 2,\n\t\t\t}],\n\t\t\tkbOpts: [\n\t\t\t\t{\n\t\t\t\t\tprimary: KeyCode.Tab,\n\t\t\t\t\tweight: 200,\n\t\t\t\t\tkbExpr: ContextKeyExpr.or(\n\t\t\t\t\t\tContextKeyExpr.and(\n\t\t\t\t\t\t\tInlineCompletionContextKeys.inlineSuggestionVisible,\n\t\t\t\t\t\t\tEditorContextKeys.tabMovesFocus.toNegated(),\n\t\t\t\t\t\t\tSuggestContext.Visible.toNegated(),\n\t\t\t\t\t\t\tEditorContextKeys.hoverFocused.toNegated(),\n\t\t\t\t\t\t\tInlineCompletionContextKeys.hasSelection.toNegated(),\n\n\t\t\t\t\t\t\tInlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tContextKeyExpr.and(\n\t\t\t\t\t\t\tInlineCompletionContextKeys.inlineEditVisible,\n\t\t\t\t\t\t\tEditorContextKeys.tabMovesFocus.toNegated(),\n\t\t\t\t\t\t\tSuggestContext.Visible.toNegated(),\n\t\t\t\t\t\t\tEditorContextKeys.hoverFocused.toNegated(),\n\n\t\t\t\t\t\t\tInlineCompletionContextKeys.tabShouldAcceptInlineEdit,\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 async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.getInFocusedEditorOrParent(accessor);\n\t\tif (controller) {\n\t\t\tcontroller.model.get()?.accept(controller.editor);\n\t\t\tcontroller.editor.focus();\n\t\t}\n\t}\n}\nKeybindingsRegistry.registerKeybindingRule({\n\tid: inlineSuggestCommitId,\n\tweight: 202, // greater than jump\n\tprimary: KeyCode.Tab,\n\twhen: ContextKeyExpr.and(InlineCompletionContextKeys.inInlineEditsPreviewEditor)\n});\n\nexport class JumpToNextInlineEdit extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: jumpToNextInlineEditId,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.jump', \"Jump to next inline edit\"),\n\t\t\tprecondition: InlineCompletionContextKeys.inlineEditVisible,\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineEditsActions,\n\t\t\t\ttitle: nls.localize('jump', \"Jump\"),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 1,\n\t\t\t\twhen: InlineCompletionContextKeys.cursorAtInlineEdit.toNegated(),\n\t\t\t}],\n\t\t\tkbOpts: {\n\t\t\t\tprimary: KeyCode.Tab,\n\t\t\t\tweight: 201,\n\t\t\t\tkbExpr: ContextKeyExpr.and(\n\t\t\t\t\tInlineCompletionContextKeys.inlineEditVisible,\n\t\t\t\t\tEditorContextKeys.tabMovesFocus.toNegated(),\n\t\t\t\t\tSuggestContext.Visible.toNegated(),\n\t\t\t\t\tEditorContextKeys.hoverFocused.toNegated(),\n\t\t\t\t\tInlineCompletionContextKeys.tabShouldJumpToInlineEdit,\n\t\t\t\t),\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.jump();\n\t\t}\n\t}\n}\n\nexport class HideInlineCompletion extends EditorAction {\n\tpublic static ID = hideInlineCompletionId;\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: HideInlineCompletion.ID,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.hide', \"Hide Inline Suggestion\"),\n\t\t\tprecondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible),\n\t\t\tkbOpts: {\n\t\t\t\tweight: KeybindingWeight.EditorContrib + 90, // same as hiding the suggest widget\n\t\t\t\tprimary: KeyCode.Escape,\n\t\t\t},\n\t\t\tmenuOpts: [{\n\t\t\t\tmenuId: MenuId.InlineEditsActions,\n\t\t\t\ttitle: nls.localize('reject', \"Reject\"),\n\t\t\t\tgroup: 'primary',\n\t\t\t\torder: 3,\n\t\t\t}]\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst controller = InlineCompletionsController.getInFocusedEditorOrParent(accessor);\n\t\ttransaction(tx => {\n\t\t\tcontroller?.model.get()?.stop('explicitCancel', tx);\n\t\t});\n\t\tcontroller?.editor.focus();\n\t}\n}\n\nexport class ToggleInlineCompletionShowCollapsed extends EditorAction {\n\tpublic static ID = toggleShowCollapsedId;\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ToggleInlineCompletionShowCollapsed.ID,\n\t\t\tlabel: nls.localize2('action.inlineSuggest.toggleShowCollapsed', \"Toggle Inline Suggestions Show Collapsed\"),\n\t\t\tprecondition: ContextKeyExpr.true(),\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\t\tconst configurationService = accessor.get(IConfigurationService);\n\t\tconst showCollapsed = configurationService.getValue<boolean>('editor.inlineSuggest.edits.showCollapsed');\n\t\tconfigurationService.updateValue('editor.inlineSuggest.edits.showCollapsed', !showCollapsed);\n\t}\n}\n\nKeybindingsRegistry.registerKeybindingRule({\n\tid: HideInlineCompletion.ID,\n\tweight: -1, // very weak\n\tprimary: KeyCode.Escape,\n\tsecondary: [KeyMod.Shift | KeyCode.Escape],\n\twhen: ContextKeyExpr.and(InlineCompletionContextKeys.inInlineEditsPreviewEditor)\n});\n\nexport class ToggleAlwaysShowInlineSuggestionToolbar extends Action2 {\n\tpublic static ID = 'editor.action.inlineSuggest.toggleAlwaysShowToolbar';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: ToggleAlwaysShowInlineSuggestionToolbar.ID,\n\t\t\ttitle: nls.localize('action.inlineSuggest.alwaysShowToolbar', \"Always Show Toolbar\"),\n\t\t\tf1: false,\n\t\t\tprecondition: undefined,\n\t\t\tmenu: [{\n\t\t\t\tid: MenuId.InlineSuggestionToolbar,\n\t\t\t\tgroup: 'secondary',\n\t\t\t\torder: 10,\n\t\t\t}],\n\t\t\ttoggled: ContextKeyExpr.equals('config.editor.inlineSuggest.showToolbar', 'always')\n\t\t});\n\t}\n\n\tpublic async run(accessor: ServicesAccessor): Promise<void> {\n\t\tconst configService = accessor.get(IConfigurationService);\n\t\tconst currentValue = configService.getValue<'always' | 'onHover'>('editor.inlineSuggest.showToolbar');\n\t\tconst newValue = currentValue === 'always' ? 'onHover' : 'always';\n\t\tconfigService.updateValue('editor.inlineSuggest.showToolbar', newValue);\n\t}\n}\n\nexport class DevExtractReproSample extends EditorAction {\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.inlineSuggest.dev.extractRepro',\n\t\t\tlabel: nls.localize('action.inlineSuggest.dev.extractRepro', \"Developer: Extract Inline Suggest State\"),\n\t\t\talias: 'Developer: Inline Suggest Extract Repro',\n\t\t\tprecondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineEditVisible, InlineCompletionContextKeys.inlineSuggestionVisible),\n\t\t});\n\t}\n\n\tpublic override async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<any> {\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\n\t\tconst controller = InlineCompletionsController.get(editor);\n\t\tconst m = controller?.model.get();\n\t\tif (!m) { return; }\n\t\tconst repro = m.extractReproSample();\n\n\t\tconst inlineCompletionLines = splitLines(JSON.stringify({ inlineCompletion: repro.inlineCompletion }, null, 4));\n\n\t\tconst json = inlineCompletionLines.map(l => '// ' + l).join('\\n');\n\n\t\tconst reproStr = `${repro.documentValue}\\n\\n// <json>\\n${json}\\n// </json>\\n`;\n\n\t\tawait clipboardService.writeText(reproStr);\n\n\t\treturn { reproCase: reproStr };\n\t}\n}\n"]}
|
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
|
@@ -363,7 +363,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
363
363
|
const accessibleViewKeybinding = this._keybindingService.lookupKeybinding('editor.action.accessibleView');
|
|
364
364
|
let hint;
|
|
365
365
|
if (!accessibleViewShowing && accessibleViewKeybinding && this.editor.getOption(169 /* EditorOption.inlineCompletionsAccessibilityVerbose */)) {
|
|
366
|
-
hint = localize(
|
|
366
|
+
hint = localize(1203, "Inspect this in the accessible view ({0})", accessibleViewKeybinding.getAriaLabel());
|
|
367
367
|
}
|
|
368
368
|
alert(hint ? content + ', ' + hint : content);
|
|
369
369
|
}
|
|
@@ -120,7 +120,7 @@ let InlineCompletionsHoverParticipant = class InlineCompletionsHoverParticipant
|
|
|
120
120
|
const markdownHoverElement = $('div.hover-row.markdown-hover');
|
|
121
121
|
const hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' }));
|
|
122
122
|
const render = (code) => {
|
|
123
|
-
const inlineSuggestionAvailable = nls.localize(
|
|
123
|
+
const inlineSuggestionAvailable = nls.localize(1204, "Suggestion:");
|
|
124
124
|
const renderedContents = disposables.add(this._markdownRendererService.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code), {
|
|
125
125
|
context: this._editor,
|
|
126
126
|
asyncRenderCallback: () => {
|
package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js
CHANGED
|
@@ -97,8 +97,8 @@ InlineCompletionsHintsWidget = __decorate([
|
|
|
97
97
|
__param(2, IInstantiationService)
|
|
98
98
|
], InlineCompletionsHintsWidget);
|
|
99
99
|
export { InlineCompletionsHintsWidget };
|
|
100
|
-
const inlineSuggestionHintsNextIcon = registerIcon('inline-suggestion-hints-next', Codicon.chevronRight, localize(
|
|
101
|
-
const inlineSuggestionHintsPreviousIcon = registerIcon('inline-suggestion-hints-previous', Codicon.chevronLeft, localize(
|
|
100
|
+
const inlineSuggestionHintsNextIcon = registerIcon('inline-suggestion-hints-next', Codicon.chevronRight, localize(1205, 'Icon for show next parameter hint.'));
|
|
101
|
+
const inlineSuggestionHintsPreviousIcon = registerIcon('inline-suggestion-hints-previous', Codicon.chevronLeft, localize(1206, '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(1207, '{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(1208, '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(1209, '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 = '';
|
|
@@ -5,17 +5,15 @@
|
|
|
5
5
|
import { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js';
|
|
6
6
|
import { registerAction2 } from '../../../../platform/actions/common/actions.js';
|
|
7
7
|
import { wrapInHotClass1 } from '../../../../platform/observable/common/wrapInHotClass.js';
|
|
8
|
-
import { registerEditorAction,
|
|
8
|
+
import { registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js';
|
|
9
9
|
import { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js';
|
|
10
|
-
import { AcceptInlineCompletion, AcceptNextLineOfInlineCompletion, AcceptNextWordOfInlineCompletion, DevExtractReproSample, HideInlineCompletion, JumpToNextInlineEdit, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, ToggleAlwaysShowInlineSuggestionToolbar,
|
|
10
|
+
import { AcceptInlineCompletion, AcceptNextLineOfInlineCompletion, AcceptNextWordOfInlineCompletion, DevExtractReproSample, HideInlineCompletion, JumpToNextInlineEdit, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, ToggleAlwaysShowInlineSuggestionToolbar, TriggerInlineSuggestionAction, ToggleInlineCompletionShowCollapsed } from './controller/commands.js';
|
|
11
11
|
import { InlineCompletionsController } from './controller/inlineCompletionsController.js';
|
|
12
12
|
import { InlineCompletionsHoverParticipant } from './hintsWidget/hoverParticipant.js';
|
|
13
13
|
import { InlineCompletionsAccessibleView } from './inlineCompletionsAccessibleView.js';
|
|
14
14
|
import { CancelSnoozeInlineCompletion, SnoozeInlineCompletion } from '../../../browser/services/inlineCompletionsService.js';
|
|
15
15
|
registerEditorContribution(InlineCompletionsController.ID, wrapInHotClass1(InlineCompletionsController.hot), 3 /* EditorContributionInstantiation.Eventually */);
|
|
16
16
|
registerEditorAction(TriggerInlineSuggestionAction);
|
|
17
|
-
registerEditorAction(ExplicitTriggerInlineEditAction);
|
|
18
|
-
registerEditorCommand(new TriggerInlineEditAction());
|
|
19
17
|
registerEditorAction(ShowNextInlineSuggestionAction);
|
|
20
18
|
registerEditorAction(ShowPreviousInlineSuggestionAction);
|
|
21
19
|
registerEditorAction(AcceptNextWordOfInlineCompletion);
|
package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts","vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,sBAAsB,EAAE,MAAM,sEAAsE,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,EAAmC,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts","vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,sBAAsB,EAAE,MAAM,sEAAsE,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,EAAmC,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AACzI,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,kCAAkC,EAAE,uCAAuC,EAAE,6BAA6B,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAC1X,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAE7H,0BAA0B,CAAC,2BAA2B,CAAC,EAAE,EAAE,eAAe,CAAC,2BAA2B,CAAC,GAAG,CAAC,qDAA6C,CAAC;AAEzJ,oBAAoB,CAAC,6BAA6B,CAAC,CAAC;AACpD,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;AACrD,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;AACzD,oBAAoB,CAAC,gCAAgC,CAAC,CAAC;AACvD,oBAAoB,CAAC,gCAAgC,CAAC,CAAC;AACvD,oBAAoB,CAAC,sBAAsB,CAAC,CAAC;AAC7C,oBAAoB,CAAC,mCAAmC,CAAC,CAAC;AAC1D,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;AAC3C,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;AAC3C,eAAe,CAAC,uCAAuC,CAAC,CAAC;AACzD,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;AAC5C,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACxC,eAAe,CAAC,4BAA4B,CAAC,CAAC;AAE9C,wBAAwB,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC;AACrE,sBAAsB,CAAC,QAAQ,CAAC,IAAI,+BAA+B,EAAE,CAAC,CAAC","file":"inlineCompletions.contribution.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 { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js';\nimport { registerAction2 } from '../../../../platform/actions/common/actions.js';\nimport { wrapInHotClass1 } from '../../../../platform/observable/common/wrapInHotClass.js';\nimport { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js';\nimport { AcceptInlineCompletion, AcceptNextLineOfInlineCompletion, AcceptNextWordOfInlineCompletion, DevExtractReproSample, HideInlineCompletion, JumpToNextInlineEdit, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, ToggleAlwaysShowInlineSuggestionToolbar, TriggerInlineSuggestionAction, ToggleInlineCompletionShowCollapsed } from './controller/commands.js';\nimport { InlineCompletionsController } from './controller/inlineCompletionsController.js';\nimport { InlineCompletionsHoverParticipant } from './hintsWidget/hoverParticipant.js';\nimport { InlineCompletionsAccessibleView } from './inlineCompletionsAccessibleView.js';\nimport { CancelSnoozeInlineCompletion, SnoozeInlineCompletion } from '../../../browser/services/inlineCompletionsService.js';\n\nregisterEditorContribution(InlineCompletionsController.ID, wrapInHotClass1(InlineCompletionsController.hot), EditorContributionInstantiation.Eventually);\n\nregisterEditorAction(TriggerInlineSuggestionAction);\nregisterEditorAction(ShowNextInlineSuggestionAction);\nregisterEditorAction(ShowPreviousInlineSuggestionAction);\nregisterEditorAction(AcceptNextWordOfInlineCompletion);\nregisterEditorAction(AcceptNextLineOfInlineCompletion);\nregisterEditorAction(AcceptInlineCompletion);\nregisterEditorAction(ToggleInlineCompletionShowCollapsed);\nregisterEditorAction(HideInlineCompletion);\nregisterEditorAction(JumpToNextInlineEdit);\nregisterAction2(ToggleAlwaysShowInlineSuggestionToolbar);\nregisterEditorAction(DevExtractReproSample);\nregisterAction2(SnoozeInlineCompletion);\nregisterAction2(CancelSnoozeInlineCompletion);\n\nHoverParticipantRegistry.register(InlineCompletionsHoverParticipant);\nAccessibleViewRegistry.register(new InlineCompletionsAccessibleView());\n","/*---------------------------------------------------------------------------------------------\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 { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js';\nimport { registerAction2 } from '../../../../platform/actions/common/actions.js';\nimport { wrapInHotClass1 } from '../../../../platform/observable/common/wrapInHotClass.js';\nimport { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js';\nimport { AcceptInlineCompletion, AcceptNextLineOfInlineCompletion, AcceptNextWordOfInlineCompletion, DevExtractReproSample, HideInlineCompletion, JumpToNextInlineEdit, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, ToggleAlwaysShowInlineSuggestionToolbar, TriggerInlineSuggestionAction, ToggleInlineCompletionShowCollapsed } from './controller/commands.js';\nimport { InlineCompletionsController } from './controller/inlineCompletionsController.js';\nimport { InlineCompletionsHoverParticipant } from './hintsWidget/hoverParticipant.js';\nimport { InlineCompletionsAccessibleView } from './inlineCompletionsAccessibleView.js';\nimport { CancelSnoozeInlineCompletion, SnoozeInlineCompletion } from '../../../browser/services/inlineCompletionsService.js';\n\nregisterEditorContribution(InlineCompletionsController.ID, wrapInHotClass1(InlineCompletionsController.hot), EditorContributionInstantiation.Eventually);\n\nregisterEditorAction(TriggerInlineSuggestionAction);\nregisterEditorAction(ShowNextInlineSuggestionAction);\nregisterEditorAction(ShowPreviousInlineSuggestionAction);\nregisterEditorAction(AcceptNextWordOfInlineCompletion);\nregisterEditorAction(AcceptNextLineOfInlineCompletion);\nregisterEditorAction(AcceptInlineCompletion);\nregisterEditorAction(ToggleInlineCompletionShowCollapsed);\nregisterEditorAction(HideInlineCompletion);\nregisterEditorAction(JumpToNextInlineEdit);\nregisterAction2(ToggleAlwaysShowInlineSuggestionToolbar);\nregisterEditorAction(DevExtractReproSample);\nregisterAction2(SnoozeInlineCompletion);\nregisterAction2(CancelSnoozeInlineCompletion);\n\nHoverParticipantRegistry.register(InlineCompletionsHoverParticipant);\nAccessibleViewRegistry.register(new InlineCompletionsAccessibleView());\n"]}
|
|
@@ -663,28 +663,27 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
663
663
|
}
|
|
664
664
|
return availableProviders;
|
|
665
665
|
}
|
|
666
|
-
async trigger(tx, options) {
|
|
666
|
+
async trigger(tx, options = {}) {
|
|
667
667
|
subtransaction(tx, tx => {
|
|
668
|
-
if (options
|
|
668
|
+
if (options.onlyFetchInlineEdits) {
|
|
669
669
|
this._onlyRequestInlineEditsSignal.trigger(tx);
|
|
670
670
|
}
|
|
671
|
-
if (options
|
|
671
|
+
if (options.noDelay) {
|
|
672
672
|
this._noDelaySignal.trigger(tx);
|
|
673
673
|
}
|
|
674
674
|
this._isActive.set(true, tx);
|
|
675
|
+
if (options.explicit) {
|
|
676
|
+
this._inAcceptFlow.set(true, tx);
|
|
677
|
+
this._forceUpdateExplicitlySignal.trigger(tx);
|
|
678
|
+
}
|
|
679
|
+
if (options.provider) {
|
|
680
|
+
this._fetchSpecificProviderSignal.trigger(tx, options.provider);
|
|
681
|
+
}
|
|
675
682
|
});
|
|
676
683
|
await this._fetchInlineCompletionsPromise.get();
|
|
677
684
|
}
|
|
678
685
|
async triggerExplicitly(tx, onlyFetchInlineEdits = false) {
|
|
679
|
-
|
|
680
|
-
if (onlyFetchInlineEdits) {
|
|
681
|
-
this._onlyRequestInlineEditsSignal.trigger(tx);
|
|
682
|
-
}
|
|
683
|
-
this._isActive.set(true, tx);
|
|
684
|
-
this._inAcceptFlow.set(true, tx);
|
|
685
|
-
this._forceUpdateExplicitlySignal.trigger(tx);
|
|
686
|
-
});
|
|
687
|
-
await this._fetchInlineCompletionsPromise.get();
|
|
686
|
+
return this.trigger(tx, { onlyFetchInlineEdits, explicit: true });
|
|
688
687
|
}
|
|
689
688
|
stop(stopReason = 'automatic', tx) {
|
|
690
689
|
subtransaction(tx, tx => {
|