monaco-editor-core 0.55.0-dev-20251106 → 0.55.0-rc
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 +0 -6
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +24 -83
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +13 -17
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +81 -9
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js.map +1 -1
- 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/diffEditorItemTemplate.js +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
- 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 +407 -407
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
- package/esm/vs/editor/common/editorContextKeys.js +47 -47
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +10 -10
- package/esm/vs/editor/common/textModelEditSource.js +2 -2
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +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/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/format.js +3 -7
- package/esm/vs/editor/contrib/format/browser/format.js.map +1 -1
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +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 +20 -20
- 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 +2 -2
- 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/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 +31 -31
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +10 -10
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +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/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/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +29 -29
- package/esm/vs/platform/list/browser/listService.js.map +1 -1
- 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
- package/version.txt +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/textModelEditSource.ts","vs/editor/common/textModelEditSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,aAAa,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC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M,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;QACrD,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;QAC/B,OAAO,IAAI,aAAa,CAAC,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACxD,CAAC;IAEM,MAAM,CAAC,SAAS,CACtB,UAA8B,EAC9B,YAAgC,EAChC,UAA8B,EAC9B,YAAgC;QAEhC,IAAI,UAAU,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YACtH,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,aAAa,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IAC9E,CAAC;IAED,YACiB,UAAkB,EAClB,YAAoB,EACpB,UAAkB,EAClB,YAAoB;QAHpB,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAQ;IACjC,CAAC;CACL;AASD,MAAM,KAAW,gBAAgB,CAQhC;AARD,WAAiB,gBAAgB;IAChC;;MAEE;IACF,SAAgB,KAAK;QACpB,MAAM,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,cAAc,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAHe,sBAAK,QAGpB,CAAA;AACF,CAAC,EARgB,gBAAgB,KAAhB,gBAAgB,QAQhC;AAED,SAAS,cAAc,CAAC,EAAU;IACjC,OAAO,EAAiC,CAAC;AAC1C,CAAC","file":"textModelEditSource.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { prefixedUuid } from '../../base/common/uuid.js';\nimport { TextLength } from './core/text/textLength.js';\nimport { ProviderId, VersionedExtensionId } from './languages.js';\n\nconst privateSymbol = Symbol('TextModelEditSource');\n\nexport class TextModelEditSource {\n\tconstructor(\n\t\tpublic readonly metadata: ITextModelEditSourceMetadata,\n\t\t_privateCtorGuard: typeof privateSymbol,\n\t) { }\n\n\tpublic toString(): string {\n\t\treturn `${this.metadata.source}`;\n\t}\n\n\tpublic getType(): string {\n\t\tconst metadata = this.metadata;\n\t\tswitch (metadata.source) {\n\t\t\tcase 'cursor':\n\t\t\t\treturn metadata.kind;\n\t\t\tcase 'inlineCompletionAccept':\n\t\t\t\treturn metadata.source + (metadata.$nes ? ':nes' : '');\n\t\t\tcase 'unknown':\n\t\t\t\treturn metadata.name || 'unknown';\n\t\t\tdefault:\n\t\t\t\treturn metadata.source;\n\t\t}\n\t}\n\n\t/**\n\t * Converts the metadata to a key string.\n\t * Only includes properties/values that have `level` many `$` prefixes or less.\n\t*/\n\tpublic toKey(level: number, filter: { [TKey in ITextModelEditSourceMetadataKeys]?: boolean } = {}): string {\n\t\tconst metadata = this.metadata;\n\t\tconst keys = Object.entries(metadata).filter(([key, value]) => {\n\t\t\tconst filterVal = (filter as Record<string, boolean>)[key];\n\t\t\tif (filterVal !== undefined) {\n\t\t\t\treturn filterVal;\n\t\t\t}\n\n\t\t\tconst prefixCount = (key.match(/\\$/g) || []).length;\n\t\t\treturn prefixCount <= level && value !== undefined && value !== null && value !== '';\n\t\t}).map(([key, value]) => `${key}:${value}`);\n\t\treturn keys.join('-');\n\t}\n}\n\ntype TextModelEditSourceT<T> = TextModelEditSource & {\n\tmetadataT: T;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createEditSource<T extends Record<string, any>>(metadata: T): TextModelEditSourceT<T> {\n\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\treturn new TextModelEditSource(metadata as any, privateSymbol) as any;\n}\n\nexport const EditSources = {\n\tunknown(data: { name?: string | null }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'unknown',\n\t\t\tname: data.name,\n\t\t} as const);\n\t},\n\n\trename: () => createEditSource({ source: 'rename' } as const),\n\n\tchatApplyEdits(data: {\n\t\tmodelId: string | undefined;\n\t\tsessionId: string | undefined;\n\t\trequestId: string | undefined;\n\t\tlanguageId: string;\n\t\tmode: string | undefined;\n\t\textensionId: VersionedExtensionId | undefined;\n\t\tcodeBlockSuggestionId: EditSuggestionId | undefined;\n\t}) {\n\t\treturn createEditSource({\n\t\t\tsource: 'Chat.applyEdits',\n\t\t\t$modelId: avoidPathRedaction(data.modelId),\n\t\t\t$extensionId: data.extensionId?.extensionId,\n\t\t\t$extensionVersion: data.extensionId?.version,\n\t\t\t$$languageId: data.languageId,\n\t\t\t$$sessionId: data.sessionId,\n\t\t\t$$requestId: data.requestId,\n\t\t\t$$mode: data.mode,\n\t\t\t$$codeBlockSuggestionId: data.codeBlockSuggestionId,\n\t\t} as const);\n\t},\n\n\tchatUndoEdits: () => createEditSource({ source: 'Chat.undoEdits' } as const),\n\tchatReset: () => createEditSource({ source: 'Chat.reset' } as const),\n\n\tinlineCompletionAccept(data: { nes: boolean; requestUuid: string; languageId: string; providerId?: ProviderId }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineCompletionAccept',\n\t\t\t$nes: data.nes,\n\t\t\t...toProperties(data.providerId),\n\t\t\t$$requestUuid: data.requestUuid,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\tinlineCompletionPartialAccept(data: { nes: boolean; requestUuid: string; languageId: string; providerId?: ProviderId; type: 'word' | 'line' }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineCompletionPartialAccept',\n\t\t\ttype: data.type,\n\t\t\t$nes: data.nes,\n\t\t\t...toProperties(data.providerId),\n\t\t\t$$requestUuid: data.requestUuid,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\tinlineChatApplyEdit(data: { modelId: string | undefined; requestId: string | undefined; sessionId: string | undefined; languageId: string; extensionId: VersionedExtensionId | undefined }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineChat.applyEdits',\n\t\t\t$modelId: avoidPathRedaction(data.modelId),\n\t\t\t$extensionId: data.extensionId?.extensionId,\n\t\t\t$extensionVersion: data.extensionId?.version,\n\t\t\t$$sessionId: data.sessionId,\n\t\t\t$$requestId: data.requestId,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\treloadFromDisk: () => createEditSource({ source: 'reloadFromDisk' } as const),\n\n\tcursor(data: { kind: 'compositionType' | 'compositionEnd' | 'type' | 'paste' | 'cut' | 'executeCommands' | 'executeCommand'; detailedSource?: string | null }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'cursor',\n\t\t\tkind: data.kind,\n\t\t\tdetailedSource: data.detailedSource,\n\t\t} as const);\n\t},\n\n\tsetValue: () => createEditSource({ source: 'setValue' } as const),\n\teolChange: () => createEditSource({ source: 'eolChange' } as const),\n\tapplyEdits: () => createEditSource({ source: 'applyEdits' } as const),\n\tsnippet: () => createEditSource({ source: 'snippet' } as const),\n\tsuggest: (data: { providerId: ProviderId | undefined }) => createEditSource({ source: 'suggest', ...toProperties(data.providerId) } as const),\n\n\tcodeAction: (data: { kind: string | undefined; providerId: ProviderId | undefined }) => createEditSource({ source: 'codeAction', $kind: data.kind, ...toProperties(data.providerId) } as const)\n};\n\nfunction toProperties(version: ProviderId | undefined) {\n\tif (!version) {\n\t\treturn {};\n\t}\n\treturn {\n\t\t$extensionId: version.extensionId,\n\t\t$extensionVersion: version.extensionVersion,\n\t\t$providerId: version.providerId,\n\t};\n}\n\ntype Values<T> = T[keyof T];\nexport type ITextModelEditSourceMetadata = Values<{ [TKey in keyof typeof EditSources]: ReturnType<typeof EditSources[TKey]>['metadataT'] }>;\ntype ITextModelEditSourceMetadataKeys = Values<{ [TKey in keyof typeof EditSources]: keyof ReturnType<typeof EditSources[TKey]>['metadataT'] }>;\n\n\nfunction avoidPathRedaction(str: string | undefined): string | undefined {\n\tif (str === undefined) {\n\t\treturn undefined;\n\t}\n\t// To avoid false-positive file path redaction.\n\treturn str.replaceAll('/', '|');\n}\n\n\nexport class EditDeltaInfo {\n\tpublic static fromText(text: string): EditDeltaInfo {\n\t\tconst linesAdded = TextLength.ofText(text).lineCount;\n\t\tconst charsAdded = text.length;\n\t\treturn new EditDeltaInfo(linesAdded, 0, charsAdded, 0);\n\t}\n\n\tpublic static tryCreate(\n\t\tlinesAdded: number | undefined,\n\t\tlinesRemoved: number | undefined,\n\t\tcharsAdded: number | undefined,\n\t\tcharsRemoved: number | undefined\n\t): EditDeltaInfo | undefined {\n\t\tif (linesAdded === undefined || linesRemoved === undefined || charsAdded === undefined || charsRemoved === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new EditDeltaInfo(linesAdded, linesRemoved, charsAdded, charsRemoved);\n\t}\n\n\tconstructor(\n\t\tpublic readonly linesAdded: number,\n\t\tpublic readonly linesRemoved: number,\n\t\tpublic readonly charsAdded: number,\n\t\tpublic readonly charsRemoved: number\n\t) { }\n}\n\n\n/**\n * This is an opaque serializable type that represents a unique identity for an edit.\n */\nexport interface EditSuggestionId {\n}\n\nexport namespace EditSuggestionId {\n\t/**\n\t * Use AiEditTelemetryServiceImpl to create a new id!\n\t*/\n\texport function newId(): EditSuggestionId {\n\t\tconst id = prefixedUuid('sgt');\n\t\treturn toEditIdentity(id);\n\t}\n}\n\nfunction toEditIdentity(id: string): EditSuggestionId {\n\treturn id as unknown as EditSuggestionId;\n}\n","\nimport { prefixedUuid } from '../../base/common/uuid.js';\nimport { TextLength } from './core/text/textLength.js';\nimport { ProviderId, VersionedExtensionId } from './languages.js';\n\nconst privateSymbol = Symbol('TextModelEditSource');\n\nexport class TextModelEditSource {\n\tconstructor(\n\t\tpublic readonly metadata: ITextModelEditSourceMetadata,\n\t\t_privateCtorGuard: typeof privateSymbol,\n\t) { }\n\n\tpublic toString(): string {\n\t\treturn `${this.metadata.source}`;\n\t}\n\n\tpublic getType(): string {\n\t\tconst metadata = this.metadata;\n\t\tswitch (metadata.source) {\n\t\t\tcase 'cursor':\n\t\t\t\treturn metadata.kind;\n\t\t\tcase 'inlineCompletionAccept':\n\t\t\t\treturn metadata.source + (metadata.$nes ? ':nes' : '');\n\t\t\tcase 'unknown':\n\t\t\t\treturn metadata.name || 'unknown';\n\t\t\tdefault:\n\t\t\t\treturn metadata.source;\n\t\t}\n\t}\n\n\t/**\n\t * Converts the metadata to a key string.\n\t * Only includes properties/values that have `level` many `$` prefixes or less.\n\t*/\n\tpublic toKey(level: number, filter: { [TKey in ITextModelEditSourceMetadataKeys]?: boolean } = {}): string {\n\t\tconst metadata = this.metadata;\n\t\tconst keys = Object.entries(metadata).filter(([key, value]) => {\n\t\t\tconst filterVal = (filter as Record<string, boolean>)[key];\n\t\t\tif (filterVal !== undefined) {\n\t\t\t\treturn filterVal;\n\t\t\t}\n\n\t\t\tconst prefixCount = (key.match(/\\$/g) || []).length;\n\t\t\treturn prefixCount <= level && value !== undefined && value !== null && value !== '';\n\t\t}).map(([key, value]) => `${key}:${value}`);\n\t\treturn keys.join('-');\n\t}\n}\n\ntype TextModelEditSourceT<T> = TextModelEditSource & {\n\tmetadataT: T;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createEditSource<T extends Record<string, any>>(metadata: T): TextModelEditSourceT<T> {\n\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\treturn new TextModelEditSource(metadata as any, privateSymbol) as any;\n}\n\nexport const EditSources = {\n\tunknown(data: { name?: string | null }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'unknown',\n\t\t\tname: data.name,\n\t\t} as const);\n\t},\n\n\trename: () => createEditSource({ source: 'rename' } as const),\n\n\tchatApplyEdits(data: {\n\t\tmodelId: string | undefined;\n\t\tsessionId: string | undefined;\n\t\trequestId: string | undefined;\n\t\tlanguageId: string;\n\t\tmode: string | undefined;\n\t\textensionId: VersionedExtensionId | undefined;\n\t\tcodeBlockSuggestionId: EditSuggestionId | undefined;\n\t}) {\n\t\treturn createEditSource({\n\t\t\tsource: 'Chat.applyEdits',\n\t\t\t$modelId: avoidPathRedaction(data.modelId),\n\t\t\t$extensionId: data.extensionId?.extensionId,\n\t\t\t$extensionVersion: data.extensionId?.version,\n\t\t\t$$languageId: data.languageId,\n\t\t\t$$sessionId: data.sessionId,\n\t\t\t$$requestId: data.requestId,\n\t\t\t$$mode: data.mode,\n\t\t\t$$codeBlockSuggestionId: data.codeBlockSuggestionId,\n\t\t} as const);\n\t},\n\n\tchatUndoEdits: () => createEditSource({ source: 'Chat.undoEdits' } as const),\n\tchatReset: () => createEditSource({ source: 'Chat.reset' } as const),\n\n\tinlineCompletionAccept(data: { nes: boolean; requestUuid: string; languageId: string; providerId?: ProviderId }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineCompletionAccept',\n\t\t\t$nes: data.nes,\n\t\t\t...toProperties(data.providerId),\n\t\t\t$$requestUuid: data.requestUuid,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\tinlineCompletionPartialAccept(data: { nes: boolean; requestUuid: string; languageId: string; providerId?: ProviderId; type: 'word' | 'line' }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineCompletionPartialAccept',\n\t\t\ttype: data.type,\n\t\t\t$nes: data.nes,\n\t\t\t...toProperties(data.providerId),\n\t\t\t$$requestUuid: data.requestUuid,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\tinlineChatApplyEdit(data: { modelId: string | undefined; requestId: string | undefined; sessionId: string | undefined; languageId: string; extensionId: VersionedExtensionId | undefined }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineChat.applyEdits',\n\t\t\t$modelId: avoidPathRedaction(data.modelId),\n\t\t\t$extensionId: data.extensionId?.extensionId,\n\t\t\t$extensionVersion: data.extensionId?.version,\n\t\t\t$$sessionId: data.sessionId,\n\t\t\t$$requestId: data.requestId,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\treloadFromDisk: () => createEditSource({ source: 'reloadFromDisk' } as const),\n\n\tcursor(data: { kind: 'compositionType' | 'compositionEnd' | 'type' | 'paste' | 'cut' | 'executeCommands' | 'executeCommand'; detailedSource?: string | null }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'cursor',\n\t\t\tkind: data.kind,\n\t\t\tdetailedSource: data.detailedSource,\n\t\t} as const);\n\t},\n\n\tsetValue: () => createEditSource({ source: 'setValue' } as const),\n\teolChange: () => createEditSource({ source: 'eolChange' } as const),\n\tapplyEdits: () => createEditSource({ source: 'applyEdits' } as const),\n\tsnippet: () => createEditSource({ source: 'snippet' } as const),\n\tsuggest: (data: { providerId: ProviderId | undefined }) => createEditSource({ source: 'suggest', ...toProperties(data.providerId) } as const),\n\n\tcodeAction: (data: { kind: string | undefined; providerId: ProviderId | undefined }) => createEditSource({ source: 'codeAction', $kind: data.kind, ...toProperties(data.providerId) } as const)\n};\n\nfunction toProperties(version: ProviderId | undefined) {\n\tif (!version) {\n\t\treturn {};\n\t}\n\treturn {\n\t\t$extensionId: version.extensionId,\n\t\t$extensionVersion: version.extensionVersion,\n\t\t$providerId: version.providerId,\n\t};\n}\n\ntype Values<T> = T[keyof T];\nexport type ITextModelEditSourceMetadata = Values<{ [TKey in keyof typeof EditSources]: ReturnType<typeof EditSources[TKey]>['metadataT'] }>;\ntype ITextModelEditSourceMetadataKeys = Values<{ [TKey in keyof typeof EditSources]: keyof ReturnType<typeof EditSources[TKey]>['metadataT'] }>;\n\n\nfunction avoidPathRedaction(str: string | undefined): string | undefined {\n\tif (str === undefined) {\n\t\treturn undefined;\n\t}\n\t// To avoid false-positive file path redaction.\n\treturn str.replaceAll('/', '|');\n}\n\n\nexport class EditDeltaInfo {\n\tpublic static fromText(text: string): EditDeltaInfo {\n\t\tconst linesAdded = TextLength.ofText(text).lineCount;\n\t\tconst charsAdded = text.length;\n\t\treturn new EditDeltaInfo(linesAdded, 0, charsAdded, 0);\n\t}\n\n\tpublic static tryCreate(\n\t\tlinesAdded: number | undefined,\n\t\tlinesRemoved: number | undefined,\n\t\tcharsAdded: number | undefined,\n\t\tcharsRemoved: number | undefined\n\t): EditDeltaInfo | undefined {\n\t\tif (linesAdded === undefined || linesRemoved === undefined || charsAdded === undefined || charsRemoved === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new EditDeltaInfo(linesAdded, linesRemoved, charsAdded, charsRemoved);\n\t}\n\n\tconstructor(\n\t\tpublic readonly linesAdded: number,\n\t\tpublic readonly linesRemoved: number,\n\t\tpublic readonly charsAdded: number,\n\t\tpublic readonly charsRemoved: number\n\t) { }\n}\n\n\n/**\n * This is an opaque serializable type that represents a unique identity for an edit.\n */\nexport interface EditSuggestionId {\n}\n\nexport namespace EditSuggestionId {\n\t/**\n\t * Use AiEditTelemetryServiceImpl to create a new id!\n\t*/\n\texport function newId(): EditSuggestionId {\n\t\tconst id = prefixedUuid('sgt');\n\t\treturn toEditIdentity(id);\n\t}\n}\n\nfunction toEditIdentity(id: string): EditSuggestionId {\n\treturn id as unknown as EditSuggestionId;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/textModelEditSource.ts","vs/editor/common/textModelEditSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,aAAa,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEpD,MAAM,OAAO,mBAAmB;IAC/B,YACiB,QAAsC,EACtD,iBAAuC;QADvB,aAAQ,GAAR,QAAQ,CAA8B;IAEnD,CAAC;IAEE,QAAQ;QACd,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;IAEM,OAAO;QACb,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC;YACzB,KA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,SAAS,IAAI,UAAU,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YACtH,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,aAAa,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IAC9E,CAAC;IAED,YACiB,UAAkB,EAClB,YAAoB,EACpB,UAAkB,EAClB,YAAoB;QAHpB,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAQ;IACjC,CAAC;CACL;AASD,MAAM,KAAW,gBAAgB,CAQhC;AARD,WAAiB,gBAAgB;IAChC;;MAEE;IACF,SAAgB,KAAK,CAAC,eAAwC;QAC7D,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC1E,OAAO,cAAc,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAHe,sBAAK,QAGpB,CAAA;AACF,CAAC,EARgB,gBAAgB,KAAhB,gBAAgB,QAQhC;AAED,SAAS,cAAc,CAAC,EAAU;IACjC,OAAO,EAAiC,CAAC;AAC1C,CAAC","file":"textModelEditSource.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { prefixedUuid } from '../../base/common/uuid.js';\nimport { TextLength } from './core/text/textLength.js';\nimport { ProviderId, VersionedExtensionId } from './languages.js';\n\nconst privateSymbol = Symbol('TextModelEditSource');\n\nexport class TextModelEditSource {\n\tconstructor(\n\t\tpublic readonly metadata: ITextModelEditSourceMetadata,\n\t\t_privateCtorGuard: typeof privateSymbol,\n\t) { }\n\n\tpublic toString(): string {\n\t\treturn `${this.metadata.source}`;\n\t}\n\n\tpublic getType(): string {\n\t\tconst metadata = this.metadata;\n\t\tswitch (metadata.source) {\n\t\t\tcase 'cursor':\n\t\t\t\treturn metadata.kind;\n\t\t\tcase 'inlineCompletionAccept':\n\t\t\t\treturn metadata.source + (metadata.$nes ? ':nes' : '');\n\t\t\tcase 'unknown':\n\t\t\t\treturn metadata.name || 'unknown';\n\t\t\tdefault:\n\t\t\t\treturn metadata.source;\n\t\t}\n\t}\n\n\t/**\n\t * Converts the metadata to a key string.\n\t * Only includes properties/values that have `level` many `$` prefixes or less.\n\t*/\n\tpublic toKey(level: number, filter: { [TKey in ITextModelEditSourceMetadataKeys]?: boolean } = {}): string {\n\t\tconst metadata = this.metadata;\n\t\tconst keys = Object.entries(metadata).filter(([key, value]) => {\n\t\t\tconst filterVal = (filter as Record<string, boolean>)[key];\n\t\t\tif (filterVal !== undefined) {\n\t\t\t\treturn filterVal;\n\t\t\t}\n\n\t\t\tconst prefixCount = (key.match(/\\$/g) || []).length;\n\t\t\treturn prefixCount <= level && value !== undefined && value !== null && value !== '';\n\t\t}).map(([key, value]) => `${key}:${value}`);\n\t\treturn keys.join('-');\n\t}\n}\n\ntype TextModelEditSourceT<T> = TextModelEditSource & {\n\tmetadataT: T;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createEditSource<T extends Record<string, any>>(metadata: T): TextModelEditSourceT<T> {\n\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\treturn new TextModelEditSource(metadata as any, privateSymbol) as any;\n}\n\nexport const EditSources = {\n\tunknown(data: { name?: string | null }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'unknown',\n\t\t\tname: data.name,\n\t\t} as const);\n\t},\n\n\trename: () => createEditSource({ source: 'rename' } as const),\n\n\tchatApplyEdits(data: {\n\t\tmodelId: string | undefined;\n\t\tsessionId: string | undefined;\n\t\trequestId: string | undefined;\n\t\tlanguageId: string;\n\t\tmode: string | undefined;\n\t\textensionId: VersionedExtensionId | undefined;\n\t\tcodeBlockSuggestionId: EditSuggestionId | undefined;\n\t}) {\n\t\treturn createEditSource({\n\t\t\tsource: 'Chat.applyEdits',\n\t\t\t$modelId: avoidPathRedaction(data.modelId),\n\t\t\t$extensionId: data.extensionId?.extensionId,\n\t\t\t$extensionVersion: data.extensionId?.version,\n\t\t\t$$languageId: data.languageId,\n\t\t\t$$sessionId: data.sessionId,\n\t\t\t$$requestId: data.requestId,\n\t\t\t$$mode: data.mode,\n\t\t\t$$codeBlockSuggestionId: data.codeBlockSuggestionId,\n\t\t} as const);\n\t},\n\n\tchatUndoEdits: () => createEditSource({ source: 'Chat.undoEdits' } as const),\n\tchatReset: () => createEditSource({ source: 'Chat.reset' } as const),\n\n\tinlineCompletionAccept(data: { nes: boolean; requestUuid: string; languageId: string; providerId?: ProviderId }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineCompletionAccept',\n\t\t\t$nes: data.nes,\n\t\t\t...toProperties(data.providerId),\n\t\t\t$$requestUuid: data.requestUuid,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\tinlineCompletionPartialAccept(data: { nes: boolean; requestUuid: string; languageId: string; providerId?: ProviderId; type: 'word' | 'line' }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineCompletionPartialAccept',\n\t\t\ttype: data.type,\n\t\t\t$nes: data.nes,\n\t\t\t...toProperties(data.providerId),\n\t\t\t$$requestUuid: data.requestUuid,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\tinlineChatApplyEdit(data: { modelId: string | undefined; requestId: string | undefined; sessionId: string | undefined; languageId: string; extensionId: VersionedExtensionId | undefined }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineChat.applyEdits',\n\t\t\t$modelId: avoidPathRedaction(data.modelId),\n\t\t\t$extensionId: data.extensionId?.extensionId,\n\t\t\t$extensionVersion: data.extensionId?.version,\n\t\t\t$$sessionId: data.sessionId,\n\t\t\t$$requestId: data.requestId,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\treloadFromDisk: () => createEditSource({ source: 'reloadFromDisk' } as const),\n\n\tcursor(data: { kind: 'compositionType' | 'compositionEnd' | 'type' | 'paste' | 'cut' | 'executeCommands' | 'executeCommand'; detailedSource?: string | null }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'cursor',\n\t\t\tkind: data.kind,\n\t\t\tdetailedSource: data.detailedSource,\n\t\t} as const);\n\t},\n\n\tsetValue: () => createEditSource({ source: 'setValue' } as const),\n\teolChange: () => createEditSource({ source: 'eolChange' } as const),\n\tapplyEdits: () => createEditSource({ source: 'applyEdits' } as const),\n\tsnippet: () => createEditSource({ source: 'snippet' } as const),\n\tsuggest: (data: { providerId: ProviderId | undefined }) => createEditSource({ source: 'suggest', ...toProperties(data.providerId) } as const),\n\n\tcodeAction: (data: { kind: string | undefined; providerId: ProviderId | undefined }) => createEditSource({ source: 'codeAction', $kind: data.kind, ...toProperties(data.providerId) } as const)\n};\n\nfunction toProperties(version: ProviderId | undefined) {\n\tif (!version) {\n\t\treturn {};\n\t}\n\treturn {\n\t\t$extensionId: version.extensionId,\n\t\t$extensionVersion: version.extensionVersion,\n\t\t$providerId: version.providerId,\n\t};\n}\n\ntype Values<T> = T[keyof T];\nexport type ITextModelEditSourceMetadata = Values<{ [TKey in keyof typeof EditSources]: ReturnType<typeof EditSources[TKey]>['metadataT'] }>;\ntype ITextModelEditSourceMetadataKeys = Values<{ [TKey in keyof typeof EditSources]: keyof ReturnType<typeof EditSources[TKey]>['metadataT'] }>;\n\n\nfunction avoidPathRedaction(str: string | undefined): string | undefined {\n\tif (str === undefined) {\n\t\treturn undefined;\n\t}\n\t// To avoid false-positive file path redaction.\n\treturn str.replaceAll('/', '|');\n}\n\n\nexport class EditDeltaInfo {\n\tpublic static fromText(text: string): EditDeltaInfo {\n\t\tconst linesAdded = TextLength.ofText(text).lineCount;\n\t\tconst charsAdded = text.length;\n\t\treturn new EditDeltaInfo(linesAdded, 0, charsAdded, 0);\n\t}\n\n\tpublic static tryCreate(\n\t\tlinesAdded: number | undefined,\n\t\tlinesRemoved: number | undefined,\n\t\tcharsAdded: number | undefined,\n\t\tcharsRemoved: number | undefined\n\t): EditDeltaInfo | undefined {\n\t\tif (linesAdded === undefined || linesRemoved === undefined || charsAdded === undefined || charsRemoved === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new EditDeltaInfo(linesAdded, linesRemoved, charsAdded, charsRemoved);\n\t}\n\n\tconstructor(\n\t\tpublic readonly linesAdded: number,\n\t\tpublic readonly linesRemoved: number,\n\t\tpublic readonly charsAdded: number,\n\t\tpublic readonly charsRemoved: number\n\t) { }\n}\n\n\n/**\n * This is an opaque serializable type that represents a unique identity for an edit.\n */\nexport interface EditSuggestionId {\n}\n\nexport namespace EditSuggestionId {\n\t/**\n\t * Use AiEditTelemetryServiceImpl to create a new id!\n\t*/\n\texport function newId(genPrefixedUuid?: (ns: string) => string): EditSuggestionId {\n\t\tconst id = genPrefixedUuid ? genPrefixedUuid('sgt') : prefixedUuid('sgt');\n\t\treturn toEditIdentity(id);\n\t}\n}\n\nfunction toEditIdentity(id: string): EditSuggestionId {\n\treturn id as unknown as EditSuggestionId;\n}\n","\nimport { prefixedUuid } from '../../base/common/uuid.js';\nimport { TextLength } from './core/text/textLength.js';\nimport { ProviderId, VersionedExtensionId } from './languages.js';\n\nconst privateSymbol = Symbol('TextModelEditSource');\n\nexport class TextModelEditSource {\n\tconstructor(\n\t\tpublic readonly metadata: ITextModelEditSourceMetadata,\n\t\t_privateCtorGuard: typeof privateSymbol,\n\t) { }\n\n\tpublic toString(): string {\n\t\treturn `${this.metadata.source}`;\n\t}\n\n\tpublic getType(): string {\n\t\tconst metadata = this.metadata;\n\t\tswitch (metadata.source) {\n\t\t\tcase 'cursor':\n\t\t\t\treturn metadata.kind;\n\t\t\tcase 'inlineCompletionAccept':\n\t\t\t\treturn metadata.source + (metadata.$nes ? ':nes' : '');\n\t\t\tcase 'unknown':\n\t\t\t\treturn metadata.name || 'unknown';\n\t\t\tdefault:\n\t\t\t\treturn metadata.source;\n\t\t}\n\t}\n\n\t/**\n\t * Converts the metadata to a key string.\n\t * Only includes properties/values that have `level` many `$` prefixes or less.\n\t*/\n\tpublic toKey(level: number, filter: { [TKey in ITextModelEditSourceMetadataKeys]?: boolean } = {}): string {\n\t\tconst metadata = this.metadata;\n\t\tconst keys = Object.entries(metadata).filter(([key, value]) => {\n\t\t\tconst filterVal = (filter as Record<string, boolean>)[key];\n\t\t\tif (filterVal !== undefined) {\n\t\t\t\treturn filterVal;\n\t\t\t}\n\n\t\t\tconst prefixCount = (key.match(/\\$/g) || []).length;\n\t\t\treturn prefixCount <= level && value !== undefined && value !== null && value !== '';\n\t\t}).map(([key, value]) => `${key}:${value}`);\n\t\treturn keys.join('-');\n\t}\n}\n\ntype TextModelEditSourceT<T> = TextModelEditSource & {\n\tmetadataT: T;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createEditSource<T extends Record<string, any>>(metadata: T): TextModelEditSourceT<T> {\n\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\treturn new TextModelEditSource(metadata as any, privateSymbol) as any;\n}\n\nexport const EditSources = {\n\tunknown(data: { name?: string | null }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'unknown',\n\t\t\tname: data.name,\n\t\t} as const);\n\t},\n\n\trename: () => createEditSource({ source: 'rename' } as const),\n\n\tchatApplyEdits(data: {\n\t\tmodelId: string | undefined;\n\t\tsessionId: string | undefined;\n\t\trequestId: string | undefined;\n\t\tlanguageId: string;\n\t\tmode: string | undefined;\n\t\textensionId: VersionedExtensionId | undefined;\n\t\tcodeBlockSuggestionId: EditSuggestionId | undefined;\n\t}) {\n\t\treturn createEditSource({\n\t\t\tsource: 'Chat.applyEdits',\n\t\t\t$modelId: avoidPathRedaction(data.modelId),\n\t\t\t$extensionId: data.extensionId?.extensionId,\n\t\t\t$extensionVersion: data.extensionId?.version,\n\t\t\t$$languageId: data.languageId,\n\t\t\t$$sessionId: data.sessionId,\n\t\t\t$$requestId: data.requestId,\n\t\t\t$$mode: data.mode,\n\t\t\t$$codeBlockSuggestionId: data.codeBlockSuggestionId,\n\t\t} as const);\n\t},\n\n\tchatUndoEdits: () => createEditSource({ source: 'Chat.undoEdits' } as const),\n\tchatReset: () => createEditSource({ source: 'Chat.reset' } as const),\n\n\tinlineCompletionAccept(data: { nes: boolean; requestUuid: string; languageId: string; providerId?: ProviderId }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineCompletionAccept',\n\t\t\t$nes: data.nes,\n\t\t\t...toProperties(data.providerId),\n\t\t\t$$requestUuid: data.requestUuid,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\tinlineCompletionPartialAccept(data: { nes: boolean; requestUuid: string; languageId: string; providerId?: ProviderId; type: 'word' | 'line' }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineCompletionPartialAccept',\n\t\t\ttype: data.type,\n\t\t\t$nes: data.nes,\n\t\t\t...toProperties(data.providerId),\n\t\t\t$$requestUuid: data.requestUuid,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\tinlineChatApplyEdit(data: { modelId: string | undefined; requestId: string | undefined; sessionId: string | undefined; languageId: string; extensionId: VersionedExtensionId | undefined }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'inlineChat.applyEdits',\n\t\t\t$modelId: avoidPathRedaction(data.modelId),\n\t\t\t$extensionId: data.extensionId?.extensionId,\n\t\t\t$extensionVersion: data.extensionId?.version,\n\t\t\t$$sessionId: data.sessionId,\n\t\t\t$$requestId: data.requestId,\n\t\t\t$$languageId: data.languageId,\n\t\t} as const);\n\t},\n\n\treloadFromDisk: () => createEditSource({ source: 'reloadFromDisk' } as const),\n\n\tcursor(data: { kind: 'compositionType' | 'compositionEnd' | 'type' | 'paste' | 'cut' | 'executeCommands' | 'executeCommand'; detailedSource?: string | null }) {\n\t\treturn createEditSource({\n\t\t\tsource: 'cursor',\n\t\t\tkind: data.kind,\n\t\t\tdetailedSource: data.detailedSource,\n\t\t} as const);\n\t},\n\n\tsetValue: () => createEditSource({ source: 'setValue' } as const),\n\teolChange: () => createEditSource({ source: 'eolChange' } as const),\n\tapplyEdits: () => createEditSource({ source: 'applyEdits' } as const),\n\tsnippet: () => createEditSource({ source: 'snippet' } as const),\n\tsuggest: (data: { providerId: ProviderId | undefined }) => createEditSource({ source: 'suggest', ...toProperties(data.providerId) } as const),\n\n\tcodeAction: (data: { kind: string | undefined; providerId: ProviderId | undefined }) => createEditSource({ source: 'codeAction', $kind: data.kind, ...toProperties(data.providerId) } as const)\n};\n\nfunction toProperties(version: ProviderId | undefined) {\n\tif (!version) {\n\t\treturn {};\n\t}\n\treturn {\n\t\t$extensionId: version.extensionId,\n\t\t$extensionVersion: version.extensionVersion,\n\t\t$providerId: version.providerId,\n\t};\n}\n\ntype Values<T> = T[keyof T];\nexport type ITextModelEditSourceMetadata = Values<{ [TKey in keyof typeof EditSources]: ReturnType<typeof EditSources[TKey]>['metadataT'] }>;\ntype ITextModelEditSourceMetadataKeys = Values<{ [TKey in keyof typeof EditSources]: keyof ReturnType<typeof EditSources[TKey]>['metadataT'] }>;\n\n\nfunction avoidPathRedaction(str: string | undefined): string | undefined {\n\tif (str === undefined) {\n\t\treturn undefined;\n\t}\n\t// To avoid false-positive file path redaction.\n\treturn str.replaceAll('/', '|');\n}\n\n\nexport class EditDeltaInfo {\n\tpublic static fromText(text: string): EditDeltaInfo {\n\t\tconst linesAdded = TextLength.ofText(text).lineCount;\n\t\tconst charsAdded = text.length;\n\t\treturn new EditDeltaInfo(linesAdded, 0, charsAdded, 0);\n\t}\n\n\tpublic static tryCreate(\n\t\tlinesAdded: number | undefined,\n\t\tlinesRemoved: number | undefined,\n\t\tcharsAdded: number | undefined,\n\t\tcharsRemoved: number | undefined\n\t): EditDeltaInfo | undefined {\n\t\tif (linesAdded === undefined || linesRemoved === undefined || charsAdded === undefined || charsRemoved === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new EditDeltaInfo(linesAdded, linesRemoved, charsAdded, charsRemoved);\n\t}\n\n\tconstructor(\n\t\tpublic readonly linesAdded: number,\n\t\tpublic readonly linesRemoved: number,\n\t\tpublic readonly charsAdded: number,\n\t\tpublic readonly charsRemoved: number\n\t) { }\n}\n\n\n/**\n * This is an opaque serializable type that represents a unique identity for an edit.\n */\nexport interface EditSuggestionId {\n}\n\nexport namespace EditSuggestionId {\n\t/**\n\t * Use AiEditTelemetryServiceImpl to create a new id!\n\t*/\n\texport function newId(genPrefixedUuid?: (ns: string) => string): EditSuggestionId {\n\t\tconst id = genPrefixedUuid ? genPrefixedUuid('sgt') : prefixedUuid('sgt');\n\t\treturn toEditIdentity(id);\n\t}\n}\n\nfunction toEditIdentity(id: string): EditSuggestionId {\n\treturn id as unknown as EditSuggestionId;\n}\n"]}
|
|
@@ -925,7 +925,7 @@ function _renderLine(input, sb) {
|
|
|
925
925
|
}
|
|
926
926
|
if (isOverflowing) {
|
|
927
927
|
sb.appendString('<span class="mtkoverflow">');
|
|
928
|
-
sb.appendString(nls.localize(
|
|
928
|
+
sb.appendString(nls.localize(796, "Show more ({0})", renderOverflowingCharCount(overflowingCharCount)));
|
|
929
929
|
sb.appendString('</span>');
|
|
930
930
|
}
|
|
931
931
|
sb.appendString('</span>');
|
|
@@ -936,7 +936,7 @@ function to4CharHex(n) {
|
|
|
936
936
|
}
|
|
937
937
|
function renderOverflowingCharCount(n) {
|
|
938
938
|
if (n < 1024) {
|
|
939
|
-
return nls.localize(
|
|
939
|
+
return nls.localize(797, "{0} chars", n);
|
|
940
940
|
}
|
|
941
941
|
if (n < 1024 * 1024) {
|
|
942
942
|
return `${(n / 1024).toFixed(1)} KB`;
|
|
@@ -43,12 +43,12 @@ let SelectionAnchorController = class SelectionAnchorController {
|
|
|
43
43
|
this.decorationId = accessor.addDecoration(Selection.fromPositions(position, position), {
|
|
44
44
|
description: 'selection-anchor',
|
|
45
45
|
stickiness: 1 /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */,
|
|
46
|
-
hoverMessage: new MarkdownString().appendText(localize(
|
|
46
|
+
hoverMessage: new MarkdownString().appendText(localize(798, "Selection Anchor")),
|
|
47
47
|
className: 'selection-anchor'
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
this.selectionAnchorSetContextKey.set(!!this.decorationId);
|
|
51
|
-
alert(localize(
|
|
51
|
+
alert(localize(799, "Anchor set at {0}:{1}", position.lineNumber, position.column));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
goToSelectionAnchor() {
|
|
@@ -91,7 +91,7 @@ class SetSelectionAnchor extends EditorAction {
|
|
|
91
91
|
constructor() {
|
|
92
92
|
super({
|
|
93
93
|
id: 'editor.action.setSelectionAnchor',
|
|
94
|
-
label: localize2(
|
|
94
|
+
label: localize2(800, "Set Selection Anchor"),
|
|
95
95
|
precondition: undefined,
|
|
96
96
|
kbOpts: {
|
|
97
97
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -108,7 +108,7 @@ class GoToSelectionAnchor extends EditorAction {
|
|
|
108
108
|
constructor() {
|
|
109
109
|
super({
|
|
110
110
|
id: 'editor.action.goToSelectionAnchor',
|
|
111
|
-
label: localize2(
|
|
111
|
+
label: localize2(801, "Go to Selection Anchor"),
|
|
112
112
|
precondition: SelectionAnchorSet,
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -120,7 +120,7 @@ class SelectFromAnchorToCursor extends EditorAction {
|
|
|
120
120
|
constructor() {
|
|
121
121
|
super({
|
|
122
122
|
id: 'editor.action.selectFromAnchorToCursor',
|
|
123
|
-
label: localize2(
|
|
123
|
+
label: localize2(802, "Select from Anchor to Cursor"),
|
|
124
124
|
precondition: SelectionAnchorSet,
|
|
125
125
|
kbOpts: {
|
|
126
126
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -137,7 +137,7 @@ class CancelSelectionAnchor extends EditorAction {
|
|
|
137
137
|
constructor() {
|
|
138
138
|
super({
|
|
139
139
|
id: 'editor.action.cancelSelectionAnchor',
|
|
140
|
-
label: localize2(
|
|
140
|
+
label: localize2(803, "Cancel Selection Anchor"),
|
|
141
141
|
precondition: SelectionAnchorSet,
|
|
142
142
|
kbOpts: {
|
|
143
143
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -16,12 +16,12 @@ import * as nls from '../../../../nls.js';
|
|
|
16
16
|
import { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js';
|
|
17
17
|
import { registerColor } from '../../../../platform/theme/common/colorRegistry.js';
|
|
18
18
|
import { themeColorFromId } from '../../../../platform/theme/common/themeService.js';
|
|
19
|
-
const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', '#A0A0A0', nls.localize(
|
|
19
|
+
const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', '#A0A0A0', nls.localize(804, 'Overview ruler marker color for matching brackets.'));
|
|
20
20
|
class JumpToBracketAction extends EditorAction {
|
|
21
21
|
constructor() {
|
|
22
22
|
super({
|
|
23
23
|
id: 'editor.action.jumpToBracket',
|
|
24
|
-
label: nls.localize2(
|
|
24
|
+
label: nls.localize2(806, "Go to Bracket"),
|
|
25
25
|
precondition: undefined,
|
|
26
26
|
kbOpts: {
|
|
27
27
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -38,10 +38,10 @@ class SelectToBracketAction extends EditorAction {
|
|
|
38
38
|
constructor() {
|
|
39
39
|
super({
|
|
40
40
|
id: 'editor.action.selectToBracket',
|
|
41
|
-
label: nls.localize2(
|
|
41
|
+
label: nls.localize2(807, "Select to Bracket"),
|
|
42
42
|
precondition: undefined,
|
|
43
43
|
metadata: {
|
|
44
|
-
description: nls.localize2(
|
|
44
|
+
description: nls.localize2(808, "Select the text inside and including the brackets or curly braces"),
|
|
45
45
|
args: [{
|
|
46
46
|
name: 'args',
|
|
47
47
|
schema: {
|
|
@@ -69,7 +69,7 @@ class RemoveBracketsAction extends EditorAction {
|
|
|
69
69
|
constructor() {
|
|
70
70
|
super({
|
|
71
71
|
id: 'editor.action.removeBrackets',
|
|
72
|
-
label: nls.localize2(
|
|
72
|
+
label: nls.localize2(809, "Remove Brackets"),
|
|
73
73
|
precondition: undefined,
|
|
74
74
|
kbOpts: {
|
|
75
75
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -340,7 +340,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
|
340
340
|
group: '5_infile_nav',
|
|
341
341
|
command: {
|
|
342
342
|
id: 'editor.action.jumpToBracket',
|
|
343
|
-
title: nls.localize(
|
|
343
|
+
title: nls.localize(805, "Go to &&Bracket")
|
|
344
344
|
},
|
|
345
345
|
order: 2
|
|
346
346
|
});
|
|
@@ -29,7 +29,7 @@ class MoveCaretLeftAction extends MoveCaretAction {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
super(true, {
|
|
31
31
|
id: 'editor.action.moveCarretLeftAction',
|
|
32
|
-
label: nls.localize2(
|
|
32
|
+
label: nls.localize2(810, "Move Selected Text Left"),
|
|
33
33
|
precondition: EditorContextKeys.writable
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -38,7 +38,7 @@ class MoveCaretRightAction extends MoveCaretAction {
|
|
|
38
38
|
constructor() {
|
|
39
39
|
super(false, {
|
|
40
40
|
id: 'editor.action.moveCarretRightAction',
|
|
41
|
-
label: nls.localize2(
|
|
41
|
+
label: nls.localize2(811, "Move Selected Text Right"),
|
|
42
42
|
precondition: EditorContextKeys.writable
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -12,7 +12,7 @@ class TransposeLettersAction extends EditorAction {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super({
|
|
14
14
|
id: 'editor.action.transposeLetters',
|
|
15
|
-
label: nls.localize2(
|
|
15
|
+
label: nls.localize2(812, "Transpose Letters"),
|
|
16
16
|
precondition: EditorContextKeys.writable,
|
|
17
17
|
kbOpts: {
|
|
18
18
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -44,23 +44,23 @@ export const CutAction = supportsCut ? registerCommand(new MultiCommand({
|
|
|
44
44
|
menuOpts: [{
|
|
45
45
|
menuId: MenuId.MenubarEditMenu,
|
|
46
46
|
group: '2_ccp',
|
|
47
|
-
title: nls.localize(
|
|
47
|
+
title: nls.localize(813, "Cu&&t"),
|
|
48
48
|
order: 1
|
|
49
49
|
}, {
|
|
50
50
|
menuId: MenuId.EditorContext,
|
|
51
51
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
52
|
-
title: nls.localize(
|
|
52
|
+
title: nls.localize(814, "Cut"),
|
|
53
53
|
when: EditorContextKeys.writable,
|
|
54
54
|
order: 1,
|
|
55
55
|
}, {
|
|
56
56
|
menuId: MenuId.CommandPalette,
|
|
57
57
|
group: '',
|
|
58
|
-
title: nls.localize(
|
|
58
|
+
title: nls.localize(815, "Cut"),
|
|
59
59
|
order: 1
|
|
60
60
|
}, {
|
|
61
61
|
menuId: MenuId.SimpleEditorContext,
|
|
62
62
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
63
|
-
title: nls.localize(
|
|
63
|
+
title: nls.localize(816, "Cut"),
|
|
64
64
|
when: EditorContextKeys.writable,
|
|
65
65
|
order: 1,
|
|
66
66
|
}]
|
|
@@ -79,29 +79,29 @@ export const CopyAction = supportsCopy ? registerCommand(new MultiCommand({
|
|
|
79
79
|
menuOpts: [{
|
|
80
80
|
menuId: MenuId.MenubarEditMenu,
|
|
81
81
|
group: '2_ccp',
|
|
82
|
-
title: nls.localize(
|
|
82
|
+
title: nls.localize(817, "&&Copy"),
|
|
83
83
|
order: 2
|
|
84
84
|
}, {
|
|
85
85
|
menuId: MenuId.EditorContext,
|
|
86
86
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
87
|
-
title: nls.localize(
|
|
87
|
+
title: nls.localize(818, "Copy"),
|
|
88
88
|
order: 2,
|
|
89
89
|
}, {
|
|
90
90
|
menuId: MenuId.CommandPalette,
|
|
91
91
|
group: '',
|
|
92
|
-
title: nls.localize(
|
|
92
|
+
title: nls.localize(819, "Copy"),
|
|
93
93
|
order: 1
|
|
94
94
|
}, {
|
|
95
95
|
menuId: MenuId.SimpleEditorContext,
|
|
96
96
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
97
|
-
title: nls.localize(
|
|
97
|
+
title: nls.localize(820, "Copy"),
|
|
98
98
|
order: 2,
|
|
99
99
|
}]
|
|
100
100
|
})) : undefined;
|
|
101
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2(
|
|
102
|
-
MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2(
|
|
103
|
-
MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2(
|
|
104
|
-
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2(
|
|
101
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2(825, "Copy As"), group: '2_ccp', order: 3 });
|
|
102
|
+
MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2(826, "Copy As"), group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 });
|
|
103
|
+
MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2(827, "Share"), group: '11_share', order: -1, when: ContextKeyExpr.and(ContextKeyExpr.notEquals('resourceScheme', 'output'), EditorContextKeys.editorTextFocus) });
|
|
104
|
+
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2(828, "Share"), group: '11_share', order: -1 });
|
|
105
105
|
export const PasteAction = supportsPaste ? registerCommand(new MultiCommand({
|
|
106
106
|
id: 'editor.action.clipboardPasteAction',
|
|
107
107
|
precondition: undefined,
|
|
@@ -117,23 +117,23 @@ export const PasteAction = supportsPaste ? registerCommand(new MultiCommand({
|
|
|
117
117
|
menuOpts: [{
|
|
118
118
|
menuId: MenuId.MenubarEditMenu,
|
|
119
119
|
group: '2_ccp',
|
|
120
|
-
title: nls.localize(
|
|
120
|
+
title: nls.localize(821, "&&Paste"),
|
|
121
121
|
order: 4
|
|
122
122
|
}, {
|
|
123
123
|
menuId: MenuId.EditorContext,
|
|
124
124
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
125
|
-
title: nls.localize(
|
|
125
|
+
title: nls.localize(822, "Paste"),
|
|
126
126
|
when: EditorContextKeys.writable,
|
|
127
127
|
order: 4,
|
|
128
128
|
}, {
|
|
129
129
|
menuId: MenuId.CommandPalette,
|
|
130
130
|
group: '',
|
|
131
|
-
title: nls.localize(
|
|
131
|
+
title: nls.localize(823, "Paste"),
|
|
132
132
|
order: 1
|
|
133
133
|
}, {
|
|
134
134
|
menuId: MenuId.SimpleEditorContext,
|
|
135
135
|
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
|
136
|
-
title: nls.localize(
|
|
136
|
+
title: nls.localize(824, "Paste"),
|
|
137
137
|
when: EditorContextKeys.writable,
|
|
138
138
|
order: 4,
|
|
139
139
|
}]
|
|
@@ -142,7 +142,7 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction {
|
|
|
142
142
|
constructor() {
|
|
143
143
|
super({
|
|
144
144
|
id: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',
|
|
145
|
-
label: nls.localize2(
|
|
145
|
+
label: nls.localize2(829, "Copy with Syntax Highlighting"),
|
|
146
146
|
precondition: undefined,
|
|
147
147
|
kbOpts: {
|
|
148
148
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -252,7 +252,7 @@ export async function applyCodeAction(accessor, item, codeActionReason, options,
|
|
|
252
252
|
const message = asMessage(err);
|
|
253
253
|
notificationService.error(typeof message === 'string'
|
|
254
254
|
? message
|
|
255
|
-
: nls.localize(
|
|
255
|
+
: nls.localize(830, "An unknown error occurred while applying the code action"));
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
// ensure the start sound and end sound do not overlap
|
|
@@ -21,23 +21,23 @@ const argsSchema = {
|
|
|
21
21
|
properties: {
|
|
22
22
|
'kind': {
|
|
23
23
|
type: 'string',
|
|
24
|
-
description: nls.localize(
|
|
24
|
+
description: nls.localize(831, "Kind of the code action to run."),
|
|
25
25
|
},
|
|
26
26
|
'apply': {
|
|
27
27
|
type: 'string',
|
|
28
|
-
description: nls.localize(
|
|
28
|
+
description: nls.localize(832, "Controls when the returned actions are applied."),
|
|
29
29
|
default: "ifSingle" /* CodeActionAutoApply.IfSingle */,
|
|
30
30
|
enum: ["first" /* CodeActionAutoApply.First */, "ifSingle" /* CodeActionAutoApply.IfSingle */, "never" /* CodeActionAutoApply.Never */],
|
|
31
31
|
enumDescriptions: [
|
|
32
|
-
nls.localize(
|
|
33
|
-
nls.localize(
|
|
34
|
-
nls.localize(
|
|
32
|
+
nls.localize(833, "Always apply the first returned code action."),
|
|
33
|
+
nls.localize(834, "Apply the first returned code action if it is the only one."),
|
|
34
|
+
nls.localize(835, "Do not apply the returned code actions."),
|
|
35
35
|
]
|
|
36
36
|
},
|
|
37
37
|
'preferred': {
|
|
38
38
|
type: 'boolean',
|
|
39
39
|
default: false,
|
|
40
|
-
description: nls.localize(
|
|
40
|
+
description: nls.localize(836, "Controls if only preferred code actions should be returned."),
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
};
|
|
@@ -51,7 +51,7 @@ export class QuickFixAction extends EditorAction {
|
|
|
51
51
|
constructor() {
|
|
52
52
|
super({
|
|
53
53
|
id: quickFixCommandId,
|
|
54
|
-
label: nls.localize2(
|
|
54
|
+
label: nls.localize2(853, "Quick Fix..."),
|
|
55
55
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),
|
|
56
56
|
kbOpts: {
|
|
57
57
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -61,7 +61,7 @@ export class QuickFixAction extends EditorAction {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
run(_accessor, editor) {
|
|
64
|
-
return triggerCodeActionsForEditorSelection(editor, nls.localize(
|
|
64
|
+
return triggerCodeActionsForEditorSelection(editor, nls.localize(837, "No code actions available"), undefined, undefined, CodeActionTriggerSource.QuickFix);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
export class CodeActionCommand extends EditorCommand {
|
|
@@ -82,11 +82,11 @@ export class CodeActionCommand extends EditorCommand {
|
|
|
82
82
|
});
|
|
83
83
|
return triggerCodeActionsForEditorSelection(editor, typeof userArgs?.kind === 'string'
|
|
84
84
|
? args.preferred
|
|
85
|
-
? nls.localize(
|
|
86
|
-
: nls.localize(
|
|
85
|
+
? nls.localize(838, "No preferred code actions for '{0}' available", userArgs.kind)
|
|
86
|
+
: nls.localize(839, "No code actions for '{0}' available", userArgs.kind)
|
|
87
87
|
: args.preferred
|
|
88
|
-
? nls.localize(
|
|
89
|
-
: nls.localize(
|
|
88
|
+
? nls.localize(840, "No preferred code actions available")
|
|
89
|
+
: nls.localize(841, "No code actions available"), {
|
|
90
90
|
include: args.kind,
|
|
91
91
|
includeSourceActions: true,
|
|
92
92
|
onlyIncludePreferredActions: args.preferred,
|
|
@@ -97,7 +97,7 @@ export class RefactorAction extends EditorAction {
|
|
|
97
97
|
constructor() {
|
|
98
98
|
super({
|
|
99
99
|
id: refactorCommandId,
|
|
100
|
-
label: nls.localize2(
|
|
100
|
+
label: nls.localize2(854, "Refactor..."),
|
|
101
101
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),
|
|
102
102
|
kbOpts: {
|
|
103
103
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -125,11 +125,11 @@ export class RefactorAction extends EditorAction {
|
|
|
125
125
|
});
|
|
126
126
|
return triggerCodeActionsForEditorSelection(editor, typeof userArgs?.kind === 'string'
|
|
127
127
|
? args.preferred
|
|
128
|
-
? nls.localize(
|
|
129
|
-
: nls.localize(
|
|
128
|
+
? nls.localize(842, "No preferred refactorings for '{0}' available", userArgs.kind)
|
|
129
|
+
: nls.localize(843, "No refactorings for '{0}' available", userArgs.kind)
|
|
130
130
|
: args.preferred
|
|
131
|
-
? nls.localize(
|
|
132
|
-
: nls.localize(
|
|
131
|
+
? nls.localize(844, "No preferred refactorings available")
|
|
132
|
+
: nls.localize(845, "No refactorings available"), {
|
|
133
133
|
include: CodeActionKind.Refactor.contains(args.kind) ? args.kind : HierarchicalKind.None,
|
|
134
134
|
onlyIncludePreferredActions: args.preferred
|
|
135
135
|
}, args.apply, CodeActionTriggerSource.Refactor);
|
|
@@ -139,7 +139,7 @@ export class SourceAction extends EditorAction {
|
|
|
139
139
|
constructor() {
|
|
140
140
|
super({
|
|
141
141
|
id: sourceActionCommandId,
|
|
142
|
-
label: nls.localize2(
|
|
142
|
+
label: nls.localize2(855, "Source Action..."),
|
|
143
143
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),
|
|
144
144
|
contextMenuOpts: {
|
|
145
145
|
group: '1_modification',
|
|
@@ -159,11 +159,11 @@ export class SourceAction extends EditorAction {
|
|
|
159
159
|
});
|
|
160
160
|
return triggerCodeActionsForEditorSelection(editor, typeof userArgs?.kind === 'string'
|
|
161
161
|
? args.preferred
|
|
162
|
-
? nls.localize(
|
|
163
|
-
: nls.localize(
|
|
162
|
+
? nls.localize(846, "No preferred source actions for '{0}' available", userArgs.kind)
|
|
163
|
+
: nls.localize(847, "No source actions for '{0}' available", userArgs.kind)
|
|
164
164
|
: args.preferred
|
|
165
|
-
? nls.localize(
|
|
166
|
-
: nls.localize(
|
|
165
|
+
? nls.localize(848, "No preferred source actions available")
|
|
166
|
+
: nls.localize(849, "No source actions available"), {
|
|
167
167
|
include: CodeActionKind.Source.contains(args.kind) ? args.kind : HierarchicalKind.None,
|
|
168
168
|
includeSourceActions: true,
|
|
169
169
|
onlyIncludePreferredActions: args.preferred,
|
|
@@ -174,7 +174,7 @@ export class OrganizeImportsAction extends EditorAction {
|
|
|
174
174
|
constructor() {
|
|
175
175
|
super({
|
|
176
176
|
id: organizeImportsCommandId,
|
|
177
|
-
label: nls.localize2(
|
|
177
|
+
label: nls.localize2(856, "Organize Imports"),
|
|
178
178
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),
|
|
179
179
|
kbOpts: {
|
|
180
180
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -182,31 +182,31 @@ export class OrganizeImportsAction extends EditorAction {
|
|
|
182
182
|
weight: 100 /* KeybindingWeight.EditorContrib */
|
|
183
183
|
},
|
|
184
184
|
metadata: {
|
|
185
|
-
description: nls.localize2(
|
|
185
|
+
description: nls.localize2(857, "Organize imports in the current file. Also called 'Optimize Imports' by some tools")
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
run(_accessor, editor) {
|
|
190
|
-
return triggerCodeActionsForEditorSelection(editor, nls.localize(
|
|
190
|
+
return triggerCodeActionsForEditorSelection(editor, nls.localize(850, "No organize imports action available"), { include: CodeActionKind.SourceOrganizeImports, includeSourceActions: true }, "ifSingle" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.OrganizeImports);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
export class FixAllAction extends EditorAction {
|
|
194
194
|
constructor() {
|
|
195
195
|
super({
|
|
196
196
|
id: fixAllCommandId,
|
|
197
|
-
label: nls.localize2(
|
|
197
|
+
label: nls.localize2(858, "Fix All"),
|
|
198
198
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.SourceFixAll))
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
run(_accessor, editor) {
|
|
202
|
-
return triggerCodeActionsForEditorSelection(editor, nls.localize(
|
|
202
|
+
return triggerCodeActionsForEditorSelection(editor, nls.localize(851, "No fix all action available"), { include: CodeActionKind.SourceFixAll, includeSourceActions: true }, "ifSingle" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.FixAll);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
export class AutoFixAction extends EditorAction {
|
|
206
206
|
constructor() {
|
|
207
207
|
super({
|
|
208
208
|
id: autoFixCommandId,
|
|
209
|
-
label: nls.localize2(
|
|
209
|
+
label: nls.localize2(859, "Auto Fix..."),
|
|
210
210
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.QuickFix)),
|
|
211
211
|
kbOpts: {
|
|
212
212
|
kbExpr: EditorContextKeys.textInputFocus,
|
|
@@ -219,7 +219,7 @@ export class AutoFixAction extends EditorAction {
|
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
run(_accessor, editor) {
|
|
222
|
-
return triggerCodeActionsForEditorSelection(editor, nls.localize(
|
|
222
|
+
return triggerCodeActionsForEditorSelection(editor, nls.localize(852, "No auto fixes available"), {
|
|
223
223
|
include: CodeActionKind.QuickFix,
|
|
224
224
|
onlyIncludePreferredActions: true
|
|
225
225
|
}, "ifSingle" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.AutoFix);
|
|
@@ -25,7 +25,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
25
25
|
'editor.codeActionWidget.showHeaders': {
|
|
26
26
|
type: 'boolean',
|
|
27
27
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
28
|
-
description: nls.localize(
|
|
28
|
+
description: nls.localize(860, "Enable/disable showing group headers in the Code Action menu."),
|
|
29
29
|
default: true,
|
|
30
30
|
},
|
|
31
31
|
}
|
|
@@ -36,7 +36,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
36
36
|
'editor.codeActionWidget.includeNearbyQuickFixes': {
|
|
37
37
|
type: 'boolean',
|
|
38
38
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
39
|
-
description: nls.localize(
|
|
39
|
+
description: nls.localize(861, "Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),
|
|
40
40
|
default: true,
|
|
41
41
|
},
|
|
42
42
|
}
|
|
@@ -47,7 +47,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
47
47
|
'editor.codeActions.triggerOnFocusChange': {
|
|
48
48
|
type: 'boolean',
|
|
49
49
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
50
|
-
markdownDescription: nls.localize(
|
|
50
|
+
markdownDescription: nls.localize(862, 'Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.', '`#editor.codeActionsOnSave#`', '`#files.autoSave#`', '`afterDelay`', '`always`'),
|
|
51
51
|
default: false,
|
|
52
52
|
},
|
|
53
53
|
}
|
|
@@ -267,7 +267,7 @@ let CodeActionController = class CodeActionController extends Disposable {
|
|
|
267
267
|
const diagnostic = diagnostics[0];
|
|
268
268
|
if (diagnostic.startLineNumber && diagnostic.startColumn) {
|
|
269
269
|
const selectionText = this._editor.getModel()?.getWordAtPosition({ lineNumber: diagnostic.startLineNumber, column: diagnostic.startColumn })?.word;
|
|
270
|
-
aria.status(localize(
|
|
270
|
+
aria.status(localize(863, "Context: {0} at line {1} and column {2}.", selectionText, diagnostic.startLineNumber, diagnostic.startColumn));
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
}
|
|
@@ -310,7 +310,7 @@ let CodeActionController = class CodeActionController extends Disposable {
|
|
|
310
310
|
if (options.includeDisabledActions && actions.validActions.length > 0 && actions.allActions.length !== actions.validActions.length) {
|
|
311
311
|
resultActions.push(this._showDisabled ? {
|
|
312
312
|
id: 'hideMoreActions',
|
|
313
|
-
label: localize(
|
|
313
|
+
label: localize(864, 'Hide Disabled'),
|
|
314
314
|
enabled: true,
|
|
315
315
|
tooltip: '',
|
|
316
316
|
class: undefined,
|
|
@@ -320,7 +320,7 @@ let CodeActionController = class CodeActionController extends Disposable {
|
|
|
320
320
|
}
|
|
321
321
|
} : {
|
|
322
322
|
id: 'showMoreActions',
|
|
323
|
-
label: localize(
|
|
323
|
+
label: localize(865, 'Show Disabled'),
|
|
324
324
|
enabled: true,
|
|
325
325
|
tooltip: '',
|
|
326
326
|
class: undefined,
|
|
@@ -8,15 +8,15 @@ import { CodeActionKind } from '../common/types.js';
|
|
|
8
8
|
import '../../symbolIcons/browser/symbolIcons.js'; // The codicon symbol colors are defined here and must be loaded to get colors
|
|
9
9
|
import { localize } from '../../../../nls.js';
|
|
10
10
|
import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';
|
|
11
|
-
const uncategorizedCodeActionGroup = Object.freeze({ kind: HierarchicalKind.Empty, title: localize(
|
|
11
|
+
const uncategorizedCodeActionGroup = Object.freeze({ kind: HierarchicalKind.Empty, title: localize(866, 'More Actions...') });
|
|
12
12
|
const codeActionGroups = Object.freeze([
|
|
13
|
-
{ kind: CodeActionKind.QuickFix, title: localize(
|
|
14
|
-
{ kind: CodeActionKind.RefactorExtract, title: localize(
|
|
15
|
-
{ kind: CodeActionKind.RefactorInline, title: localize(
|
|
16
|
-
{ kind: CodeActionKind.RefactorRewrite, title: localize(
|
|
17
|
-
{ kind: CodeActionKind.RefactorMove, title: localize(
|
|
18
|
-
{ kind: CodeActionKind.SurroundWith, title: localize(
|
|
19
|
-
{ kind: CodeActionKind.Source, title: localize(
|
|
13
|
+
{ kind: CodeActionKind.QuickFix, title: localize(867, 'Quick Fix') },
|
|
14
|
+
{ kind: CodeActionKind.RefactorExtract, title: localize(868, 'Extract'), icon: Codicon.wrench },
|
|
15
|
+
{ kind: CodeActionKind.RefactorInline, title: localize(869, 'Inline'), icon: Codicon.wrench },
|
|
16
|
+
{ kind: CodeActionKind.RefactorRewrite, title: localize(870, 'Rewrite'), icon: Codicon.wrench },
|
|
17
|
+
{ kind: CodeActionKind.RefactorMove, title: localize(871, 'Move'), icon: Codicon.wrench },
|
|
18
|
+
{ kind: CodeActionKind.SurroundWith, title: localize(872, 'Surround With'), icon: Codicon.surroundWith },
|
|
19
|
+
{ kind: CodeActionKind.Source, title: localize(873, 'Source Action'), icon: Codicon.symbolFile },
|
|
20
20
|
uncategorizedCodeActionGroup,
|
|
21
21
|
]);
|
|
22
22
|
export function toMenuItems(inputCodeActions, showHeaders, keybindingResolver) {
|