monaco-editor-core 0.56.0-dev-20260121 → 0.56.0-dev-20260123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +6 -2
  18. package/esm/vs/base/browser/markdownRenderer.js +0 -1
  19. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  20. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  21. package/esm/vs/base/browser/ui/tree/abstractTree.js +15 -1
  22. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  23. package/esm/vs/base/common/actions.js +1 -1
  24. package/esm/vs/base/common/codiconsLibrary.js +2 -0
  25. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  26. package/esm/vs/base/common/errorMessage.js +6 -6
  27. package/esm/vs/base/common/keybindingLabels.js +20 -20
  28. package/esm/vs/base/common/network.js +0 -2
  29. package/esm/vs/base/common/network.js.map +1 -1
  30. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +10 -4
  31. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
  32. package/esm/vs/base/common/policy.js +5 -5
  33. package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
  34. package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
  35. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
  36. package/esm/vs/editor/browser/coreCommands.js +3 -3
  37. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  38. package/esm/vs/editor/browser/editorExtensions.js +9 -9
  39. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  40. package/esm/vs/editor/browser/observableCodeEditor.js +41 -0
  41. package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
  42. package/esm/vs/editor/browser/services/inlineCompletionsService.js +4 -4
  43. package/esm/vs/editor/browser/services/renameSymbolTrackerService.js +15 -0
  44. package/esm/vs/editor/browser/services/renameSymbolTrackerService.js.map +1 -0
  45. package/esm/vs/editor/browser/view.js +3 -0
  46. package/esm/vs/editor/browser/view.js.map +1 -1
  47. package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js +14 -0
  48. package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
  49. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +7 -0
  50. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
  51. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +8 -2
  52. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  53. package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
  54. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
  55. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js.map +1 -1
  56. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  57. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +7 -7
  58. package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
  59. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
  60. package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
  61. package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
  62. package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
  63. package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
  64. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
  65. package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +2 -41
  66. package/esm/vs/editor/common/config/editorConfigurationSchema.js +55 -55
  67. package/esm/vs/editor/common/config/editorOptions.js +410 -410
  68. package/esm/vs/editor/common/core/editorColorRegistry.js +70 -70
  69. package/esm/vs/editor/common/editorContextKeys.js +48 -48
  70. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  71. package/esm/vs/editor/common/languages.js +56 -56
  72. package/esm/vs/editor/common/model/editStack.js +1 -1
  73. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  74. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  75. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  76. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  77. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  78. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  79. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
  80. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  81. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +44 -34
  82. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js.map +1 -1
  83. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +5 -4
  84. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js.map +1 -1
  85. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  86. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  87. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  88. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  89. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  90. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  91. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  92. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  93. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  94. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  95. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  96. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  97. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
  98. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  99. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  100. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  101. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  102. package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
  103. package/esm/vs/editor/contrib/find/browser/findWidget.css +5 -6
  104. package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
  105. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +2 -1
  106. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +54 -45
  107. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js.map +1 -1
  108. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  109. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  110. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  111. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  112. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  113. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  114. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  115. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  116. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  117. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  118. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  119. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  120. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  121. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  122. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  123. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  124. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  125. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  126. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +7 -7
  127. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  128. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  129. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  130. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  131. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
  132. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
  133. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
  134. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  135. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +4 -4
  136. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +107 -18
  137. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
  138. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  139. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  140. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  141. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
  142. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  143. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +2 -8
  144. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  145. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  146. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  147. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
  148. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  149. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  150. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  151. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  152. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  153. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  154. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  155. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  156. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +10 -10
  157. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  158. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  159. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  160. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  161. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  162. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  163. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  164. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  165. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  166. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
  167. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
  168. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  169. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  170. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  171. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  172. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  173. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  174. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  175. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  176. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  177. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  178. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  179. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
  180. package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +2 -1
  181. package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -1
  182. package/esm/vs/editor/standalone/browser/standaloneServices.js +2 -0
  183. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  184. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  185. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  186. package/esm/vs/platform/actionWidget/browser/actionList.js +34 -11
  187. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  188. package/esm/vs/platform/actionWidget/browser/actionWidget.css +10 -0
  189. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  190. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +3 -3
  191. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  192. package/esm/vs/platform/actions/common/actions.js +2 -0
  193. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  194. package/esm/vs/platform/actions/common/menuService.js +2 -2
  195. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  196. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  197. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  198. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  199. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  200. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  201. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  202. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  203. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  204. package/esm/vs/platform/list/browser/listService.js +27 -27
  205. package/esm/vs/platform/markers/common/markerService.js +2 -2
  206. package/esm/vs/platform/markers/common/markers.js +6 -6
  207. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  208. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  209. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  210. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  211. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  212. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  213. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  214. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  215. package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  216. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  217. package/esm/vs/platform/theme/common/colors/baseColors.js +18 -18
  218. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  219. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  220. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  221. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  222. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  223. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  224. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  225. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  226. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  227. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  228. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  229. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  230. package/package.json +2 -2
@@ -10,63 +10,63 @@ import { buttonBackground, buttonForeground, buttonSecondaryBackground, buttonSe
10
10
  import { asCssVariable, darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';
11
11
  import { InlineCompletionEditorType } from '../../model/provideInlineCompletions.js';
12
12
  import { InlineEditTabAction } from './inlineEditsViewInterface.js';
13
- export const originalBackgroundColor = registerColor('inlineEdit.originalBackground', transparent(diffRemoved, 0.2), localize(1233, 'Background color for the original text in inline edits.'), true);
14
- export const modifiedBackgroundColor = registerColor('inlineEdit.modifiedBackground', transparent(diffInserted, 0.3), localize(1234, 'Background color for the modified text in inline edits.'), true);
15
- export const originalChangedLineBackgroundColor = registerColor('inlineEdit.originalChangedLineBackground', transparent(diffRemoved, 0.8), localize(1235, 'Background color for the changed lines in the original text of inline edits.'), true);
16
- export const originalChangedTextOverlayColor = registerColor('inlineEdit.originalChangedTextBackground', transparent(diffRemoved, 0.8), localize(1236, 'Overlay color for the changed text in the original text of inline edits.'), true);
13
+ export const originalBackgroundColor = registerColor('inlineEdit.originalBackground', transparent(diffRemoved, 0.2), localize(1235, 'Background color for the original text in inline edits.'), true);
14
+ export const modifiedBackgroundColor = registerColor('inlineEdit.modifiedBackground', transparent(diffInserted, 0.3), localize(1236, 'Background color for the modified text in inline edits.'), true);
15
+ export const originalChangedLineBackgroundColor = registerColor('inlineEdit.originalChangedLineBackground', transparent(diffRemoved, 0.8), localize(1237, 'Background color for the changed lines in the original text of inline edits.'), true);
16
+ export const originalChangedTextOverlayColor = registerColor('inlineEdit.originalChangedTextBackground', transparent(diffRemoved, 0.8), localize(1238, 'Overlay color for the changed text in the original text of inline edits.'), true);
17
17
  export const modifiedChangedLineBackgroundColor = registerColor('inlineEdit.modifiedChangedLineBackground', {
18
18
  light: transparent(diffInsertedLine, 0.7),
19
19
  dark: transparent(diffInsertedLine, 0.7),
20
20
  hcDark: diffInsertedLine,
21
21
  hcLight: diffInsertedLine
22
- }, localize(1237, 'Background color for the changed lines in the modified text of inline edits.'), true);
23
- export const modifiedChangedTextOverlayColor = registerColor('inlineEdit.modifiedChangedTextBackground', transparent(diffInserted, 0.7), localize(1238, 'Overlay color for the changed text in the modified text of inline edits.'), true);
22
+ }, localize(1239, 'Background color for the changed lines in the modified text of inline edits.'), true);
23
+ export const modifiedChangedTextOverlayColor = registerColor('inlineEdit.modifiedChangedTextBackground', transparent(diffInserted, 0.7), localize(1240, 'Overlay color for the changed text in the modified text of inline edits.'), true);
24
24
  // ------- GUTTER INDICATOR -------
25
- export const inlineEditIndicatorPrimaryForeground = registerColor('inlineEdit.gutterIndicator.primaryForeground', buttonForeground, localize(1239, 'Foreground color for the primary inline edit gutter indicator.'));
26
- export const inlineEditIndicatorPrimaryBorder = registerColor('inlineEdit.gutterIndicator.primaryBorder', buttonBackground, localize(1240, 'Border color for the primary inline edit gutter indicator.'));
25
+ export const inlineEditIndicatorPrimaryForeground = registerColor('inlineEdit.gutterIndicator.primaryForeground', buttonForeground, localize(1241, 'Foreground color for the primary inline edit gutter indicator.'));
26
+ export const inlineEditIndicatorPrimaryBorder = registerColor('inlineEdit.gutterIndicator.primaryBorder', buttonBackground, localize(1242, 'Border color for the primary inline edit gutter indicator.'));
27
27
  export const inlineEditIndicatorPrimaryBackground = registerColor('inlineEdit.gutterIndicator.primaryBackground', {
28
28
  light: transparent(inlineEditIndicatorPrimaryBorder, 0.5),
29
29
  dark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),
30
30
  hcDark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),
31
31
  hcLight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),
32
- }, localize(1241, 'Background color for the primary inline edit gutter indicator.'));
33
- export const inlineEditIndicatorSecondaryForeground = registerColor('inlineEdit.gutterIndicator.secondaryForeground', buttonSecondaryForeground, localize(1242, 'Foreground color for the secondary inline edit gutter indicator.'));
34
- export const inlineEditIndicatorSecondaryBorder = registerColor('inlineEdit.gutterIndicator.secondaryBorder', buttonSecondaryBackground, localize(1243, 'Border color for the secondary inline edit gutter indicator.'));
35
- export const inlineEditIndicatorSecondaryBackground = registerColor('inlineEdit.gutterIndicator.secondaryBackground', inlineEditIndicatorSecondaryBorder, localize(1244, 'Background color for the secondary inline edit gutter indicator.'));
36
- export const inlineEditIndicatorSuccessfulForeground = registerColor('inlineEdit.gutterIndicator.successfulForeground', buttonForeground, localize(1245, 'Foreground color for the successful inline edit gutter indicator.'));
37
- export const inlineEditIndicatorSuccessfulBorder = registerColor('inlineEdit.gutterIndicator.successfulBorder', buttonBackground, localize(1246, 'Border color for the successful inline edit gutter indicator.'));
38
- export const inlineEditIndicatorSuccessfulBackground = registerColor('inlineEdit.gutterIndicator.successfulBackground', inlineEditIndicatorSuccessfulBorder, localize(1247, 'Background color for the successful inline edit gutter indicator.'));
32
+ }, localize(1243, 'Background color for the primary inline edit gutter indicator.'));
33
+ export const inlineEditIndicatorSecondaryForeground = registerColor('inlineEdit.gutterIndicator.secondaryForeground', buttonSecondaryForeground, localize(1244, 'Foreground color for the secondary inline edit gutter indicator.'));
34
+ export const inlineEditIndicatorSecondaryBorder = registerColor('inlineEdit.gutterIndicator.secondaryBorder', buttonSecondaryBackground, localize(1245, 'Border color for the secondary inline edit gutter indicator.'));
35
+ export const inlineEditIndicatorSecondaryBackground = registerColor('inlineEdit.gutterIndicator.secondaryBackground', inlineEditIndicatorSecondaryBorder, localize(1246, 'Background color for the secondary inline edit gutter indicator.'));
36
+ export const inlineEditIndicatorSuccessfulForeground = registerColor('inlineEdit.gutterIndicator.successfulForeground', buttonForeground, localize(1247, 'Foreground color for the successful inline edit gutter indicator.'));
37
+ export const inlineEditIndicatorSuccessfulBorder = registerColor('inlineEdit.gutterIndicator.successfulBorder', buttonBackground, localize(1248, 'Border color for the successful inline edit gutter indicator.'));
38
+ export const inlineEditIndicatorSuccessfulBackground = registerColor('inlineEdit.gutterIndicator.successfulBackground', inlineEditIndicatorSuccessfulBorder, localize(1249, 'Background color for the successful inline edit gutter indicator.'));
39
39
  export const inlineEditIndicatorBackground = registerColor('inlineEdit.gutterIndicator.background', {
40
40
  hcDark: transparent('tab.inactiveBackground', 0.5),
41
41
  hcLight: transparent('tab.inactiveBackground', 0.5),
42
42
  dark: transparent('tab.inactiveBackground', 0.5),
43
43
  light: '#5f5f5f18',
44
- }, localize(1248, 'Background color for the inline edit gutter indicator.'));
44
+ }, localize(1250, 'Background color for the inline edit gutter indicator.'));
45
45
  // ------- BORDER COLORS -------
46
46
  const originalBorder = registerColor('inlineEdit.originalBorder', {
47
47
  light: diffRemoved,
48
48
  dark: diffRemoved,
49
49
  hcDark: diffRemoved,
50
50
  hcLight: diffRemoved
51
- }, localize(1249, 'Border color for the original text in inline edits.'));
51
+ }, localize(1251, 'Border color for the original text in inline edits.'));
52
52
  const modifiedBorder = registerColor('inlineEdit.modifiedBorder', {
53
53
  light: darken(diffInserted, 0.6),
54
54
  dark: diffInserted,
55
55
  hcDark: diffInserted,
56
56
  hcLight: diffInserted
57
- }, localize(1250, 'Border color for the modified text in inline edits.'));
57
+ }, localize(1252, 'Border color for the modified text in inline edits.'));
58
58
  const tabWillAcceptModifiedBorder = registerColor('inlineEdit.tabWillAcceptModifiedBorder', {
59
59
  light: darken(modifiedBorder, 0),
60
60
  dark: darken(modifiedBorder, 0),
61
61
  hcDark: darken(modifiedBorder, 0),
62
62
  hcLight: darken(modifiedBorder, 0)
63
- }, localize(1251, 'Modified border color for the inline edits widget when tab will accept it.'));
63
+ }, localize(1253, 'Modified border color for the inline edits widget when tab will accept it.'));
64
64
  const tabWillAcceptOriginalBorder = registerColor('inlineEdit.tabWillAcceptOriginalBorder', {
65
65
  light: darken(originalBorder, 0),
66
66
  dark: darken(originalBorder, 0),
67
67
  hcDark: darken(originalBorder, 0),
68
68
  hcLight: darken(originalBorder, 0)
69
- }, localize(1252, 'Original border color for the inline edits widget over the original text when tab will accept it.'));
69
+ }, localize(1254, 'Original border color for the inline edits widget over the original text when tab will accept it.'));
70
70
  export function getModifiedBorderColor(tabAction) {
71
71
  return tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder);
72
72
  }
@@ -16,16 +16,13 @@ import { Size2D } from '../../../../../../common/core/2d/size.js';
16
16
  * Warning: might return 0.
17
17
  */
18
18
  export function maxContentWidthInRange(editor, range, reader) {
19
- editor.layoutInfo.read(reader);
20
- editor.value.read(reader);
21
19
  const model = editor.model.read(reader);
22
20
  if (!model) {
23
21
  return 0;
24
22
  }
25
23
  let maxContentWidth = 0;
26
- editor.scrollTop.read(reader);
27
24
  for (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {
28
- const lineContentWidth = editor.editor.getWidthOfLine(i);
25
+ const lineContentWidth = editor.getWidthOfLine(i, reader);
29
26
  maxContentWidth = Math.max(maxContentWidth, lineContentWidth);
30
27
  }
31
28
  const lines = range.mapToLineArray(l => model.getLineContent(l));
@@ -35,17 +32,14 @@ export function maxContentWidthInRange(editor, range, reader) {
35
32
  return maxContentWidth;
36
33
  }
37
34
  export function getContentSizeOfLines(editor, range, reader) {
38
- editor.layoutInfo.read(reader);
39
- editor.value.read(reader);
40
35
  observableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);
41
36
  const model = editor.model.read(reader);
42
37
  if (!model) {
43
38
  throw new BugIndicatingError('Model is required');
44
39
  }
45
40
  const sizes = [];
46
- editor.scrollTop.read(reader);
47
41
  for (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {
48
- let lineContentWidth = editor.editor.getWidthOfLine(i);
42
+ let lineContentWidth = editor.getWidthOfLine(i, reader);
49
43
  if (lineContentWidth === -1) {
50
44
  // approximation
51
45
  const column = model.getLineMaxColumn(i);
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAwB,yBAAyB,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACnM,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAwB,MAAM,mDAAmD,CAAC;AAE/G,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAGhE,OAAO,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AAC;gBACV,OAAO,SAAS,CAAC;YAClB,CAAC;YACD,OAAO,GAAG,CAAC,KAAK,CAAC;QAClB,CAAC,EAAE,aAAa,CAAC;QACjB,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE,EAAE,MAAM,CAAC,EAAE;YAChE,0BAA0B;YAC1B,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;YACvB,IAAI,CAAC,GAAG,EAAE,CAAC;gBACV,OAAO,SAAS,CAAC;YAClB,CAAC;YACD,OAAO,GAAG,CAAC,MAAM,CAAC;QACnB,CAAC,EAAE,aAAa,CAAC;KACjB,CAAC;AACH,CAAC;AAKD,MAAM,UAAU,+BAA+B,CAAC,MAAmB,EAAE,KAAsB;IAC1F,MAAM,GAAG,GAAG,MAAM,CAAC,mBAAmB,EAAG,CAAC;IAC1C,MAAM,cAAc,GAAG,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC/E,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;QACtC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,cAAc,CAAC;AACvB,CAAC","file":"utils.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { numberComparator } from '../../../../../../../base/common/arrays.js';\nimport { findFirstMin } from '../../../../../../../base/common/arraysFind.js';\nimport { DisposableStore } from '../../../../../../../base/common/lifecycle.js';\nimport { DebugLocation, derived, derivedObservableWithCache, derivedOpts, IObservable, IReader, observableSignalFromEvent, observableValue } from '../../../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor, ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../../common/core/edits/textEdit.js';\nimport { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { indentOfLine } from '../../../../../../common/model/textModel.js';\nimport { CharCode } from '../../../../../../../base/common/charCode.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Size2D } from '../../../../../../common/core/2d/size.js';\n\n/**\n * Warning: might return 0.\n*/\nexport function maxContentWidthInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\tlet maxContentWidth = 0;\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst lineContentWidth = editor.editor.getWidthOfLine(i);\n\t\tmaxContentWidth = Math.max(maxContentWidth, lineContentWidth);\n\t}\n\tconst lines = range.mapToLineArray(l => model.getLineContent(l));\n\n\tif (maxContentWidth < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {\n\t\tconsole.error('unexpected width');\n\t}\n\treturn maxContentWidth;\n}\n\nexport function getContentSizeOfLines(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): Size2D[] {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\tobservableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { throw new BugIndicatingError('Model is required'); }\n\n\tconst sizes: Size2D[] = [];\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tlet lineContentWidth = editor.editor.getWidthOfLine(i);\n\t\tif (lineContentWidth === -1) {\n\t\t\t// approximation\n\t\t\tconst column = model.getLineMaxColumn(i);\n\t\t\tconst typicalHalfwidthCharacterWidth = editor.editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst approximation = column * typicalHalfwidthCharacterWidth;\n\t\t\tlineContentWidth = approximation;\n\t\t}\n\n\t\tconst height = editor.editor.getLineHeightForPosition(new Position(i, 1));\n\t\tsizes.push(new Size2D(lineContentWidth, height));\n\t}\n\n\treturn sizes;\n}\n\nexport function getOffsetForPos(editor: ObservableCodeEditor, pos: Position, reader: IReader): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\n\teditor.scrollTop.read(reader);\n\tconst lineContentWidth = editor.editor.getOffsetForColumn(pos.lineNumber, pos.column);\n\n\treturn lineContentWidth;\n}\n\nexport function getPrefixTrim(diffRanges: Range[], originalLinesRange: LineRange, modifiedLines: string[], editor: ICodeEditor, reader: IReader | undefined = undefined): { prefixTrim: number; prefixLeftOffset: number } {\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\tconst replacementStart = diffRanges.map(r => r.isSingleLine() ? r.startColumn - 1 : 0);\n\tconst originalIndents = originalLinesRange.mapToLineArray(line => indentOfLine(textModel.getLineContent(line)));\n\tconst modifiedIndents = modifiedLines.filter(line => line !== '').map(line => indentOfLine(line));\n\tconst prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents);\n\n\tlet prefixLeftOffset;\n\tconst startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber);\n\tif (startLineIndent >= prefixTrim + 1) {\n\t\t// We can use the editor to get the offset\n\t\t// TODO go through other usages of getOffsetForColumn and come up with a robust reactive solution to read it\n\t\tobservableCodeEditor(editor).scrollTop.read(reader); // getOffsetForColumn requires the line number to be visible. This might change on scroll top.\n\t\tprefixLeftOffset = editor.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1);\n\t} else if (modifiedLines.length > 0) {\n\t\t// Content is not in the editor, we can use the content width to calculate the offset\n\t\tprefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor, textModel);\n\t} else {\n\t\t// unable to approximate the offset\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\treturn { prefixTrim, prefixLeftOffset };\n}\n\nexport function getContentRenderWidth(content: string, editor: ICodeEditor, textModel: ITextModel) {\n\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\tconst tabSize = textModel.getOptions().tabSize * w;\n\n\tconst numTabs = content.split('\\t').length - 1;\n\tconst numNoneTabs = content.length - numTabs;\n\treturn numNoneTabs * w + numTabs * tabSize;\n}\n\nexport function getEditorValidOverlayRect(editor: ObservableCodeEditor): IObservable<Rect> {\n\tconst contentLeft = editor.layoutInfoContentLeft;\n\n\tconst width = derived({ name: 'editor.validOverlay.width' }, r => {\n\t\tconst hasMinimapOnTheRight = editor.layoutInfoMinimap.read(r).minimapLeft !== 0;\n\t\tconst editorWidth = editor.layoutInfoWidth.read(r) - contentLeft.read(r);\n\n\t\tif (hasMinimapOnTheRight) {\n\t\t\tconst minimapAndScrollbarWidth = editor.layoutInfoMinimap.read(r).minimapWidth + editor.layoutInfoVerticalScrollbarWidth.read(r);\n\t\t\treturn editorWidth - minimapAndScrollbarWidth;\n\t\t}\n\n\t\treturn editorWidth;\n\t});\n\n\tconst height = derived({ name: 'editor.validOverlay.height' }, r => editor.layoutInfoHeight.read(r) + editor.contentHeight.read(r));\n\n\treturn derived({ name: 'editor.validOverlay' }, r => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width.read(r), height.read(r)));\n}\nexport function applyEditToModifiedRangeMappings(rangeMapping: RangeMapping[], edit: TextEdit): RangeMapping[] {\n\tconst updatedMappings: RangeMapping[] = [];\n\tfor (const m of rangeMapping) {\n\t\tconst updatedRange = edit.mapRange(m.modifiedRange);\n\t\tupdatedMappings.push(new RangeMapping(m.originalRange, updatedRange));\n\t}\n\treturn updatedMappings;\n}\n\n\nexport function classNames(...classes: (string | false | undefined | null)[]) {\n\treturn classes.filter(c => typeof c === 'string').join(' ');\n}\n\nfunction offsetRangeToRange(columnOffsetRange: OffsetRange, startPos: Position): Range {\n\treturn new Range(\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.start,\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.endExclusive,\n\t);\n}\n\n/**\n * Calculates the indentation size (in spaces) of a given line,\n * interpreting tabs as the specified tab size.\n */\nfunction getIndentationSize(line: string, tabSize: number): number {\n\tlet currentSize = 0;\n\tloop: for (let i = 0, len = line.length; i < len; i++) {\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: currentSize += tabSize; break;\n\t\t\tcase CharCode.Space: currentSize++; break;\n\t\t\tdefault: break loop;\n\t\t}\n\t}\n\t// if currentSize % tabSize !== 0,\n\t// then there are spaces which are not part of the indentation\n\treturn currentSize - (currentSize % tabSize);\n}\n\n/**\n * Calculates the number of characters at the start of a line that correspond to a given indentation size,\n * taking into account both tabs and spaces.\n */\nfunction indentSizeToIndentLength(line: string, indentSize: number, tabSize: number): number {\n\tlet remainingSize = indentSize - (indentSize % tabSize);\n\tlet i = 0;\n\tfor (; i < line.length; i++) {\n\t\tif (remainingSize === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: remainingSize -= tabSize; break;\n\t\t\tcase CharCode.Space: remainingSize--; break;\n\t\t\tdefault: throw new BugIndicatingError('Unexpected character found while calculating indent length');\n\t\t}\n\t}\n\treturn i;\n}\n\nexport function createReindentEdit(text: string, range: LineRange, tabSize: number): TextEdit {\n\tconst newLines = splitLines(text);\n\tconst edits: TextReplacement[] = [];\n\tconst minIndentSize = findFirstMin(range.mapToLineArray(l => getIndentationSize(newLines[l - 1], tabSize)), numberComparator)!;\n\trange.forEach(lineNumber => {\n\t\tconst indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize);\n\t\tedits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), ''));\n\t});\n\treturn new TextEdit(edits);\n}\n\nexport class PathBuilder {\n\tprivate _data: string = '';\n\n\tpublic moveTo(point: Point): this {\n\t\tthis._data += `M ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic lineTo(point: Point): this {\n\t\tthis._data += `L ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._data;\n\t}\n}\n\ntype RemoveFalsy<T> = T extends false | undefined | null ? never : T;\ntype Falsy<T> = T extends false | undefined | null ? T : never;\n\nexport function mapOutFalsy<T>(obs: IObservable<T>): IObservable<IObservable<RemoveFalsy<T>> | Falsy<T>> {\n\tconst nonUndefinedObs = derivedObservableWithCache<T | undefined | null | false>(undefined, (reader, lastValue) => obs.read(reader) || lastValue);\n\n\treturn derivedOpts({\n\t\tdebugName: () => `${obs.debugName}.mapOutFalsy`\n\t}, reader => {\n\t\tnonUndefinedObs.read(reader);\n\t\tconst val = obs.read(reader);\n\t\tif (!val) {\n\t\t\treturn undefined as Falsy<T>;\n\t\t}\n\n\t\treturn nonUndefinedObs as IObservable<RemoveFalsy<T>>;\n\t});\n}\n\nexport function rectToProps(fn: (reader: IReader) => Rect | undefined, debugLocation: DebugLocation = DebugLocation.ofCaller()) {\n\treturn {\n\t\tleft: derived({ name: 'editor.validOverlay.left' }, reader => /** @description left */ fn(reader)?.left, debugLocation),\n\t\ttop: derived({ name: 'editor.validOverlay.top' }, reader => /** @description top */ fn(reader)?.top, debugLocation),\n\t\twidth: derived({ name: 'editor.validOverlay.width' }, reader => {\n\t\t\t/** @description width */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.width;\n\t\t}, debugLocation),\n\t\theight: derived({ name: 'editor.validOverlay.height' }, reader => {\n\t\t\t/** @description height */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.height;\n\t\t}, debugLocation),\n\t};\n}\n\nexport type FirstFnArg<T> = T extends (arg: infer U) => any ? U : never;\n\n\nexport function observeEditorBoundingClientRect(editor: ICodeEditor, store: DisposableStore): IObservable<DOMRectReadOnly> {\n\tconst dom = editor.getContainerDomNode()!;\n\tconst initialDomRect = observableValue('domRect', dom.getBoundingClientRect());\n\tstore.add(editor.onDidLayoutChange(e => {\n\t\tinitialDomRect.set(dom.getBoundingClientRect(), undefined);\n\t}));\n\treturn initialDomRect;\n}\n","\nimport { numberComparator } from '../../../../../../../base/common/arrays.js';\nimport { findFirstMin } from '../../../../../../../base/common/arraysFind.js';\nimport { DisposableStore } from '../../../../../../../base/common/lifecycle.js';\nimport { DebugLocation, derived, derivedObservableWithCache, derivedOpts, IObservable, IReader, observableSignalFromEvent, observableValue } from '../../../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor, ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../../common/core/edits/textEdit.js';\nimport { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { indentOfLine } from '../../../../../../common/model/textModel.js';\nimport { CharCode } from '../../../../../../../base/common/charCode.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Size2D } from '../../../../../../common/core/2d/size.js';\n\n/**\n * Warning: might return 0.\n*/\nexport function maxContentWidthInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\tlet maxContentWidth = 0;\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst lineContentWidth = editor.editor.getWidthOfLine(i);\n\t\tmaxContentWidth = Math.max(maxContentWidth, lineContentWidth);\n\t}\n\tconst lines = range.mapToLineArray(l => model.getLineContent(l));\n\n\tif (maxContentWidth < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {\n\t\tconsole.error('unexpected width');\n\t}\n\treturn maxContentWidth;\n}\n\nexport function getContentSizeOfLines(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): Size2D[] {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\tobservableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { throw new BugIndicatingError('Model is required'); }\n\n\tconst sizes: Size2D[] = [];\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tlet lineContentWidth = editor.editor.getWidthOfLine(i);\n\t\tif (lineContentWidth === -1) {\n\t\t\t// approximation\n\t\t\tconst column = model.getLineMaxColumn(i);\n\t\t\tconst typicalHalfwidthCharacterWidth = editor.editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst approximation = column * typicalHalfwidthCharacterWidth;\n\t\t\tlineContentWidth = approximation;\n\t\t}\n\n\t\tconst height = editor.editor.getLineHeightForPosition(new Position(i, 1));\n\t\tsizes.push(new Size2D(lineContentWidth, height));\n\t}\n\n\treturn sizes;\n}\n\nexport function getOffsetForPos(editor: ObservableCodeEditor, pos: Position, reader: IReader): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\n\teditor.scrollTop.read(reader);\n\tconst lineContentWidth = editor.editor.getOffsetForColumn(pos.lineNumber, pos.column);\n\n\treturn lineContentWidth;\n}\n\nexport function getPrefixTrim(diffRanges: Range[], originalLinesRange: LineRange, modifiedLines: string[], editor: ICodeEditor, reader: IReader | undefined = undefined): { prefixTrim: number; prefixLeftOffset: number } {\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\tconst replacementStart = diffRanges.map(r => r.isSingleLine() ? r.startColumn - 1 : 0);\n\tconst originalIndents = originalLinesRange.mapToLineArray(line => indentOfLine(textModel.getLineContent(line)));\n\tconst modifiedIndents = modifiedLines.filter(line => line !== '').map(line => indentOfLine(line));\n\tconst prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents);\n\n\tlet prefixLeftOffset;\n\tconst startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber);\n\tif (startLineIndent >= prefixTrim + 1) {\n\t\t// We can use the editor to get the offset\n\t\t// TODO go through other usages of getOffsetForColumn and come up with a robust reactive solution to read it\n\t\tobservableCodeEditor(editor).scrollTop.read(reader); // getOffsetForColumn requires the line number to be visible. This might change on scroll top.\n\t\tprefixLeftOffset = editor.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1);\n\t} else if (modifiedLines.length > 0) {\n\t\t// Content is not in the editor, we can use the content width to calculate the offset\n\t\tprefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor, textModel);\n\t} else {\n\t\t// unable to approximate the offset\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\treturn { prefixTrim, prefixLeftOffset };\n}\n\nexport function getContentRenderWidth(content: string, editor: ICodeEditor, textModel: ITextModel) {\n\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\tconst tabSize = textModel.getOptions().tabSize * w;\n\n\tconst numTabs = content.split('\\t').length - 1;\n\tconst numNoneTabs = content.length - numTabs;\n\treturn numNoneTabs * w + numTabs * tabSize;\n}\n\nexport function getEditorValidOverlayRect(editor: ObservableCodeEditor): IObservable<Rect> {\n\tconst contentLeft = editor.layoutInfoContentLeft;\n\n\tconst width = derived({ name: 'editor.validOverlay.width' }, r => {\n\t\tconst hasMinimapOnTheRight = editor.layoutInfoMinimap.read(r).minimapLeft !== 0;\n\t\tconst editorWidth = editor.layoutInfoWidth.read(r) - contentLeft.read(r);\n\n\t\tif (hasMinimapOnTheRight) {\n\t\t\tconst minimapAndScrollbarWidth = editor.layoutInfoMinimap.read(r).minimapWidth + editor.layoutInfoVerticalScrollbarWidth.read(r);\n\t\t\treturn editorWidth - minimapAndScrollbarWidth;\n\t\t}\n\n\t\treturn editorWidth;\n\t});\n\n\tconst height = derived({ name: 'editor.validOverlay.height' }, r => editor.layoutInfoHeight.read(r) + editor.contentHeight.read(r));\n\n\treturn derived({ name: 'editor.validOverlay' }, r => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width.read(r), height.read(r)));\n}\nexport function applyEditToModifiedRangeMappings(rangeMapping: RangeMapping[], edit: TextEdit): RangeMapping[] {\n\tconst updatedMappings: RangeMapping[] = [];\n\tfor (const m of rangeMapping) {\n\t\tconst updatedRange = edit.mapRange(m.modifiedRange);\n\t\tupdatedMappings.push(new RangeMapping(m.originalRange, updatedRange));\n\t}\n\treturn updatedMappings;\n}\n\n\nexport function classNames(...classes: (string | false | undefined | null)[]) {\n\treturn classes.filter(c => typeof c === 'string').join(' ');\n}\n\nfunction offsetRangeToRange(columnOffsetRange: OffsetRange, startPos: Position): Range {\n\treturn new Range(\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.start,\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.endExclusive,\n\t);\n}\n\n/**\n * Calculates the indentation size (in spaces) of a given line,\n * interpreting tabs as the specified tab size.\n */\nfunction getIndentationSize(line: string, tabSize: number): number {\n\tlet currentSize = 0;\n\tloop: for (let i = 0, len = line.length; i < len; i++) {\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: currentSize += tabSize; break;\n\t\t\tcase CharCode.Space: currentSize++; break;\n\t\t\tdefault: break loop;\n\t\t}\n\t}\n\t// if currentSize % tabSize !== 0,\n\t// then there are spaces which are not part of the indentation\n\treturn currentSize - (currentSize % tabSize);\n}\n\n/**\n * Calculates the number of characters at the start of a line that correspond to a given indentation size,\n * taking into account both tabs and spaces.\n */\nfunction indentSizeToIndentLength(line: string, indentSize: number, tabSize: number): number {\n\tlet remainingSize = indentSize - (indentSize % tabSize);\n\tlet i = 0;\n\tfor (; i < line.length; i++) {\n\t\tif (remainingSize === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: remainingSize -= tabSize; break;\n\t\t\tcase CharCode.Space: remainingSize--; break;\n\t\t\tdefault: throw new BugIndicatingError('Unexpected character found while calculating indent length');\n\t\t}\n\t}\n\treturn i;\n}\n\nexport function createReindentEdit(text: string, range: LineRange, tabSize: number): TextEdit {\n\tconst newLines = splitLines(text);\n\tconst edits: TextReplacement[] = [];\n\tconst minIndentSize = findFirstMin(range.mapToLineArray(l => getIndentationSize(newLines[l - 1], tabSize)), numberComparator)!;\n\trange.forEach(lineNumber => {\n\t\tconst indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize);\n\t\tedits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), ''));\n\t});\n\treturn new TextEdit(edits);\n}\n\nexport class PathBuilder {\n\tprivate _data: string = '';\n\n\tpublic moveTo(point: Point): this {\n\t\tthis._data += `M ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic lineTo(point: Point): this {\n\t\tthis._data += `L ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._data;\n\t}\n}\n\ntype RemoveFalsy<T> = T extends false | undefined | null ? never : T;\ntype Falsy<T> = T extends false | undefined | null ? T : never;\n\nexport function mapOutFalsy<T>(obs: IObservable<T>): IObservable<IObservable<RemoveFalsy<T>> | Falsy<T>> {\n\tconst nonUndefinedObs = derivedObservableWithCache<T | undefined | null | false>(undefined, (reader, lastValue) => obs.read(reader) || lastValue);\n\n\treturn derivedOpts({\n\t\tdebugName: () => `${obs.debugName}.mapOutFalsy`\n\t}, reader => {\n\t\tnonUndefinedObs.read(reader);\n\t\tconst val = obs.read(reader);\n\t\tif (!val) {\n\t\t\treturn undefined as Falsy<T>;\n\t\t}\n\n\t\treturn nonUndefinedObs as IObservable<RemoveFalsy<T>>;\n\t});\n}\n\nexport function rectToProps(fn: (reader: IReader) => Rect | undefined, debugLocation: DebugLocation = DebugLocation.ofCaller()) {\n\treturn {\n\t\tleft: derived({ name: 'editor.validOverlay.left' }, reader => /** @description left */ fn(reader)?.left, debugLocation),\n\t\ttop: derived({ name: 'editor.validOverlay.top' }, reader => /** @description top */ fn(reader)?.top, debugLocation),\n\t\twidth: derived({ name: 'editor.validOverlay.width' }, reader => {\n\t\t\t/** @description width */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.width;\n\t\t}, debugLocation),\n\t\theight: derived({ name: 'editor.validOverlay.height' }, reader => {\n\t\t\t/** @description height */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.height;\n\t\t}, debugLocation),\n\t};\n}\n\nexport type FirstFnArg<T> = T extends (arg: infer U) => any ? U : never;\n\n\nexport function observeEditorBoundingClientRect(editor: ICodeEditor, store: DisposableStore): IObservable<DOMRectReadOnly> {\n\tconst dom = editor.getContainerDomNode()!;\n\tconst initialDomRect = observableValue('domRect', dom.getBoundingClientRect());\n\tstore.add(editor.onDidLayoutChange(e => {\n\t\tinitialDomRect.set(dom.getBoundingClientRect(), undefined);\n\t}));\n\treturn initialDomRect;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAwB,yBAAyB,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACnM,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAwB,MAAM,mDAAmD,CAAC;AAE/G,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAGhE,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM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AC,iBAAiB,CAAC,CAAC,CAAC,EAAE;QACtC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,cAAc,CAAC;AACvB,CAAC","file":"utils.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { numberComparator } from '../../../../../../../base/common/arrays.js';\nimport { findFirstMin } from '../../../../../../../base/common/arraysFind.js';\nimport { DisposableStore } from '../../../../../../../base/common/lifecycle.js';\nimport { DebugLocation, derived, derivedObservableWithCache, derivedOpts, IObservable, IReader, observableSignalFromEvent, observableValue } from '../../../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor, ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../../common/core/edits/textEdit.js';\nimport { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { indentOfLine } from '../../../../../../common/model/textModel.js';\nimport { CharCode } from '../../../../../../../base/common/charCode.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Size2D } from '../../../../../../common/core/2d/size.js';\n\n/**\n * Warning: might return 0.\n*/\nexport function maxContentWidthInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): number {\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\tlet maxContentWidth = 0;\n\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst lineContentWidth = editor.getWidthOfLine(i, reader);\n\t\tmaxContentWidth = Math.max(maxContentWidth, lineContentWidth);\n\t}\n\tconst lines = range.mapToLineArray(l => model.getLineContent(l));\n\n\tif (maxContentWidth < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {\n\t\tconsole.error('unexpected width');\n\t}\n\treturn maxContentWidth;\n}\n\nexport function getContentSizeOfLines(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): Size2D[] {\n\tobservableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { throw new BugIndicatingError('Model is required'); }\n\n\tconst sizes: Size2D[] = [];\n\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tlet lineContentWidth = editor.getWidthOfLine(i, reader);\n\t\tif (lineContentWidth === -1) {\n\t\t\t// approximation\n\t\t\tconst column = model.getLineMaxColumn(i);\n\t\t\tconst typicalHalfwidthCharacterWidth = editor.editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst approximation = column * typicalHalfwidthCharacterWidth;\n\t\t\tlineContentWidth = approximation;\n\t\t}\n\n\t\tconst height = editor.editor.getLineHeightForPosition(new Position(i, 1));\n\t\tsizes.push(new Size2D(lineContentWidth, height));\n\t}\n\n\treturn sizes;\n}\n\nexport function getOffsetForPos(editor: ObservableCodeEditor, pos: Position, reader: IReader): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\n\teditor.scrollTop.read(reader);\n\tconst lineContentWidth = editor.editor.getOffsetForColumn(pos.lineNumber, pos.column);\n\n\treturn lineContentWidth;\n}\n\nexport function getPrefixTrim(diffRanges: Range[], originalLinesRange: LineRange, modifiedLines: string[], editor: ICodeEditor, reader: IReader | undefined = undefined): { prefixTrim: number; prefixLeftOffset: number } {\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\tconst replacementStart = diffRanges.map(r => r.isSingleLine() ? r.startColumn - 1 : 0);\n\tconst originalIndents = originalLinesRange.mapToLineArray(line => indentOfLine(textModel.getLineContent(line)));\n\tconst modifiedIndents = modifiedLines.filter(line => line !== '').map(line => indentOfLine(line));\n\tconst prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents);\n\n\tlet prefixLeftOffset;\n\tconst startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber);\n\tif (startLineIndent >= prefixTrim + 1) {\n\t\t// We can use the editor to get the offset\n\t\t// TODO go through other usages of getOffsetForColumn and come up with a robust reactive solution to read it\n\t\tobservableCodeEditor(editor).scrollTop.read(reader); // getOffsetForColumn requires the line number to be visible. This might change on scroll top.\n\t\tprefixLeftOffset = editor.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1);\n\t} else if (modifiedLines.length > 0) {\n\t\t// Content is not in the editor, we can use the content width to calculate the offset\n\t\tprefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor, textModel);\n\t} else {\n\t\t// unable to approximate the offset\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\treturn { prefixTrim, prefixLeftOffset };\n}\n\nexport function getContentRenderWidth(content: string, editor: ICodeEditor, textModel: ITextModel) {\n\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\tconst tabSize = textModel.getOptions().tabSize * w;\n\n\tconst numTabs = content.split('\\t').length - 1;\n\tconst numNoneTabs = content.length - numTabs;\n\treturn numNoneTabs * w + numTabs * tabSize;\n}\n\nexport function getEditorValidOverlayRect(editor: ObservableCodeEditor): IObservable<Rect> {\n\tconst contentLeft = editor.layoutInfoContentLeft;\n\n\tconst width = derived({ name: 'editor.validOverlay.width' }, r => {\n\t\tconst hasMinimapOnTheRight = editor.layoutInfoMinimap.read(r).minimapLeft !== 0;\n\t\tconst editorWidth = editor.layoutInfoWidth.read(r) - contentLeft.read(r);\n\n\t\tif (hasMinimapOnTheRight) {\n\t\t\tconst minimapAndScrollbarWidth = editor.layoutInfoMinimap.read(r).minimapWidth + editor.layoutInfoVerticalScrollbarWidth.read(r);\n\t\t\treturn editorWidth - minimapAndScrollbarWidth;\n\t\t}\n\n\t\treturn editorWidth;\n\t});\n\n\tconst height = derived({ name: 'editor.validOverlay.height' }, r => editor.layoutInfoHeight.read(r) + editor.contentHeight.read(r));\n\n\treturn derived({ name: 'editor.validOverlay' }, r => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width.read(r), height.read(r)));\n}\nexport function applyEditToModifiedRangeMappings(rangeMapping: RangeMapping[], edit: TextEdit): RangeMapping[] {\n\tconst updatedMappings: RangeMapping[] = [];\n\tfor (const m of rangeMapping) {\n\t\tconst updatedRange = edit.mapRange(m.modifiedRange);\n\t\tupdatedMappings.push(new RangeMapping(m.originalRange, updatedRange));\n\t}\n\treturn updatedMappings;\n}\n\n\nexport function classNames(...classes: (string | false | undefined | null)[]) {\n\treturn classes.filter(c => typeof c === 'string').join(' ');\n}\n\nfunction offsetRangeToRange(columnOffsetRange: OffsetRange, startPos: Position): Range {\n\treturn new Range(\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.start,\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.endExclusive,\n\t);\n}\n\n/**\n * Calculates the indentation size (in spaces) of a given line,\n * interpreting tabs as the specified tab size.\n */\nfunction getIndentationSize(line: string, tabSize: number): number {\n\tlet currentSize = 0;\n\tloop: for (let i = 0, len = line.length; i < len; i++) {\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: currentSize += tabSize; break;\n\t\t\tcase CharCode.Space: currentSize++; break;\n\t\t\tdefault: break loop;\n\t\t}\n\t}\n\t// if currentSize % tabSize !== 0,\n\t// then there are spaces which are not part of the indentation\n\treturn currentSize - (currentSize % tabSize);\n}\n\n/**\n * Calculates the number of characters at the start of a line that correspond to a given indentation size,\n * taking into account both tabs and spaces.\n */\nfunction indentSizeToIndentLength(line: string, indentSize: number, tabSize: number): number {\n\tlet remainingSize = indentSize - (indentSize % tabSize);\n\tlet i = 0;\n\tfor (; i < line.length; i++) {\n\t\tif (remainingSize === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: remainingSize -= tabSize; break;\n\t\t\tcase CharCode.Space: remainingSize--; break;\n\t\t\tdefault: throw new BugIndicatingError('Unexpected character found while calculating indent length');\n\t\t}\n\t}\n\treturn i;\n}\n\nexport function createReindentEdit(text: string, range: LineRange, tabSize: number): TextEdit {\n\tconst newLines = splitLines(text);\n\tconst edits: TextReplacement[] = [];\n\tconst minIndentSize = findFirstMin(range.mapToLineArray(l => getIndentationSize(newLines[l - 1], tabSize)), numberComparator)!;\n\trange.forEach(lineNumber => {\n\t\tconst indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize);\n\t\tedits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), ''));\n\t});\n\treturn new TextEdit(edits);\n}\n\nexport class PathBuilder {\n\tprivate _data: string = '';\n\n\tpublic moveTo(point: Point): this {\n\t\tthis._data += `M ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic lineTo(point: Point): this {\n\t\tthis._data += `L ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._data;\n\t}\n}\n\ntype RemoveFalsy<T> = T extends false | undefined | null ? never : T;\ntype Falsy<T> = T extends false | undefined | null ? T : never;\n\nexport function mapOutFalsy<T>(obs: IObservable<T>): IObservable<IObservable<RemoveFalsy<T>> | Falsy<T>> {\n\tconst nonUndefinedObs = derivedObservableWithCache<T | undefined | null | false>(undefined, (reader, lastValue) => obs.read(reader) || lastValue);\n\n\treturn derivedOpts({\n\t\tdebugName: () => `${obs.debugName}.mapOutFalsy`\n\t}, reader => {\n\t\tnonUndefinedObs.read(reader);\n\t\tconst val = obs.read(reader);\n\t\tif (!val) {\n\t\t\treturn undefined as Falsy<T>;\n\t\t}\n\n\t\treturn nonUndefinedObs as IObservable<RemoveFalsy<T>>;\n\t});\n}\n\nexport function rectToProps(fn: (reader: IReader) => Rect | undefined, debugLocation: DebugLocation = DebugLocation.ofCaller()) {\n\treturn {\n\t\tleft: derived({ name: 'editor.validOverlay.left' }, reader => /** @description left */ fn(reader)?.left, debugLocation),\n\t\ttop: derived({ name: 'editor.validOverlay.top' }, reader => /** @description top */ fn(reader)?.top, debugLocation),\n\t\twidth: derived({ name: 'editor.validOverlay.width' }, reader => {\n\t\t\t/** @description width */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.width;\n\t\t}, debugLocation),\n\t\theight: derived({ name: 'editor.validOverlay.height' }, reader => {\n\t\t\t/** @description height */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.height;\n\t\t}, debugLocation),\n\t};\n}\n\nexport type FirstFnArg<T> = T extends (arg: infer U) => any ? U : never;\n\n\nexport function observeEditorBoundingClientRect(editor: ICodeEditor, store: DisposableStore): IObservable<DOMRectReadOnly> {\n\tconst dom = editor.getContainerDomNode()!;\n\tconst initialDomRect = observableValue('domRect', dom.getBoundingClientRect());\n\tstore.add(editor.onDidLayoutChange(e => {\n\t\tinitialDomRect.set(dom.getBoundingClientRect(), undefined);\n\t}));\n\treturn initialDomRect;\n}\n","\nimport { numberComparator } from '../../../../../../../base/common/arrays.js';\nimport { findFirstMin } from '../../../../../../../base/common/arraysFind.js';\nimport { DisposableStore } from '../../../../../../../base/common/lifecycle.js';\nimport { DebugLocation, derived, derivedObservableWithCache, derivedOpts, IObservable, IReader, observableSignalFromEvent, observableValue } from '../../../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor, ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../../common/core/edits/textEdit.js';\nimport { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { indentOfLine } from '../../../../../../common/model/textModel.js';\nimport { CharCode } from '../../../../../../../base/common/charCode.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Size2D } from '../../../../../../common/core/2d/size.js';\n\n/**\n * Warning: might return 0.\n*/\nexport function maxContentWidthInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): number {\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\tlet maxContentWidth = 0;\n\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst lineContentWidth = editor.getWidthOfLine(i, reader);\n\t\tmaxContentWidth = Math.max(maxContentWidth, lineContentWidth);\n\t}\n\tconst lines = range.mapToLineArray(l => model.getLineContent(l));\n\n\tif (maxContentWidth < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {\n\t\tconsole.error('unexpected width');\n\t}\n\treturn maxContentWidth;\n}\n\nexport function getContentSizeOfLines(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): Size2D[] {\n\tobservableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { throw new BugIndicatingError('Model is required'); }\n\n\tconst sizes: Size2D[] = [];\n\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tlet lineContentWidth = editor.getWidthOfLine(i, reader);\n\t\tif (lineContentWidth === -1) {\n\t\t\t// approximation\n\t\t\tconst column = model.getLineMaxColumn(i);\n\t\t\tconst typicalHalfwidthCharacterWidth = editor.editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst approximation = column * typicalHalfwidthCharacterWidth;\n\t\t\tlineContentWidth = approximation;\n\t\t}\n\n\t\tconst height = editor.editor.getLineHeightForPosition(new Position(i, 1));\n\t\tsizes.push(new Size2D(lineContentWidth, height));\n\t}\n\n\treturn sizes;\n}\n\nexport function getOffsetForPos(editor: ObservableCodeEditor, pos: Position, reader: IReader): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\n\teditor.scrollTop.read(reader);\n\tconst lineContentWidth = editor.editor.getOffsetForColumn(pos.lineNumber, pos.column);\n\n\treturn lineContentWidth;\n}\n\nexport function getPrefixTrim(diffRanges: Range[], originalLinesRange: LineRange, modifiedLines: string[], editor: ICodeEditor, reader: IReader | undefined = undefined): { prefixTrim: number; prefixLeftOffset: number } {\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\tconst replacementStart = diffRanges.map(r => r.isSingleLine() ? r.startColumn - 1 : 0);\n\tconst originalIndents = originalLinesRange.mapToLineArray(line => indentOfLine(textModel.getLineContent(line)));\n\tconst modifiedIndents = modifiedLines.filter(line => line !== '').map(line => indentOfLine(line));\n\tconst prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents);\n\n\tlet prefixLeftOffset;\n\tconst startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber);\n\tif (startLineIndent >= prefixTrim + 1) {\n\t\t// We can use the editor to get the offset\n\t\t// TODO go through other usages of getOffsetForColumn and come up with a robust reactive solution to read it\n\t\tobservableCodeEditor(editor).scrollTop.read(reader); // getOffsetForColumn requires the line number to be visible. This might change on scroll top.\n\t\tprefixLeftOffset = editor.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1);\n\t} else if (modifiedLines.length > 0) {\n\t\t// Content is not in the editor, we can use the content width to calculate the offset\n\t\tprefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor, textModel);\n\t} else {\n\t\t// unable to approximate the offset\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\treturn { prefixTrim, prefixLeftOffset };\n}\n\nexport function getContentRenderWidth(content: string, editor: ICodeEditor, textModel: ITextModel) {\n\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\tconst tabSize = textModel.getOptions().tabSize * w;\n\n\tconst numTabs = content.split('\\t').length - 1;\n\tconst numNoneTabs = content.length - numTabs;\n\treturn numNoneTabs * w + numTabs * tabSize;\n}\n\nexport function getEditorValidOverlayRect(editor: ObservableCodeEditor): IObservable<Rect> {\n\tconst contentLeft = editor.layoutInfoContentLeft;\n\n\tconst width = derived({ name: 'editor.validOverlay.width' }, r => {\n\t\tconst hasMinimapOnTheRight = editor.layoutInfoMinimap.read(r).minimapLeft !== 0;\n\t\tconst editorWidth = editor.layoutInfoWidth.read(r) - contentLeft.read(r);\n\n\t\tif (hasMinimapOnTheRight) {\n\t\t\tconst minimapAndScrollbarWidth = editor.layoutInfoMinimap.read(r).minimapWidth + editor.layoutInfoVerticalScrollbarWidth.read(r);\n\t\t\treturn editorWidth - minimapAndScrollbarWidth;\n\t\t}\n\n\t\treturn editorWidth;\n\t});\n\n\tconst height = derived({ name: 'editor.validOverlay.height' }, r => editor.layoutInfoHeight.read(r) + editor.contentHeight.read(r));\n\n\treturn derived({ name: 'editor.validOverlay' }, r => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width.read(r), height.read(r)));\n}\nexport function applyEditToModifiedRangeMappings(rangeMapping: RangeMapping[], edit: TextEdit): RangeMapping[] {\n\tconst updatedMappings: RangeMapping[] = [];\n\tfor (const m of rangeMapping) {\n\t\tconst updatedRange = edit.mapRange(m.modifiedRange);\n\t\tupdatedMappings.push(new RangeMapping(m.originalRange, updatedRange));\n\t}\n\treturn updatedMappings;\n}\n\n\nexport function classNames(...classes: (string | false | undefined | null)[]) {\n\treturn classes.filter(c => typeof c === 'string').join(' ');\n}\n\nfunction offsetRangeToRange(columnOffsetRange: OffsetRange, startPos: Position): Range {\n\treturn new Range(\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.start,\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.endExclusive,\n\t);\n}\n\n/**\n * Calculates the indentation size (in spaces) of a given line,\n * interpreting tabs as the specified tab size.\n */\nfunction getIndentationSize(line: string, tabSize: number): number {\n\tlet currentSize = 0;\n\tloop: for (let i = 0, len = line.length; i < len; i++) {\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: currentSize += tabSize; break;\n\t\t\tcase CharCode.Space: currentSize++; break;\n\t\t\tdefault: break loop;\n\t\t}\n\t}\n\t// if currentSize % tabSize !== 0,\n\t// then there are spaces which are not part of the indentation\n\treturn currentSize - (currentSize % tabSize);\n}\n\n/**\n * Calculates the number of characters at the start of a line that correspond to a given indentation size,\n * taking into account both tabs and spaces.\n */\nfunction indentSizeToIndentLength(line: string, indentSize: number, tabSize: number): number {\n\tlet remainingSize = indentSize - (indentSize % tabSize);\n\tlet i = 0;\n\tfor (; i < line.length; i++) {\n\t\tif (remainingSize === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: remainingSize -= tabSize; break;\n\t\t\tcase CharCode.Space: remainingSize--; break;\n\t\t\tdefault: throw new BugIndicatingError('Unexpected character found while calculating indent length');\n\t\t}\n\t}\n\treturn i;\n}\n\nexport function createReindentEdit(text: string, range: LineRange, tabSize: number): TextEdit {\n\tconst newLines = splitLines(text);\n\tconst edits: TextReplacement[] = [];\n\tconst minIndentSize = findFirstMin(range.mapToLineArray(l => getIndentationSize(newLines[l - 1], tabSize)), numberComparator)!;\n\trange.forEach(lineNumber => {\n\t\tconst indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize);\n\t\tedits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), ''));\n\t});\n\treturn new TextEdit(edits);\n}\n\nexport class PathBuilder {\n\tprivate _data: string = '';\n\n\tpublic moveTo(point: Point): this {\n\t\tthis._data += `M ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic lineTo(point: Point): this {\n\t\tthis._data += `L ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._data;\n\t}\n}\n\ntype RemoveFalsy<T> = T extends false | undefined | null ? never : T;\ntype Falsy<T> = T extends false | undefined | null ? T : never;\n\nexport function mapOutFalsy<T>(obs: IObservable<T>): IObservable<IObservable<RemoveFalsy<T>> | Falsy<T>> {\n\tconst nonUndefinedObs = derivedObservableWithCache<T | undefined | null | false>(undefined, (reader, lastValue) => obs.read(reader) || lastValue);\n\n\treturn derivedOpts({\n\t\tdebugName: () => `${obs.debugName}.mapOutFalsy`\n\t}, reader => {\n\t\tnonUndefinedObs.read(reader);\n\t\tconst val = obs.read(reader);\n\t\tif (!val) {\n\t\t\treturn undefined as Falsy<T>;\n\t\t}\n\n\t\treturn nonUndefinedObs as IObservable<RemoveFalsy<T>>;\n\t});\n}\n\nexport function rectToProps(fn: (reader: IReader) => Rect | undefined, debugLocation: DebugLocation = DebugLocation.ofCaller()) {\n\treturn {\n\t\tleft: derived({ name: 'editor.validOverlay.left' }, reader => /** @description left */ fn(reader)?.left, debugLocation),\n\t\ttop: derived({ name: 'editor.validOverlay.top' }, reader => /** @description top */ fn(reader)?.top, debugLocation),\n\t\twidth: derived({ name: 'editor.validOverlay.width' }, reader => {\n\t\t\t/** @description width */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.width;\n\t\t}, debugLocation),\n\t\theight: derived({ name: 'editor.validOverlay.height' }, reader => {\n\t\t\t/** @description height */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.height;\n\t\t}, debugLocation),\n\t};\n}\n\nexport type FirstFnArg<T> = T extends (arg: infer U) => any ? U : never;\n\n\nexport function observeEditorBoundingClientRect(editor: ICodeEditor, store: DisposableStore): IObservable<DOMRectReadOnly> {\n\tconst dom = editor.getContainerDomNode()!;\n\tconst initialDomRect = observableValue('domRect', dom.getBoundingClientRect());\n\tstore.add(editor.onDidLayoutChange(e => {\n\t\tinitialDomRect.set(dom.getBoundingClientRect(), undefined);\n\t}));\n\treturn initialDomRect;\n}\n"]}
@@ -11,7 +11,7 @@ export class InsertFinalNewLineAction extends EditorAction {
11
11
  constructor() {
12
12
  super({
13
13
  id: InsertFinalNewLineAction.ID,
14
- label: nls.localize2(1255, "Insert Final New Line"),
14
+ label: nls.localize2(1257, "Insert Final New Line"),
15
15
  precondition: EditorContextKeys.writable
16
16
  });
17
17
  }
@@ -10,7 +10,7 @@ export class ExpandLineSelectionAction extends EditorAction {
10
10
  constructor() {
11
11
  super({
12
12
  id: 'expandLineSelection',
13
- label: nls.localize2(1256, "Expand Line Selection"),
13
+ label: nls.localize2(1258, "Expand Line Selection"),
14
14
  precondition: undefined,
15
15
  kbOpts: {
16
16
  weight: 0 /* KeybindingWeight.EditorCore */,
@@ -63,7 +63,7 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
63
63
  constructor() {
64
64
  super(false, {
65
65
  id: 'editor.action.copyLinesUpAction',
66
- label: nls.localize2(1262, "Copy Line Up"),
66
+ label: nls.localize2(1264, "Copy Line Up"),
67
67
  precondition: EditorContextKeys.writable,
68
68
  kbOpts: {
69
69
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -74,7 +74,7 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
74
74
  menuOpts: {
75
75
  menuId: MenuId.MenubarSelectionMenu,
76
76
  group: '2_line',
77
- title: nls.localize(1257, "&&Copy Line Up"),
77
+ title: nls.localize(1259, "&&Copy Line Up"),
78
78
  order: 1
79
79
  },
80
80
  canTriggerInlineEdits: true,
@@ -85,7 +85,7 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
85
85
  constructor() {
86
86
  super(true, {
87
87
  id: 'editor.action.copyLinesDownAction',
88
- label: nls.localize2(1263, "Copy Line Down"),
88
+ label: nls.localize2(1265, "Copy Line Down"),
89
89
  precondition: EditorContextKeys.writable,
90
90
  kbOpts: {
91
91
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -96,7 +96,7 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
96
96
  menuOpts: {
97
97
  menuId: MenuId.MenubarSelectionMenu,
98
98
  group: '2_line',
99
- title: nls.localize(1258, "Co&&py Line Down"),
99
+ title: nls.localize(1260, "Co&&py Line Down"),
100
100
  order: 2
101
101
  },
102
102
  canTriggerInlineEdits: true,
@@ -107,12 +107,12 @@ export class DuplicateSelectionAction extends EditorAction {
107
107
  constructor() {
108
108
  super({
109
109
  id: 'editor.action.duplicateSelection',
110
- label: nls.localize2(1264, "Duplicate Selection"),
110
+ label: nls.localize2(1266, "Duplicate Selection"),
111
111
  precondition: EditorContextKeys.writable,
112
112
  menuOpts: {
113
113
  menuId: MenuId.MenubarSelectionMenu,
114
114
  group: '2_line',
115
- title: nls.localize(1259, "&&Duplicate Selection"),
115
+ title: nls.localize(1261, "&&Duplicate Selection"),
116
116
  order: 5
117
117
  },
118
118
  canTriggerInlineEdits: true,
@@ -162,7 +162,7 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
162
162
  constructor() {
163
163
  super(false, {
164
164
  id: 'editor.action.moveLinesUpAction',
165
- label: nls.localize2(1265, "Move Line Up"),
165
+ label: nls.localize2(1267, "Move Line Up"),
166
166
  precondition: EditorContextKeys.writable,
167
167
  kbOpts: {
168
168
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -173,7 +173,7 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
173
173
  menuOpts: {
174
174
  menuId: MenuId.MenubarSelectionMenu,
175
175
  group: '2_line',
176
- title: nls.localize(1260, "Mo&&ve Line Up"),
176
+ title: nls.localize(1262, "Mo&&ve Line Up"),
177
177
  order: 3
178
178
  },
179
179
  canTriggerInlineEdits: true,
@@ -184,7 +184,7 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
184
184
  constructor() {
185
185
  super(true, {
186
186
  id: 'editor.action.moveLinesDownAction',
187
- label: nls.localize2(1266, "Move Line Down"),
187
+ label: nls.localize2(1268, "Move Line Down"),
188
188
  precondition: EditorContextKeys.writable,
189
189
  kbOpts: {
190
190
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -195,7 +195,7 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
195
195
  menuOpts: {
196
196
  menuId: MenuId.MenubarSelectionMenu,
197
197
  group: '2_line',
198
- title: nls.localize(1261, "Move &&Line Down"),
198
+ title: nls.localize(1263, "Move &&Line Down"),
199
199
  order: 4
200
200
  },
201
201
  canTriggerInlineEdits: true,
@@ -235,7 +235,7 @@ export class SortLinesAscendingAction extends AbstractSortLinesAction {
235
235
  constructor() {
236
236
  super(false, {
237
237
  id: 'editor.action.sortLinesAscending',
238
- label: nls.localize2(1267, "Sort Lines Ascending"),
238
+ label: nls.localize2(1269, "Sort Lines Ascending"),
239
239
  precondition: EditorContextKeys.writable,
240
240
  canTriggerInlineEdits: true,
241
241
  });
@@ -245,7 +245,7 @@ export class SortLinesDescendingAction extends AbstractSortLinesAction {
245
245
  constructor() {
246
246
  super(true, {
247
247
  id: 'editor.action.sortLinesDescending',
248
- label: nls.localize2(1268, "Sort Lines Descending"),
248
+ label: nls.localize2(1270, "Sort Lines Descending"),
249
249
  precondition: EditorContextKeys.writable,
250
250
  canTriggerInlineEdits: true,
251
251
  });
@@ -255,7 +255,7 @@ export class DeleteDuplicateLinesAction extends EditorAction {
255
255
  constructor() {
256
256
  super({
257
257
  id: 'editor.action.removeDuplicateLines',
258
- label: nls.localize2(1269, "Delete Duplicate Lines"),
258
+ label: nls.localize2(1271, "Delete Duplicate Lines"),
259
259
  precondition: EditorContextKeys.writable,
260
260
  canTriggerInlineEdits: true,
261
261
  });
@@ -305,7 +305,7 @@ export class ReverseLinesAction extends EditorAction {
305
305
  constructor() {
306
306
  super({
307
307
  id: 'editor.action.reverseLines',
308
- label: nls.localize2(1270, "Reverse lines"),
308
+ label: nls.localize2(1272, "Reverse lines"),
309
309
  precondition: EditorContextKeys.writable,
310
310
  canTriggerInlineEdits: true
311
311
  });
@@ -372,7 +372,7 @@ export class TrimTrailingWhitespaceAction extends EditorAction {
372
372
  constructor() {
373
373
  super({
374
374
  id: TrimTrailingWhitespaceAction.ID,
375
- label: nls.localize2(1271, "Trim Trailing Whitespace"),
375
+ label: nls.localize2(1273, "Trim Trailing Whitespace"),
376
376
  precondition: EditorContextKeys.writable,
377
377
  kbOpts: {
378
378
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -406,7 +406,7 @@ export class DeleteLinesAction extends EditorAction {
406
406
  constructor() {
407
407
  super({
408
408
  id: 'editor.action.deleteLines',
409
- label: nls.localize2(1272, "Delete Line"),
409
+ label: nls.localize2(1274, "Delete Line"),
410
410
  precondition: EditorContextKeys.writable,
411
411
  kbOpts: {
412
412
  kbExpr: EditorContextKeys.textInputFocus,
@@ -496,7 +496,7 @@ export class IndentLinesAction extends EditorAction {
496
496
  constructor() {
497
497
  super({
498
498
  id: 'editor.action.indentLines',
499
- label: nls.localize2(1273, "Indent Line"),
499
+ label: nls.localize2(1275, "Indent Line"),
500
500
  precondition: EditorContextKeys.writable,
501
501
  kbOpts: {
502
502
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -520,7 +520,7 @@ class OutdentLinesAction extends EditorAction {
520
520
  constructor() {
521
521
  super({
522
522
  id: 'editor.action.outdentLines',
523
- label: nls.localize2(1274, "Outdent Line"),
523
+ label: nls.localize2(1276, "Outdent Line"),
524
524
  precondition: EditorContextKeys.writable,
525
525
  kbOpts: {
526
526
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -539,7 +539,7 @@ export class InsertLineBeforeAction extends EditorAction {
539
539
  constructor() {
540
540
  super({
541
541
  id: InsertLineBeforeAction.ID,
542
- label: nls.localize2(1275, "Insert Line Above"),
542
+ label: nls.localize2(1277, "Insert Line Above"),
543
543
  precondition: EditorContextKeys.writable,
544
544
  kbOpts: {
545
545
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -563,7 +563,7 @@ export class InsertLineAfterAction extends EditorAction {
563
563
  constructor() {
564
564
  super({
565
565
  id: InsertLineAfterAction.ID,
566
- label: nls.localize2(1276, "Insert Line Below"),
566
+ label: nls.localize2(1278, "Insert Line Below"),
567
567
  precondition: EditorContextKeys.writable,
568
568
  kbOpts: {
569
569
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -615,7 +615,7 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
615
615
  constructor() {
616
616
  super({
617
617
  id: 'deleteAllLeft',
618
- label: nls.localize2(1277, "Delete All Left"),
618
+ label: nls.localize2(1279, "Delete All Left"),
619
619
  precondition: EditorContextKeys.writable,
620
620
  kbOpts: {
621
621
  kbExpr: EditorContextKeys.textInputFocus,
@@ -685,7 +685,7 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
685
685
  constructor() {
686
686
  super({
687
687
  id: 'deleteAllRight',
688
- label: nls.localize2(1278, "Delete All Right"),
688
+ label: nls.localize2(1280, "Delete All Right"),
689
689
  precondition: EditorContextKeys.writable,
690
690
  kbOpts: {
691
691
  kbExpr: EditorContextKeys.textInputFocus,
@@ -743,7 +743,7 @@ export class JoinLinesAction extends EditorAction {
743
743
  constructor() {
744
744
  super({
745
745
  id: 'editor.action.joinLines',
746
- label: nls.localize2(1279, "Join Lines"),
746
+ label: nls.localize2(1281, "Join Lines"),
747
747
  precondition: EditorContextKeys.writable,
748
748
  kbOpts: {
749
749
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -885,7 +885,7 @@ export class TransposeAction extends EditorAction {
885
885
  constructor() {
886
886
  super({
887
887
  id: 'editor.action.transpose',
888
- label: nls.localize2(1280, "Transpose Characters around the Cursor"),
888
+ label: nls.localize2(1282, "Transpose Characters around the Cursor"),
889
889
  precondition: EditorContextKeys.writable,
890
890
  canTriggerInlineEdits: true,
891
891
  });
@@ -965,7 +965,7 @@ export class UpperCaseAction extends AbstractCaseAction {
965
965
  constructor() {
966
966
  super({
967
967
  id: 'editor.action.transformToUppercase',
968
- label: nls.localize2(1281, "Transform to Uppercase"),
968
+ label: nls.localize2(1283, "Transform to Uppercase"),
969
969
  precondition: EditorContextKeys.writable,
970
970
  canTriggerInlineEdits: true,
971
971
  });
@@ -978,7 +978,7 @@ export class LowerCaseAction extends AbstractCaseAction {
978
978
  constructor() {
979
979
  super({
980
980
  id: 'editor.action.transformToLowercase',
981
- label: nls.localize2(1282, "Transform to Lowercase"),
981
+ label: nls.localize2(1284, "Transform to Lowercase"),
982
982
  precondition: EditorContextKeys.writable,
983
983
  canTriggerInlineEdits: true
984
984
  });
@@ -1015,7 +1015,7 @@ export class TitleCaseAction extends AbstractCaseAction {
1015
1015
  constructor() {
1016
1016
  super({
1017
1017
  id: 'editor.action.transformToTitlecase',
1018
- label: nls.localize2(1283, "Transform to Title Case"),
1018
+ label: nls.localize2(1285, "Transform to Title Case"),
1019
1019
  precondition: EditorContextKeys.writable,
1020
1020
  canTriggerInlineEdits: true
1021
1021
  });
@@ -1037,7 +1037,7 @@ export class SnakeCaseAction extends AbstractCaseAction {
1037
1037
  constructor() {
1038
1038
  super({
1039
1039
  id: 'editor.action.transformToSnakecase',
1040
- label: nls.localize2(1284, "Transform to Snake Case"),
1040
+ label: nls.localize2(1286, "Transform to Snake Case"),
1041
1041
  precondition: EditorContextKeys.writable,
1042
1042
  canTriggerInlineEdits: true,
1043
1043
  });
@@ -1062,7 +1062,7 @@ export class CamelCaseAction extends AbstractCaseAction {
1062
1062
  constructor() {
1063
1063
  super({
1064
1064
  id: 'editor.action.transformToCamelcase',
1065
- label: nls.localize2(1285, "Transform to Camel Case"),
1065
+ label: nls.localize2(1287, "Transform to Camel Case"),
1066
1066
  precondition: EditorContextKeys.writable,
1067
1067
  canTriggerInlineEdits: true
1068
1068
  });
@@ -1087,7 +1087,7 @@ export class PascalCaseAction extends AbstractCaseAction {
1087
1087
  constructor() {
1088
1088
  super({
1089
1089
  id: 'editor.action.transformToPascalcase',
1090
- label: nls.localize2(1286, "Transform to Pascal Case"),
1090
+ label: nls.localize2(1288, "Transform to Pascal Case"),
1091
1091
  precondition: EditorContextKeys.writable,
1092
1092
  canTriggerInlineEdits: true,
1093
1093
  });
@@ -1127,7 +1127,7 @@ export class KebabCaseAction extends AbstractCaseAction {
1127
1127
  constructor() {
1128
1128
  super({
1129
1129
  id: 'editor.action.transformToKebabcase',
1130
- label: nls.localize2(1287, 'Transform to Kebab Case'),
1130
+ label: nls.localize2(1289, 'Transform to Kebab Case'),
1131
1131
  precondition: EditorContextKeys.writable,
1132
1132
  canTriggerInlineEdits: true,
1133
1133
  });
@@ -299,7 +299,7 @@ export class LinkedEditingAction extends EditorAction {
299
299
  constructor() {
300
300
  super({
301
301
  id: 'editor.action.linkedEditing',
302
- label: nls.localize2(1289, "Start Linked Editing"),
302
+ label: nls.localize2(1291, "Start Linked Editing"),
303
303
  precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider),
304
304
  kbOpts: {
305
305
  kbExpr: EditorContextKeys.editorTextFocus,
@@ -360,7 +360,7 @@ function getLinkedEditingRanges(providers, model, position, token) {
360
360
  }
361
361
  }), result => !!result && arrays.isNonEmptyArray(result?.ranges));
362
362
  }
363
- export const editorLinkedEditingBackground = registerColor('editor.linkedEditingBackground', { dark: Color.fromHex('#f00').transparent(0.3), light: Color.fromHex('#f00').transparent(0.3), hcDark: Color.fromHex('#f00').transparent(0.3), hcLight: Color.white }, nls.localize(1288, 'Background color when the editor auto renames on type.'));
363
+ export const editorLinkedEditingBackground = registerColor('editor.linkedEditingBackground', { dark: Color.fromHex('#f00').transparent(0.3), light: Color.fromHex('#f00').transparent(0.3), hcDark: Color.fromHex('#f00').transparent(0.3), hcLight: Color.white }, nls.localize(1290, 'Background color when the editor auto renames on type.'));
364
364
  registerModelAndPositionCommand('_executeLinkedEditingProvider', (_accessor, model, position) => {
365
365
  const { linkedEditingRangeProvider } = _accessor.get(ILanguageFeaturesService);
366
366
  return getLinkedEditingRanges(linkedEditingRangeProvider, model, position, CancellationToken.None);