monaco-editor-core 0.54.0 → 0.55.0-dev-20251007

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 (251) hide show
  1. package/esm/nls.messages.de.js +1 -1
  2. package/esm/nls.messages.es.js +1 -1
  3. package/esm/nls.messages.fr.js +1 -1
  4. package/esm/nls.messages.it.js +1 -1
  5. package/esm/nls.messages.ja.js +1 -1
  6. package/esm/nls.messages.ko.js +1 -1
  7. package/esm/nls.messages.ru.js +1 -1
  8. package/esm/nls.messages.zh-cn.js +1 -1
  9. package/esm/nls.messages.zh-tw.js +1 -1
  10. package/esm/vs/base/browser/canIUse.js +1 -0
  11. package/esm/vs/base/browser/canIUse.js.map +1 -1
  12. package/esm/vs/base/browser/dom.js +9 -0
  13. package/esm/vs/base/browser/dom.js.map +1 -1
  14. package/esm/vs/base/browser/fastDomNode.js.map +1 -1
  15. package/esm/vs/base/browser/mouseEvent.js +3 -0
  16. package/esm/vs/base/browser/mouseEvent.js.map +1 -1
  17. package/esm/vs/base/browser/trustedTypes.js +2 -0
  18. package/esm/vs/base/browser/trustedTypes.js.map +1 -1
  19. package/esm/vs/base/browser/ui/list/listWidget.js +5 -5
  20. package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
  21. package/esm/vs/base/browser/ui/sash/sash.css +1 -1
  22. package/esm/vs/base/browser/ui/sash/sash.js +4 -0
  23. package/esm/vs/base/browser/ui/sash/sash.js.map +1 -1
  24. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +1 -1
  25. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
  26. package/esm/vs/base/browser/ui/table/table.css +2 -2
  27. package/esm/vs/base/browser/ui/tree/abstractTree.js +7 -3
  28. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  29. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +4 -0
  30. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  31. package/esm/vs/base/browser/ui/tree/indexTreeModel.js +1 -0
  32. package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
  33. package/esm/vs/base/browser/ui/tree/media/tree.css +2 -2
  34. package/esm/vs/base/browser/webWorkerFactory.js +3 -0
  35. package/esm/vs/base/browser/webWorkerFactory.js.map +1 -1
  36. package/esm/vs/base/common/buffer.js.map +1 -1
  37. package/esm/vs/base/common/decorators.js +1 -0
  38. package/esm/vs/base/common/decorators.js.map +1 -1
  39. package/esm/vs/base/common/errors.js +1 -0
  40. package/esm/vs/base/common/errors.js.map +1 -1
  41. package/esm/vs/base/common/glob.js +1 -1
  42. package/esm/vs/base/common/glob.js.map +1 -1
  43. package/esm/vs/base/common/hash.js.map +1 -1
  44. package/esm/vs/base/common/hotReload.js +2 -0
  45. package/esm/vs/base/common/hotReload.js.map +1 -1
  46. package/esm/vs/base/common/hotReloadHelpers.js +1 -0
  47. package/esm/vs/base/common/hotReloadHelpers.js.map +1 -1
  48. package/esm/vs/base/common/lifecycle.js +19 -0
  49. package/esm/vs/base/common/lifecycle.js.map +1 -1
  50. package/esm/vs/base/common/map.js.map +1 -1
  51. package/esm/vs/base/common/marshalling.js +4 -0
  52. package/esm/vs/base/common/marshalling.js.map +1 -1
  53. package/esm/vs/base/common/network.js +1 -0
  54. package/esm/vs/base/common/network.js.map +1 -1
  55. package/esm/vs/base/common/objects.js +1 -0
  56. package/esm/vs/base/common/objects.js.map +1 -1
  57. package/esm/vs/base/common/observableInternal/changeTracker.js +4 -0
  58. package/esm/vs/base/common/observableInternal/changeTracker.js.map +1 -1
  59. package/esm/vs/base/common/observableInternal/debugLocation.js +1 -0
  60. package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
  61. package/esm/vs/base/common/observableInternal/debugName.js +1 -0
  62. package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
  63. package/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js +1 -0
  64. package/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js.map +1 -1
  65. package/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js +1 -0
  66. package/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js.map +1 -1
  67. package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js +1 -0
  68. package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js.map +1 -1
  69. package/esm/vs/base/common/observableInternal/observables/derived.js +7 -1
  70. package/esm/vs/base/common/observableInternal/observables/derived.js.map +1 -1
  71. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +2 -0
  72. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
  73. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -0
  74. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
  75. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +1 -0
  76. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
  77. package/esm/vs/base/common/process.js +1 -0
  78. package/esm/vs/base/common/process.js.map +1 -1
  79. package/esm/vs/base/common/product.js.map +1 -1
  80. package/esm/vs/base/common/types.js +2 -0
  81. package/esm/vs/base/common/types.js.map +1 -1
  82. package/esm/vs/base/common/worker/webWorker.js +26 -14
  83. package/esm/vs/base/common/worker/webWorker.js.map +1 -1
  84. package/esm/vs/base/parts/sandbox/common/sandboxTypes.js +2 -0
  85. package/esm/vs/base/parts/sandbox/common/sandboxTypes.js.map +1 -0
  86. package/esm/vs/editor/browser/config/editorConfiguration.js +3 -2
  87. package/esm/vs/editor/browser/config/editorConfiguration.js.map +1 -1
  88. package/esm/vs/editor/browser/config/migrateOptions.js +1 -1
  89. package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
  90. package/esm/vs/editor/browser/controller/editContext/native/editContextFactory.js.map +1 -1
  91. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js +2 -0
  92. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js.map +1 -1
  93. package/esm/vs/editor/browser/controller/mouseHandler.js +2 -1
  94. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  95. package/esm/vs/editor/browser/controller/mouseTarget.js +7 -0
  96. package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
  97. package/esm/vs/editor/browser/controller/pointerHandler.js.map +1 -1
  98. package/esm/vs/editor/browser/coreCommands.js.map +1 -1
  99. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  100. package/esm/vs/editor/browser/editorDom.js.map +1 -1
  101. package/esm/vs/editor/browser/editorExtensions.js.map +1 -1
  102. package/esm/vs/editor/browser/gpu/gpuUtils.js +1 -0
  103. package/esm/vs/editor/browser/gpu/gpuUtils.js.map +1 -1
  104. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -0
  105. package/esm/vs/editor/browser/gpu/viewGpuContext.js.map +1 -1
  106. package/esm/vs/editor/browser/services/abstractCodeEditorService.js.map +1 -1
  107. package/esm/vs/editor/browser/services/bulkEditService.js.map +1 -1
  108. package/esm/vs/editor/browser/services/codeEditorService.js.map +1 -1
  109. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  110. package/esm/vs/editor/browser/services/hoverService/hover.css +2 -0
  111. package/esm/vs/editor/browser/services/hoverService/hoverService.js.map +1 -1
  112. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
  113. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
  114. package/esm/vs/editor/browser/services/inlineCompletionsService.js +8 -8
  115. package/esm/vs/editor/browser/services/inlineCompletionsService.js.map +1 -1
  116. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  117. package/esm/vs/editor/browser/view/viewLayer.js +1 -1
  118. package/esm/vs/editor/browser/view/viewLayer.js.map +1 -1
  119. package/esm/vs/editor/browser/view.js.map +1 -1
  120. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +1 -0
  121. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  122. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +1 -0
  123. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js.map +1 -1
  124. package/esm/vs/editor/browser/widget/codeEditor/codeEditorContributions.js.map +1 -1
  125. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +4 -1
  126. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  127. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -0
  128. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js.map +1 -1
  129. package/esm/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.js.map +1 -1
  130. package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -0
  131. package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js.map +1 -1
  132. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +1 -0
  133. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
  134. package/esm/vs/editor/browser/widget/diffEditor/utils.js +2 -0
  135. package/esm/vs/editor/browser/widget/diffEditor/utils.js.map +1 -1
  136. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -0
  137. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
  138. package/esm/vs/editor/common/config/editorOptions.js +122 -68
  139. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  140. package/esm/vs/editor/common/config/fontInfo.js +32 -16
  141. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  142. package/esm/vs/editor/common/config/fontInfoFromSettings.js +16 -0
  143. package/esm/vs/editor/common/config/fontInfoFromSettings.js.map +1 -0
  144. package/esm/vs/editor/common/core/edits/edit.js +1 -0
  145. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  146. package/esm/vs/editor/common/core/edits/stringEdit.js +2 -0
  147. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  148. package/esm/vs/editor/common/core/position.js +1 -1
  149. package/esm/vs/editor/common/core/position.js.map +1 -1
  150. package/esm/vs/editor/common/core/range.js +1 -1
  151. package/esm/vs/editor/common/core/range.js.map +1 -1
  152. package/esm/vs/editor/common/core/selection.js +1 -1
  153. package/esm/vs/editor/common/core/selection.js.map +1 -1
  154. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  155. package/esm/vs/editor/common/editorCommon.js.map +1 -1
  156. package/esm/vs/editor/common/languages.js +1 -1
  157. package/esm/vs/editor/common/languages.js.map +1 -1
  158. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js +14 -0
  159. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js.map +1 -1
  160. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js +2 -0
  161. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js.map +1 -1
  162. package/esm/vs/editor/common/model/textModel.js +1 -1
  163. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  164. package/esm/vs/editor/common/model.js +1 -1
  165. package/esm/vs/editor/common/model.js.map +1 -1
  166. package/esm/vs/editor/common/services/editorBaseApi.js.map +1 -1
  167. package/esm/vs/editor/common/services/editorWebWorker.js +1 -0
  168. package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
  169. package/esm/vs/editor/common/services/editorWorkerHost.js.map +1 -1
  170. package/esm/vs/editor/common/services/modelService.js +14 -21
  171. package/esm/vs/editor/common/services/modelService.js.map +1 -1
  172. package/esm/vs/editor/common/textModelEditSource.js +2 -0
  173. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  174. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +40 -1
  175. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  176. package/esm/vs/editor/common/viewModel/viewModelImpl.js +2 -1
  177. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  178. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +1 -1
  179. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js.map +1 -1
  180. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +1 -1
  181. package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
  182. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +1 -0
  183. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
  184. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +1 -0
  185. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
  186. package/esm/vs/editor/contrib/find/browser/findModel.js +1 -0
  187. package/esm/vs/editor/contrib/find/browser/findModel.js.map +1 -1
  188. package/esm/vs/editor/contrib/find/browser/findWidget.css +5 -5
  189. package/esm/vs/editor/contrib/folding/browser/folding.css +4 -4
  190. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
  191. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  192. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js.map +1 -1
  193. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +30 -14
  194. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  195. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +4 -3
  196. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  197. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +56 -7
  198. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  199. package/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js +1 -0
  200. package/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js.map +1 -1
  201. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +2 -0
  202. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  203. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -0
  204. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  205. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
  206. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  207. package/esm/vs/editor/contrib/rename/browser/renameWidget.js.map +1 -1
  208. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.css +2 -0
  209. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +2 -0
  210. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
  211. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js.map +1 -1
  212. package/esm/vs/editor/editor.api.d.ts +8 -8
  213. package/esm/vs/editor/editor.api.js +4 -0
  214. package/esm/vs/editor/editor.api.js.map +1 -1
  215. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
  216. package/esm/vs/editor/standalone/browser/standaloneEditor.js +37 -0
  217. package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
  218. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +37 -0
  219. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  220. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  221. package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
  222. package/esm/vs/editor/standalone/common/monarch/monarchCompile.js +3 -0
  223. package/esm/vs/editor/standalone/common/monarch/monarchCompile.js.map +1 -1
  224. package/esm/vs/platform/accessibility/browser/accessibilityService.js +2 -2
  225. package/esm/vs/platform/accessibility/browser/accessibilityService.js.map +1 -1
  226. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  227. package/esm/vs/platform/commands/common/commands.js.map +1 -1
  228. package/esm/vs/platform/contextkey/common/contextkey.js +5 -0
  229. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  230. package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js +1 -0
  231. package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js.map +1 -1
  232. package/esm/vs/platform/dnd/browser/dnd.js +2 -0
  233. package/esm/vs/platform/dnd/browser/dnd.js.map +1 -1
  234. package/esm/vs/platform/instantiation/common/descriptors.js.map +1 -1
  235. package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
  236. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -0
  237. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  238. package/esm/vs/platform/list/browser/listService.js +5 -0
  239. package/esm/vs/platform/list/browser/listService.js.map +1 -1
  240. package/esm/vs/platform/log/common/log.js.map +1 -1
  241. package/esm/vs/platform/log/common/logService.js.map +1 -1
  242. package/esm/vs/platform/observable/common/wrapInHotClass.js +2 -0
  243. package/esm/vs/platform/observable/common/wrapInHotClass.js.map +1 -1
  244. package/esm/vs/platform/observable/common/wrapInReloadableClass.js +3 -0
  245. package/esm/vs/platform/observable/common/wrapInReloadableClass.js.map +1 -1
  246. package/esm/vs/platform/product/common/product.js +69 -0
  247. package/esm/vs/platform/product/common/product.js.map +1 -0
  248. package/esm/vs/platform/quickinput/browser/quickInput.js +1 -1
  249. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  250. package/monaco.d.ts +8 -8
  251. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/contrib/contextmenu/browser/contextmenu.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAE1F,OAAO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oot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../../base/browser/dom.js';\nimport { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';\nimport { IMouseEvent, IMouseWheelEvent } from '../../../../base/browser/mouseEvent.js';\nimport { ActionViewItem } from '../../../../base/browser/ui/actionbar/actionViewItems.js';\nimport { IAnchor } from '../../../../base/browser/ui/contextview/contextview.js';\nimport { IAction, Separator, SubmenuAction } from '../../../../base/common/actions.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport { ResolvedKeybinding } from '../../../../base/common/keybindings.js';\nimport { DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { isIOS } from '../../../../base/common/platform.js';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IEditorContribution, ScrollType } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { ITextModel } from '../../../common/model.js';\nimport * as nls from '../../../../nls.js';\nimport { IMenuService, MenuId, SubmenuItemAction } from '../../../../platform/actions/common/actions.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IContextMenuService, IContextViewService } from '../../../../platform/contextview/browser/contextView.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IWorkspaceContextService, isStandaloneEditorWorkspace } from '../../../../platform/workspace/common/workspace.js';\n\nexport class ContextMenuController implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.contextmenu';\n\n\tpublic static get(editor: ICodeEditor): ContextMenuController | null {\n\t\treturn editor.getContribution<ContextMenuController>(ContextMenuController.ID);\n\t}\n\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate _contextMenuIsBeingShownCount: number = 0;\n\tprivate readonly _editor: ICodeEditor;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IContextViewService private readonly _contextViewService: IContextViewService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IMenuService private readonly _menuService: IMenuService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService,\n\t) {\n\t\tthis._editor = editor;\n\n\t\tthis._toDispose.add(this._editor.onContextMenu((e: IEditorMouseEvent) => this._onContextMenu(e)));\n\t\tthis._toDispose.add(this._editor.onMouseWheel((e: IMouseWheelEvent) => {\n\t\t\tif (this._contextMenuIsBeingShownCount > 0) {\n\t\t\t\tconst view = this._contextViewService.getContextViewElement();\n\t\t\t\tconst target = e.srcElement as HTMLElement;\n\n\t\t\t\t// Event triggers on shadow root host first\n\t\t\t\t// Check if the context view is under this host before hiding it #103169\n\t\t\t\tif (!(target.shadowRoot && dom.getShadowRoot(view) === target.shadowRoot)) {\n\t\t\t\t\tthis._contextViewService.hideContextView();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onKeyDown((e: IKeyboardEvent) => {\n\t\t\tif (!this._editor.getOption(EditorOption.contextmenu)) {\n\t\t\t\treturn; // Context menu is turned off through configuration\n\t\t\t}\n\t\t\tif (e.keyCode === KeyCode.ContextMenu) {\n\t\t\t\t// Chrome is funny like that\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tthis.showContextMenu();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _onContextMenu(e: IEditorMouseEvent): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._editor.getOption(EditorOption.contextmenu)) {\n\t\t\tthis._editor.focus();\n\t\t\t// Ensure the cursor is at the position of the mouse click\n\t\t\tif (e.target.position && !this._editor.getSelection().containsPosition(e.target.position)) {\n\t\t\t\tthis._editor.setPosition(e.target.position);\n\t\t\t}\n\t\t\treturn; // Context menu is turned off through configuration\n\t\t}\n\n\t\tif (e.target.type === MouseTargetType.OVERLAY_WIDGET) {\n\t\t\treturn; // allow native menu on widgets to support right click on input field for example in find\n\t\t}\n\t\tif (e.target.type === MouseTargetType.CONTENT_TEXT && e.target.detail.injectedText) {\n\t\t\treturn; // allow native menu on injected text\n\t\t}\n\n\t\te.event.preventDefault();\n\t\te.event.stopPropagation();\n\n\t\tif (e.target.type === MouseTargetType.SCROLLBAR) {\n\t\t\treturn this._showScrollbarContextMenu(e.event);\n\t\t}\n\n\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT && e.target.type !== MouseTargetType.CONTENT_EMPTY && e.target.type !== MouseTargetType.TEXTAREA) {\n\t\t\treturn; // only support mouse click into text or native context menu key for now\n\t\t}\n\n\t\t// Ensure the editor gets focus if it hasn't, so the right events are being sent to other contributions\n\t\tthis._editor.focus();\n\n\t\t// Ensure the cursor is at the position of the mouse click\n\t\tif (e.target.position) {\n\t\t\tlet hasSelectionAtPosition = false;\n\t\t\tfor (const selection of this._editor.getSelections()) {\n\t\t\t\tif (selection.containsPosition(e.target.position)) {\n\t\t\t\t\thasSelectionAtPosition = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!hasSelectionAtPosition) {\n\t\t\t\tthis._editor.setPosition(e.target.position);\n\t\t\t}\n\t\t}\n\n\t\t// Unless the user triggerd the context menu through Shift+F10, use the mouse position as menu position\n\t\tlet anchor: IMouseEvent | null = null;\n\t\tif (e.target.type !== MouseTargetType.TEXTAREA) {\n\t\t\tanchor = e.event;\n\t\t}\n\n\t\t// Show the context menu\n\t\tthis.showContextMenu(anchor);\n\t}\n\n\tpublic showContextMenu(anchor?: IMouseEvent | null): void {\n\t\tif (!this._editor.getOption(EditorOption.contextmenu)) {\n\t\t\treturn; // Context menu is turned off through configuration\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find actions available for menu\n\t\tconst menuActions = this._getMenuActions(this._editor.getModel(),\n\t\t\tthis._editor.contextMenuId);\n\n\t\t// Show menu if we have actions to show\n\t\tif (menuActions.length > 0) {\n\t\t\tthis._doShowContextMenu(menuActions, anchor);\n\t\t}\n\t}\n\n\tprivate _getMenuActions(model: ITextModel, menuId: MenuId): IAction[] {\n\t\tconst result: IAction[] = [];\n\n\t\t// get menu groups\n\t\tconst groups = this._menuService.getMenuActions(menuId, this._contextKeyService, { arg: model.uri });\n\n\t\t// translate them into other actions\n\t\tfor (const group of groups) {\n\t\t\tconst [, actions] = group;\n\t\t\tlet addedItems = 0;\n\t\t\tfor (const action of actions) {\n\t\t\t\tif (action instanceof SubmenuItemAction) {\n\t\t\t\t\tconst subActions = this._getMenuActions(model, action.item.submenu);\n\t\t\t\t\tif (subActions.length > 0) {\n\t\t\t\t\t\tresult.push(new SubmenuAction(action.id, action.label, subActions));\n\t\t\t\t\t\taddedItems++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresult.push(action);\n\t\t\t\t\taddedItems++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (addedItems) {\n\t\t\t\tresult.push(new Separator());\n\t\t\t}\n\t\t}\n\n\t\tif (result.length) {\n\t\t\tresult.pop(); // remove last separator\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _doShowContextMenu(actions: IAction[], event: IMouseEvent | null = null): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet anchor: IMouseEvent | IAnchor | null = event;\n\t\tif (!anchor) {\n\t\t\t// Ensure selection is visible\n\t\t\tthis._editor.revealPosition(this._editor.getPosition(), ScrollType.Immediate);\n\n\t\t\tthis._editor.render();\n\t\t\tconst cursorCoords = this._editor.getScrolledVisiblePosition(this._editor.getPosition());\n\n\t\t\t// Translate to absolute editor position\n\t\t\tconst editorCoords = dom.getDomNodePagePosition(this._editor.getDomNode());\n\t\t\tconst posx = editorCoords.left + cursorCoords.left;\n\t\t\tconst posy = editorCoords.top + cursorCoords.top + cursorCoords.height;\n\n\t\t\tanchor = { x: posx, y: posy };\n\t\t}\n\n\t\tconst useShadowDOM = this._editor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\n\t\t// Show menu\n\t\tthis._contextMenuIsBeingShownCount++;\n\t\tthis._contextMenuService.showContextMenu({\n\t\t\tdomForShadowRoot: useShadowDOM ? this._editor.getOverflowWidgetsDomNode() ?? this._editor.getDomNode() : undefined,\n\n\t\t\tgetAnchor: () => anchor,\n\n\t\t\tgetActions: () => actions,\n\n\t\t\tgetActionViewItem: (action) => {\n\t\t\t\tconst keybinding = this._keybindingFor(action);\n\t\t\t\tif (keybinding) {\n\t\t\t\t\treturn new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true });\n\t\t\t\t}\n\n\t\t\t\tconst customActionViewItem = <any>action;\n\t\t\t\tif (typeof customActionViewItem.getActionViewItem === 'function') {\n\t\t\t\t\treturn customActionViewItem.getActionViewItem();\n\t\t\t\t}\n\n\t\t\t\treturn new ActionViewItem(action, action, { icon: true, label: true, isMenu: true });\n\t\t\t},\n\n\t\t\tgetKeyBinding: (action): ResolvedKeybinding | undefined => {\n\t\t\t\treturn this._keybindingFor(action);\n\t\t\t},\n\n\t\t\tonHide: (wasCancelled: boolean) => {\n\t\t\t\tthis._contextMenuIsBeingShownCount--;\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _showScrollbarContextMenu(anchor: IMouseEvent): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isStandaloneEditorWorkspace(this._workspaceContextService.getWorkspace())) {\n\t\t\t// can't update the configuration properly in the standalone editor\n\t\t\treturn;\n\t\t}\n\n\t\tconst minimapOptions = this._editor.getOption(EditorOption.minimap);\n\n\t\tlet lastId = 0;\n\t\tconst createAction = (opts: { label: string; enabled?: boolean; checked?: boolean; run: () => void }): IAction => {\n\t\t\treturn {\n\t\t\t\tid: `menu-action-${++lastId}`,\n\t\t\t\tlabel: opts.label,\n\t\t\t\ttooltip: '',\n\t\t\t\tclass: undefined,\n\t\t\t\tenabled: (typeof opts.enabled === 'undefined' ? true : opts.enabled),\n\t\t\t\tchecked: opts.checked,\n\t\t\t\trun: opts.run\n\t\t\t};\n\t\t};\n\t\tconst createSubmenuAction = (label: string, actions: IAction[]): SubmenuAction => {\n\t\t\treturn new SubmenuAction(\n\t\t\t\t`menu-action-${++lastId}`,\n\t\t\t\tlabel,\n\t\t\t\tactions,\n\t\t\t\tundefined\n\t\t\t);\n\t\t};\n\t\tconst createEnumAction = <T>(label: string, enabled: boolean, configName: string, configuredValue: T, options: { label: string; value: T }[]): IAction => {\n\t\t\tif (!enabled) {\n\t\t\t\treturn createAction({ label, enabled, run: () => { } });\n\t\t\t}\n\t\t\tconst createRunner = (value: T) => {\n\t\t\t\treturn () => {\n\t\t\t\t\tthis._configurationService.updateValue(configName, value);\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst actions: IAction[] = [];\n\t\t\tfor (const option of options) {\n\t\t\t\tactions.push(createAction({\n\t\t\t\t\tlabel: option.label,\n\t\t\t\t\tchecked: configuredValue === option.value,\n\t\t\t\t\trun: createRunner(option.value)\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn createSubmenuAction(\n\t\t\t\tlabel,\n\t\t\t\tactions\n\t\t\t);\n\t\t};\n\n\t\tconst actions: IAction[] = [];\n\t\tactions.push(createAction({\n\t\t\tlabel: nls.localize('context.minimap.minimap', \"Minimap\"),\n\t\t\tchecked: minimapOptions.enabled,\n\t\t\trun: () => {\n\t\t\t\tthis._configurationService.updateValue(`editor.minimap.enabled`, !minimapOptions.enabled);\n\t\t\t}\n\t\t}));\n\t\tactions.push(new Separator());\n\t\tactions.push(createAction({\n\t\t\tlabel: nls.localize('context.minimap.renderCharacters', \"Render Characters\"),\n\t\t\tenabled: minimapOptions.enabled,\n\t\t\tchecked: minimapOptions.renderCharacters,\n\t\t\trun: () => {\n\t\t\t\tthis._configurationService.updateValue(`editor.minimap.renderCharacters`, !minimapOptions.renderCharacters);\n\t\t\t}\n\t\t}));\n\t\tactions.push(createEnumAction<'proportional' | 'fill' | 'fit'>(\n\t\t\tnls.localize('context.minimap.size', \"Vertical size\"),\n\t\t\tminimapOptions.enabled,\n\t\t\t'editor.minimap.size',\n\t\t\tminimapOptions.size,\n\t\t\t[{\n\t\t\t\tlabel: nls.localize('context.minimap.size.proportional', \"Proportional\"),\n\t\t\t\tvalue: 'proportional'\n\t\t\t}, {\n\t\t\t\tlabel: nls.localize('context.minimap.size.fill', \"Fill\"),\n\t\t\t\tvalue: 'fill'\n\t\t\t}, {\n\t\t\t\tlabel: nls.localize('context.minimap.size.fit', \"Fit\"),\n\t\t\t\tvalue: 'fit'\n\t\t\t}]\n\t\t));\n\t\tactions.push(createEnumAction<'always' | 'mouseover'>(\n\t\t\tnls.localize('context.minimap.slider', \"Slider\"),\n\t\t\tminimapOptions.enabled,\n\t\t\t'editor.minimap.showSlider',\n\t\t\tminimapOptions.showSlider,\n\t\t\t[{\n\t\t\t\tlabel: nls.localize('context.minimap.slider.mouseover', \"Mouse Over\"),\n\t\t\t\tvalue: 'mouseover'\n\t\t\t}, {\n\t\t\t\tlabel: nls.localize('context.minimap.slider.always', \"Always\"),\n\t\t\t\tvalue: 'always'\n\t\t\t}]\n\t\t));\n\n\t\tconst useShadowDOM = this._editor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\t\tthis._contextMenuIsBeingShownCount++;\n\t\tthis._contextMenuService.showContextMenu({\n\t\t\tdomForShadowRoot: useShadowDOM ? this._editor.getDomNode() : undefined,\n\t\t\tgetAnchor: () => anchor,\n\t\t\tgetActions: () => actions,\n\t\t\tonHide: (wasCancelled: boolean) => {\n\t\t\t\tthis._contextMenuIsBeingShownCount--;\n\t\t\t\tthis._editor.focus();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _keybindingFor(action: IAction): ResolvedKeybinding | undefined {\n\t\treturn this._keybindingService.lookupKeybinding(action.id);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._contextMenuIsBeingShownCount > 0) {\n\t\t\tthis._contextViewService.hideContextView();\n\t\t}\n\n\t\tthis._toDispose.dispose();\n\t}\n}\n\nclass ShowContextMenu extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.showContextMenu',\n\t\t\tlabel: nls.localize2('action.showContextMenu.label', \"Show Editor Context Menu\"),\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.F10,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tContextMenuController.get(editor)?.showContextMenu();\n\t}\n}\n\nregisterEditorContribution(ContextMenuController.ID, ContextMenuController, EditorContributionInstantiation.BeforeFirstInteraction);\nregisterEditorAction(ShowContextMenu);\n"]}
1
+ {"version":3,"sources":["vs/editor/contrib/contextmenu/browser/contextmenu.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAE1F,OAAO,EAAW,SAAS,EAAE,aAAa,EA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/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../../base/browser/dom.js';\nimport { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';\nimport { IMouseEvent, IMouseWheelEvent } from '../../../../base/browser/mouseEvent.js';\nimport { ActionViewItem } from '../../../../base/browser/ui/actionbar/actionViewItems.js';\nimport { IAnchor } from '../../../../base/browser/ui/contextview/contextview.js';\nimport { IAction, Separator, SubmenuAction } from '../../../../base/common/actions.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport { ResolvedKeybinding } from '../../../../base/common/keybindings.js';\nimport { DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { isIOS } from '../../../../base/common/platform.js';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IEditorContribution, ScrollType } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { ITextModel } from '../../../common/model.js';\nimport * as nls from '../../../../nls.js';\nimport { IMenuService, MenuId, SubmenuItemAction } from '../../../../platform/actions/common/actions.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IContextMenuService, IContextViewService } from '../../../../platform/contextview/browser/contextView.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IWorkspaceContextService, isStandaloneEditorWorkspace } from '../../../../platform/workspace/common/workspace.js';\n\nexport class ContextMenuController implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.contextmenu';\n\n\tpublic static get(editor: ICodeEditor): ContextMenuController | null {\n\t\treturn editor.getContribution<ContextMenuController>(ContextMenuController.ID);\n\t}\n\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate _contextMenuIsBeingShownCount: number = 0;\n\tprivate readonly _editor: ICodeEditor;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IContextViewService private readonly _contextViewService: IContextViewService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IMenuService private readonly _menuService: IMenuService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService,\n\t) {\n\t\tthis._editor = editor;\n\n\t\tthis._toDispose.add(this._editor.onContextMenu((e: IEditorMouseEvent) => this._onContextMenu(e)));\n\t\tthis._toDispose.add(this._editor.onMouseWheel((e: IMouseWheelEvent) => {\n\t\t\tif (this._contextMenuIsBeingShownCount > 0) {\n\t\t\t\tconst view = this._contextViewService.getContextViewElement();\n\t\t\t\tconst target = e.srcElement as HTMLElement;\n\n\t\t\t\t// Event triggers on shadow root host first\n\t\t\t\t// Check if the context view is under this host before hiding it #103169\n\t\t\t\tif (!(target.shadowRoot && dom.getShadowRoot(view) === target.shadowRoot)) {\n\t\t\t\t\tthis._contextViewService.hideContextView();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onKeyDown((e: IKeyboardEvent) => {\n\t\t\tif (!this._editor.getOption(EditorOption.contextmenu)) {\n\t\t\t\treturn; // Context menu is turned off through configuration\n\t\t\t}\n\t\t\tif (e.keyCode === KeyCode.ContextMenu) {\n\t\t\t\t// Chrome is funny like that\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tthis.showContextMenu();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _onContextMenu(e: IEditorMouseEvent): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._editor.getOption(EditorOption.contextmenu)) {\n\t\t\tthis._editor.focus();\n\t\t\t// Ensure the cursor is at the position of the mouse click\n\t\t\tif (e.target.position && !this._editor.getSelection().containsPosition(e.target.position)) {\n\t\t\t\tthis._editor.setPosition(e.target.position);\n\t\t\t}\n\t\t\treturn; // Context menu is turned off through configuration\n\t\t}\n\n\t\tif (e.target.type === MouseTargetType.OVERLAY_WIDGET) {\n\t\t\treturn; // allow native menu on widgets to support right click on input field for example in find\n\t\t}\n\t\tif (e.target.type === MouseTargetType.CONTENT_TEXT && e.target.detail.injectedText) {\n\t\t\treturn; // allow native menu on injected text\n\t\t}\n\n\t\te.event.preventDefault();\n\t\te.event.stopPropagation();\n\n\t\tif (e.target.type === MouseTargetType.SCROLLBAR) {\n\t\t\treturn this._showScrollbarContextMenu(e.event);\n\t\t}\n\n\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT && e.target.type !== MouseTargetType.CONTENT_EMPTY && e.target.type !== MouseTargetType.TEXTAREA) {\n\t\t\treturn; // only support mouse click into text or native context menu key for now\n\t\t}\n\n\t\t// Ensure the editor gets focus if it hasn't, so the right events are being sent to other contributions\n\t\tthis._editor.focus();\n\n\t\t// Ensure the cursor is at the position of the mouse click\n\t\tif (e.target.position) {\n\t\t\tlet hasSelectionAtPosition = false;\n\t\t\tfor (const selection of this._editor.getSelections()) {\n\t\t\t\tif (selection.containsPosition(e.target.position)) {\n\t\t\t\t\thasSelectionAtPosition = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!hasSelectionAtPosition) {\n\t\t\t\tthis._editor.setPosition(e.target.position);\n\t\t\t}\n\t\t}\n\n\t\t// Unless the user triggerd the context menu through Shift+F10, use the mouse position as menu position\n\t\tlet anchor: IMouseEvent | null = null;\n\t\tif (e.target.type !== MouseTargetType.TEXTAREA) {\n\t\t\tanchor = e.event;\n\t\t}\n\n\t\t// Show the context menu\n\t\tthis.showContextMenu(anchor);\n\t}\n\n\tpublic showContextMenu(anchor?: IMouseEvent | null): void {\n\t\tif (!this._editor.getOption(EditorOption.contextmenu)) {\n\t\t\treturn; // Context menu is turned off through configuration\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find actions available for menu\n\t\tconst menuActions = this._getMenuActions(this._editor.getModel(),\n\t\t\tthis._editor.contextMenuId);\n\n\t\t// Show menu if we have actions to show\n\t\tif (menuActions.length > 0) {\n\t\t\tthis._doShowContextMenu(menuActions, anchor);\n\t\t}\n\t}\n\n\tprivate _getMenuActions(model: ITextModel, menuId: MenuId): IAction[] {\n\t\tconst result: IAction[] = [];\n\n\t\t// get menu groups\n\t\tconst groups = this._menuService.getMenuActions(menuId, this._contextKeyService, { arg: model.uri });\n\n\t\t// translate them into other actions\n\t\tfor (const group of groups) {\n\t\t\tconst [, actions] = group;\n\t\t\tlet addedItems = 0;\n\t\t\tfor (const action of actions) {\n\t\t\t\tif (action instanceof SubmenuItemAction) {\n\t\t\t\t\tconst subActions = this._getMenuActions(model, action.item.submenu);\n\t\t\t\t\tif (subActions.length > 0) {\n\t\t\t\t\t\tresult.push(new SubmenuAction(action.id, action.label, subActions));\n\t\t\t\t\t\taddedItems++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresult.push(action);\n\t\t\t\t\taddedItems++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (addedItems) {\n\t\t\t\tresult.push(new Separator());\n\t\t\t}\n\t\t}\n\n\t\tif (result.length) {\n\t\t\tresult.pop(); // remove last separator\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _doShowContextMenu(actions: IAction[], event: IMouseEvent | null = null): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet anchor: IMouseEvent | IAnchor | null = event;\n\t\tif (!anchor) {\n\t\t\t// Ensure selection is visible\n\t\t\tthis._editor.revealPosition(this._editor.getPosition(), ScrollType.Immediate);\n\n\t\t\tthis._editor.render();\n\t\t\tconst cursorCoords = this._editor.getScrolledVisiblePosition(this._editor.getPosition());\n\n\t\t\t// Translate to absolute editor position\n\t\t\tconst editorCoords = dom.getDomNodePagePosition(this._editor.getDomNode());\n\t\t\tconst posx = editorCoords.left + cursorCoords.left;\n\t\t\tconst posy = editorCoords.top + cursorCoords.top + cursorCoords.height;\n\n\t\t\tanchor = { x: posx, y: posy };\n\t\t}\n\n\t\tconst useShadowDOM = this._editor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\n\t\t// Show menu\n\t\tthis._contextMenuIsBeingShownCount++;\n\t\tthis._contextMenuService.showContextMenu({\n\t\t\tdomForShadowRoot: useShadowDOM ? this._editor.getOverflowWidgetsDomNode() ?? this._editor.getDomNode() : undefined,\n\n\t\t\tgetAnchor: () => anchor,\n\n\t\t\tgetActions: () => actions,\n\n\t\t\tgetActionViewItem: (action) => {\n\t\t\t\tconst keybinding = this._keybindingFor(action);\n\t\t\t\tif (keybinding) {\n\t\t\t\t\treturn new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true });\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\tconst customActionViewItem = <any>action;\n\t\t\t\tif (typeof customActionViewItem.getActionViewItem === 'function') {\n\t\t\t\t\treturn customActionViewItem.getActionViewItem();\n\t\t\t\t}\n\n\t\t\t\treturn new ActionViewItem(action, action, { icon: true, label: true, isMenu: true });\n\t\t\t},\n\n\t\t\tgetKeyBinding: (action): ResolvedKeybinding | undefined => {\n\t\t\t\treturn this._keybindingFor(action);\n\t\t\t},\n\n\t\t\tonHide: (wasCancelled: boolean) => {\n\t\t\t\tthis._contextMenuIsBeingShownCount--;\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _showScrollbarContextMenu(anchor: IMouseEvent): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isStandaloneEditorWorkspace(this._workspaceContextService.getWorkspace())) {\n\t\t\t// can't update the configuration properly in the standalone editor\n\t\t\treturn;\n\t\t}\n\n\t\tconst minimapOptions = this._editor.getOption(EditorOption.minimap);\n\n\t\tlet lastId = 0;\n\t\tconst createAction = (opts: { label: string; enabled?: boolean; checked?: boolean; run: () => void }): IAction => {\n\t\t\treturn {\n\t\t\t\tid: `menu-action-${++lastId}`,\n\t\t\t\tlabel: opts.label,\n\t\t\t\ttooltip: '',\n\t\t\t\tclass: undefined,\n\t\t\t\tenabled: (typeof opts.enabled === 'undefined' ? true : opts.enabled),\n\t\t\t\tchecked: opts.checked,\n\t\t\t\trun: opts.run\n\t\t\t};\n\t\t};\n\t\tconst createSubmenuAction = (label: string, actions: IAction[]): SubmenuAction => {\n\t\t\treturn new SubmenuAction(\n\t\t\t\t`menu-action-${++lastId}`,\n\t\t\t\tlabel,\n\t\t\t\tactions,\n\t\t\t\tundefined\n\t\t\t);\n\t\t};\n\t\tconst createEnumAction = <T>(label: string, enabled: boolean, configName: string, configuredValue: T, options: { label: string; value: T }[]): IAction => {\n\t\t\tif (!enabled) {\n\t\t\t\treturn createAction({ label, enabled, run: () => { } });\n\t\t\t}\n\t\t\tconst createRunner = (value: T) => {\n\t\t\t\treturn () => {\n\t\t\t\t\tthis._configurationService.updateValue(configName, value);\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst actions: IAction[] = [];\n\t\t\tfor (const option of options) {\n\t\t\t\tactions.push(createAction({\n\t\t\t\t\tlabel: option.label,\n\t\t\t\t\tchecked: configuredValue === option.value,\n\t\t\t\t\trun: createRunner(option.value)\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn createSubmenuAction(\n\t\t\t\tlabel,\n\t\t\t\tactions\n\t\t\t);\n\t\t};\n\n\t\tconst actions: IAction[] = [];\n\t\tactions.push(createAction({\n\t\t\tlabel: nls.localize('context.minimap.minimap', \"Minimap\"),\n\t\t\tchecked: minimapOptions.enabled,\n\t\t\trun: () => {\n\t\t\t\tthis._configurationService.updateValue(`editor.minimap.enabled`, !minimapOptions.enabled);\n\t\t\t}\n\t\t}));\n\t\tactions.push(new Separator());\n\t\tactions.push(createAction({\n\t\t\tlabel: nls.localize('context.minimap.renderCharacters', \"Render Characters\"),\n\t\t\tenabled: minimapOptions.enabled,\n\t\t\tchecked: minimapOptions.renderCharacters,\n\t\t\trun: () => {\n\t\t\t\tthis._configurationService.updateValue(`editor.minimap.renderCharacters`, !minimapOptions.renderCharacters);\n\t\t\t}\n\t\t}));\n\t\tactions.push(createEnumAction<'proportional' | 'fill' | 'fit'>(\n\t\t\tnls.localize('context.minimap.size', \"Vertical size\"),\n\t\t\tminimapOptions.enabled,\n\t\t\t'editor.minimap.size',\n\t\t\tminimapOptions.size,\n\t\t\t[{\n\t\t\t\tlabel: nls.localize('context.minimap.size.proportional', \"Proportional\"),\n\t\t\t\tvalue: 'proportional'\n\t\t\t}, {\n\t\t\t\tlabel: nls.localize('context.minimap.size.fill', \"Fill\"),\n\t\t\t\tvalue: 'fill'\n\t\t\t}, {\n\t\t\t\tlabel: nls.localize('context.minimap.size.fit', \"Fit\"),\n\t\t\t\tvalue: 'fit'\n\t\t\t}]\n\t\t));\n\t\tactions.push(createEnumAction<'always' | 'mouseover'>(\n\t\t\tnls.localize('context.minimap.slider', \"Slider\"),\n\t\t\tminimapOptions.enabled,\n\t\t\t'editor.minimap.showSlider',\n\t\t\tminimapOptions.showSlider,\n\t\t\t[{\n\t\t\t\tlabel: nls.localize('context.minimap.slider.mouseover', \"Mouse Over\"),\n\t\t\t\tvalue: 'mouseover'\n\t\t\t}, {\n\t\t\t\tlabel: nls.localize('context.minimap.slider.always', \"Always\"),\n\t\t\t\tvalue: 'always'\n\t\t\t}]\n\t\t));\n\n\t\tconst useShadowDOM = this._editor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\t\tthis._contextMenuIsBeingShownCount++;\n\t\tthis._contextMenuService.showContextMenu({\n\t\t\tdomForShadowRoot: useShadowDOM ? this._editor.getDomNode() : undefined,\n\t\t\tgetAnchor: () => anchor,\n\t\t\tgetActions: () => actions,\n\t\t\tonHide: (wasCancelled: boolean) => {\n\t\t\t\tthis._contextMenuIsBeingShownCount--;\n\t\t\t\tthis._editor.focus();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _keybindingFor(action: IAction): ResolvedKeybinding | undefined {\n\t\treturn this._keybindingService.lookupKeybinding(action.id);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._contextMenuIsBeingShownCount > 0) {\n\t\t\tthis._contextViewService.hideContextView();\n\t\t}\n\n\t\tthis._toDispose.dispose();\n\t}\n}\n\nclass ShowContextMenu extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.showContextMenu',\n\t\t\tlabel: nls.localize2('action.showContextMenu.label', \"Show Editor Context Menu\"),\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyCode.F10,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tContextMenuController.get(editor)?.showContextMenu();\n\t}\n}\n\nregisterEditorContribution(ContextMenuController.ID, ContextMenuController, EditorContributionInstantiation.BeforeFirstInteraction);\nregisterEditorAction(ShowContextMenu);\n"]}
@@ -440,6 +440,7 @@ export class FindModelBoundToEditorModel {
440
440
  const preserveCase = this._state.preserveCase;
441
441
  if (replacePattern.hasReplacementPatterns || preserveCase) {
442
442
  resultText = modelText.replace(searchRegex, function () {
443
+ // eslint-disable-next-line local/code-no-any-casts
443
444
  return replacePattern.buildReplaceString(arguments, preserveCase);
444
445
  });
445
446
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/find/browser/findModel.ts","vs/editor/contrib/find/browser/findModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAGhF,OAAO,EAAE,cAAc,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAGlH,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AAGrF,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,aAAa,CAAU,mBAAmB,EAAE,KAAK,CAAC,CAAC;AAClG,MAAM,CAAC,MAAM,+BAA+B,GAAG,2BAA2B,CAAC,SAAS,EAAE,CAAC;AACvF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,aAAa,CAAU,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACjG,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,aAAa,CAAU,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAEvG,MAAM,CAAC,MAAM,6BAA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"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { findFirstIdxMonotonousOrArrLen } from '../../../../base/common/arraysFind.js';\nimport { RunOnceScheduler, TimeoutTimer } from '../../../../base/common/async.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport { DisposableStore, dispose } from '../../../../base/common/lifecycle.js';\nimport { Constants } from '../../../../base/common/uint.js';\nimport { IActiveCodeEditor } from '../../../browser/editorBrowser.js';\nimport { ReplaceCommand, ReplaceCommandThatPreservesSelection } from '../../../common/commands/replaceCommand.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { ICommand, ScrollType } from '../../../common/editorCommon.js';\nimport { EndOfLinePreference, FindMatch, ITextModel } from '../../../common/model.js';\nimport { SearchParams } from '../../../common/model/textModelSearch.js';\nimport { FindDecorations } from './findDecorations.js';\nimport { FindReplaceState, FindReplaceStateChangedEvent } from './findState.js';\nimport { ReplaceAllCommand } from './replaceAllCommand.js';\nimport { parseReplaceString, ReplacePattern } from './replacePattern.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IKeybindings } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\n\nexport const CONTEXT_FIND_WIDGET_VISIBLE = new RawContextKey<boolean>('findWidgetVisible', false);\nexport const CONTEXT_FIND_WIDGET_NOT_VISIBLE = CONTEXT_FIND_WIDGET_VISIBLE.toNegated();\n// Keep ContextKey use of 'Focussed' to not break when clauses\nexport const CONTEXT_FIND_INPUT_FOCUSED = new RawContextKey<boolean>('findInputFocussed', false);\nexport const CONTEXT_REPLACE_INPUT_FOCUSED = new RawContextKey<boolean>('replaceInputFocussed', false);\n\nexport const ToggleCaseSensitiveKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyC,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyC }\n};\nexport const ToggleWholeWordKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyW,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyW }\n};\nexport const ToggleRegexKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyR,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyR }\n};\nexport const ToggleSearchScopeKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyL,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyL }\n};\nexport const TogglePreserveCaseKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyP,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyP }\n};\n\nexport const FIND_IDS = {\n\tStartFindAction: 'actions.find',\n\tStartFindWithSelection: 'actions.findWithSelection',\n\tStartFindWithArgs: 'editor.actions.findWithArgs',\n\tNextMatchFindAction: 'editor.action.nextMatchFindAction',\n\tPreviousMatchFindAction: 'editor.action.previousMatchFindAction',\n\tGoToMatchFindAction: 'editor.action.goToMatchFindAction',\n\tNextSelectionMatchFindAction: 'editor.action.nextSelectionMatchFindAction',\n\tPreviousSelectionMatchFindAction: 'editor.action.previousSelectionMatchFindAction',\n\tStartFindReplaceAction: 'editor.action.startFindReplaceAction',\n\tCloseFindWidgetCommand: 'closeFindWidget',\n\tToggleCaseSensitiveCommand: 'toggleFindCaseSensitive',\n\tToggleWholeWordCommand: 'toggleFindWholeWord',\n\tToggleRegexCommand: 'toggleFindRegex',\n\tToggleSearchScopeCommand: 'toggleFindInSelection',\n\tTogglePreserveCaseCommand: 'togglePreserveCase',\n\tReplaceOneAction: 'editor.action.replaceOne',\n\tReplaceAllAction: 'editor.action.replaceAll',\n\tSelectAllMatchesAction: 'editor.action.selectAllMatches'\n};\n\nexport const MATCHES_LIMIT = 19999;\nconst RESEARCH_DELAY = 240;\n\nexport class FindModelBoundToEditorModel {\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _state: FindReplaceState;\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _decorations: FindDecorations;\n\tprivate _ignoreModelContentChanged: boolean;\n\tprivate readonly _startSearchingTimer: TimeoutTimer;\n\n\tprivate readonly _updateDecorationsScheduler: RunOnceScheduler;\n\tprivate _isDisposed: boolean;\n\n\tconstructor(editor: IActiveCodeEditor, state: FindReplaceState) {\n\t\tthis._editor = editor;\n\t\tthis._state = state;\n\t\tthis._isDisposed = false;\n\t\tthis._startSearchingTimer = new TimeoutTimer();\n\n\t\tthis._decorations = new FindDecorations(editor);\n\t\tthis._toDispose.add(this._decorations);\n\n\t\tthis._updateDecorationsScheduler = new RunOnceScheduler(() => {\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.research(false);\n\t\t}, 100);\n\t\tthis._toDispose.add(this._updateDecorationsScheduler);\n\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => {\n\t\t\tif (\n\t\t\t\te.reason === CursorChangeReason.Explicit\n\t\t\t\t|| e.reason === CursorChangeReason.Undo\n\t\t\t\t|| e.reason === CursorChangeReason.Redo\n\t\t\t) {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t}\n\t\t}));\n\n\t\tthis._ignoreModelContentChanged = false;\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tif (this._ignoreModelContentChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e.isFlush) {\n\t\t\t\t// a model.setValue() was called\n\t\t\t\tthis._decorations.reset();\n\t\t\t}\n\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\tthis._updateDecorationsScheduler.schedule();\n\t\t}));\n\n\t\tthis._toDispose.add(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));\n\n\t\tthis.research(false, this._state.searchScope);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._isDisposed = true;\n\t\tdispose(this._startSearchingTimer);\n\t\tthis._toDispose.dispose();\n\t}\n\n\tprivate _onStateChanged(e: FindReplaceStateChangedEvent): void {\n\t\tif (this._isDisposed) {\n\t\t\t// The find model is disposed during a find state changed event\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\t// The find model will be disposed momentarily\n\t\t\treturn;\n\t\t}\n\t\tif (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) {\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (model.isTooLargeForSyncing()) {\n\t\t\t\tthis._startSearchingTimer.cancel();\n\n\t\t\t\tthis._startSearchingTimer.setIfNotSet(() => {\n\t\t\t\t\tif (e.searchScope) {\n\t\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t\t}\n\t\t\t\t}, RESEARCH_DELAY);\n\t\t\t} else {\n\t\t\t\tif (e.searchScope) {\n\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t} else {\n\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static _getSearchRange(model: ITextModel, findScope: Range | null): Range {\n\t\t// If we have set now or before a find scope, use it for computing the search range\n\t\tif (findScope) {\n\t\t\treturn findScope;\n\t\t}\n\n\t\treturn model.getFullModelRange();\n\t}\n\n\tprivate research(moveCursor: boolean, newFindScope?: Range | Range[] | null): void {\n\t\tlet findScopes: Range[] | null = null;\n\t\tif (typeof newFindScope !== 'undefined') {\n\t\t\tif (newFindScope !== null) {\n\t\t\t\tif (!Array.isArray(newFindScope)) {\n\t\t\t\t\tfindScopes = [newFindScope as Range];\n\t\t\t\t} else {\n\t\t\t\t\tfindScopes = newFindScope;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfindScopes = this._decorations.getFindScopes();\n\t\t}\n\t\tif (findScopes !== null) {\n\t\t\tfindScopes = findScopes.map(findScope => {\n\t\t\t\tif (findScope.startLineNumber !== findScope.endLineNumber) {\n\t\t\t\t\tlet endLineNumber = findScope.endLineNumber;\n\n\t\t\t\t\tif (findScope.endColumn === 1) {\n\t\t\t\t\t\tendLineNumber = endLineNumber - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new Range(findScope.startLineNumber, 1, endLineNumber, this._editor.getModel().getLineMaxColumn(endLineNumber));\n\t\t\t\t}\n\t\t\t\treturn findScope;\n\t\t\t});\n\t\t}\n\n\t\tconst findMatches = this._findMatches(findScopes, false, MATCHES_LIMIT);\n\t\tthis._decorations.set(findMatches, findScopes);\n\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tlet currentMatchesPosition = this._decorations.getCurrentMatchesPosition(editorSelection);\n\t\tif (currentMatchesPosition === 0 && findMatches.length > 0) {\n\t\t\t// current selection is not on top of a match\n\t\t\t// try to find its nearest result from the top of the document\n\t\t\tconst matchAfterSelection = findFirstIdxMonotonousOrArrLen(findMatches.map(match => match.range), range => Range.compareRangesUsingStarts(range, editorSelection) >= 0);\n\t\t\tcurrentMatchesPosition = matchAfterSelection > 0 ? matchAfterSelection - 1 + 1 /** match position is one based */ : currentMatchesPosition;\n\t\t}\n\n\t\tthis._state.changeMatchInfo(\n\t\t\tcurrentMatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tundefined\n\t\t);\n\n\t\tif (moveCursor && this._editor.getOption(EditorOption.find).cursorMoveOnType) {\n\t\t\tthis._moveToNextMatch(this._decorations.getStartPosition());\n\t\t}\n\t}\n\n\tprivate _hasMatches(): boolean {\n\t\treturn (this._state.matchesCount > 0);\n\t}\n\n\tprivate _cannotFind(): boolean {\n\t\tif (!this._hasMatches()) {\n\t\t\tconst findScope = this._decorations.getFindScope();\n\t\t\tif (findScope) {\n\t\t\t\t// Reveal the selection so user is reminded that 'selection find' is on.\n\t\t\t\tthis._editor.revealRangeInCenterIfOutsideViewport(findScope, ScrollType.Smooth);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _setCurrentFindMatch(match: Range): void {\n\t\tconst matchesPosition = this._decorations.setCurrentFindMatch(match);\n\t\tthis._state.changeMatchInfo(\n\t\t\tmatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tmatch\n\t\t);\n\n\t\tthis._editor.setSelection(match);\n\t\tthis._editor.revealRangeInCenterIfOutsideViewport(match, ScrollType.Smooth);\n\t}\n\n\tprivate _prevSearchPosition(before: Position) {\n\t\tconst isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\t\tlet { lineNumber, column } = before;\n\t\tconst model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === 1) {\n\t\t\tif (lineNumber === 1) {\n\t\t\t\tlineNumber = model.getLineCount();\n\t\t\t} else {\n\t\t\t\tlineNumber--;\n\t\t\t}\n\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t} else {\n\t\t\tcolumn--;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToPrevMatch(before: Position, isRecursed: boolean = false): void {\n\t\tif (!this._state.canNavigateBack()) {\n\t\t\t// we are beyond the first matched find result\n\t\t\t// instead of doing nothing, we should refocus the first item\n\t\t\tconst nextMatchRange = this._decorations.matchAfterPosition(before);\n\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet prevMatchRange = this._decorations.matchBeforePosition(before);\n\n\t\t\tif (prevMatchRange && prevMatchRange.isEmpty() && prevMatchRange.getStartPosition().equals(before)) {\n\t\t\t\tbefore = this._prevSearchPosition(before);\n\t\t\t\tprevMatchRange = this._decorations.matchBeforePosition(before);\n\t\t\t}\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cannotFind()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScope = this._decorations.getFindScope();\n\t\tconst searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(before)) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (before.isBefore(searchRange.getStartPosition())) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\tconst { lineNumber, column } = before;\n\t\tconst model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\n\t\tif (prevMatch && prevMatch.range.isEmpty() && prevMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._prevSearchPosition(position);\n\t\t\tprevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\t\t}\n\n\t\tif (!prevMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(prevMatch.range)) {\n\t\t\treturn this._moveToPrevMatch(prevMatch.range.getStartPosition(), true);\n\t\t}\n\n\t\tthis._setCurrentFindMatch(prevMatch.range);\n\t}\n\n\tpublic moveToPrevMatch(): void {\n\t\tthis._moveToPrevMatch(this._editor.getSelection().getStartPosition());\n\t}\n\n\tprivate _nextSearchPosition(after: Position) {\n\t\tconst isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\n\t\tlet { lineNumber, column } = after;\n\t\tconst model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === model.getLineMaxColumn(lineNumber)) {\n\t\t\tif (lineNumber === model.getLineCount()) {\n\t\t\t\tlineNumber = 1;\n\t\t\t} else {\n\t\t\t\tlineNumber++;\n\t\t\t}\n\t\t\tcolumn = 1;\n\t\t} else {\n\t\t\tcolumn++;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToNextMatch(after: Position): void {\n\t\tif (!this._state.canNavigateForward()) {\n\t\t\t// we are beyond the last matched find result\n\t\t\t// instead of doing nothing, we should refocus the last item\n\t\t\tconst prevMatchRange = this._decorations.matchBeforePosition(after);\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet nextMatchRange = this._decorations.matchAfterPosition(after);\n\n\t\t\tif (nextMatchRange && nextMatchRange.isEmpty() && nextMatchRange.getStartPosition().equals(after)) {\n\t\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\t\tafter = this._nextSearchPosition(after);\n\t\t\t\tnextMatchRange = this._decorations.matchAfterPosition(after);\n\t\t\t}\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextMatch = this._getNextMatch(after, false, true);\n\t\tif (nextMatch) {\n\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t}\n\t}\n\n\tprivate _getNextMatch(after: Position, captureMatches: boolean, forceMove: boolean, isRecursed: boolean = false): FindMatch | null {\n\t\tif (this._cannotFind()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst findScope = this._decorations.getFindScope();\n\t\tconst searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(after)) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (after.isBefore(searchRange.getStartPosition())) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\tconst { lineNumber, column } = after;\n\t\tconst model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\n\t\tif (forceMove && nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._nextSearchPosition(position);\n\t\t\tnextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\t\t}\n\n\t\tif (!nextMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(nextMatch.range)) {\n\t\t\treturn this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, forceMove, true);\n\t\t}\n\n\t\treturn nextMatch;\n\t}\n\n\tpublic moveToNextMatch(): void {\n\t\tthis._moveToNextMatch(this._editor.getSelection().getEndPosition());\n\t}\n\n\tprivate _moveToMatch(index: number): void {\n\t\tconst decorationRange = this._decorations.getDecorationRangeAt(index);\n\t\tif (decorationRange) {\n\t\t\tthis._setCurrentFindMatch(decorationRange);\n\t\t}\n\t}\n\n\tpublic moveToMatch(index: number): void {\n\t\tthis._moveToMatch(index);\n\t}\n\n\tprivate _getReplacePattern(): ReplacePattern {\n\t\tif (this._state.isRegex) {\n\t\t\treturn parseReplaceString(this._state.replaceString);\n\t\t}\n\t\treturn ReplacePattern.fromStaticValue(this._state.replaceString);\n\t}\n\n\tpublic replace(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tconst selection = this._editor.getSelection();\n\t\tconst nextMatch = this._getNextMatch(selection.getStartPosition(), true, false);\n\t\tif (nextMatch) {\n\t\t\tif (selection.equalsRange(nextMatch.range)) {\n\t\t\t\t// selection sits on a find match => replace it!\n\t\t\t\tconst replaceString = replacePattern.buildReplaceString(nextMatch.matches, this._state.preserveCase);\n\n\t\t\t\tconst command = new ReplaceCommand(selection, replaceString);\n\n\t\t\t\tthis._executeEditorCommand('replace', command);\n\n\t\t\t\tthis._decorations.setStartPosition(new Position(selection.startLineNumber, selection.startColumn + replaceString.length));\n\t\t\t\tthis.research(true);\n\t\t\t} else {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _findMatches(findScopes: Range[] | null, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst searchRanges = (findScopes as [] || [null]).map((scope: Range | null) =>\n\t\t\tFindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), scope)\n\t\t);\n\n\t\treturn this._editor.getModel().findMatches(this._state.searchString, searchRanges, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches, limitResultCount);\n\t}\n\n\tpublic replaceAll(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\tif (findScopes === null && this._state.matchesCount >= MATCHES_LIMIT) {\n\t\t\t// Doing a replace on the entire file that is over ${MATCHES_LIMIT} matches\n\t\t\tthis._largeReplaceAll();\n\t\t} else {\n\t\t\tthis._regularReplaceAll(findScopes);\n\t\t}\n\n\t\tthis.research(false);\n\t}\n\n\tprivate _largeReplaceAll(): void {\n\t\tconst searchParams = new SearchParams(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null);\n\t\tconst searchData = searchParams.parseSearchRequest();\n\t\tif (!searchData) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet searchRegex = searchData.regex;\n\t\tif (!searchRegex.multiline) {\n\t\t\tlet mod = 'mu';\n\t\t\tif (searchRegex.ignoreCase) {\n\t\t\t\tmod += 'i';\n\t\t\t}\n\t\t\tif (searchRegex.global) {\n\t\t\t\tmod += 'g';\n\t\t\t}\n\t\t\tsearchRegex = new RegExp(searchRegex.source, mod);\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst modelText = model.getValue(EndOfLinePreference.LF);\n\t\tconst fullModelRange = model.getFullModelRange();\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tlet resultText: string;\n\t\tconst preserveCase = this._state.preserveCase;\n\n\t\tif (replacePattern.hasReplacementPatterns || preserveCase) {\n\t\t\tresultText = modelText.replace(searchRegex, function () {\n\t\t\t\treturn replacePattern.buildReplaceString(<string[]><any>arguments, preserveCase);\n\t\t\t});\n\t\t} else {\n\t\t\tresultText = modelText.replace(searchRegex, replacePattern.buildReplaceString(null, preserveCase));\n\t\t}\n\n\t\tconst command = new ReplaceCommandThatPreservesSelection(fullModelRange, resultText, this._editor.getSelection());\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tprivate _regularReplaceAll(findScopes: Range[] | null): void {\n\t\tconst replacePattern = this._getReplacePattern();\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tconst matches = this._findMatches(findScopes, replacePattern.hasReplacementPatterns || this._state.preserveCase, Constants.MAX_SAFE_SMALL_INTEGER);\n\n\t\tconst replaceStrings: string[] = [];\n\t\tfor (let i = 0, len = matches.length; i < len; i++) {\n\t\t\treplaceStrings[i] = replacePattern.buildReplaceString(matches[i].matches, this._state.preserveCase);\n\t\t}\n\n\t\tconst command = new ReplaceAllCommand(this._editor.getSelection(), matches.map(m => m.range), replaceStrings);\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tpublic selectAllMatches(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tconst matches = this._findMatches(findScopes, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\t\tlet selections = matches.map(m => new Selection(m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn));\n\n\t\t// If one of the ranges is the editor selection, then maintain it as primary\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst sel = selections[i];\n\t\t\tif (sel.equalsRange(editorSelection)) {\n\t\t\t\tselections = [editorSelection].concat(selections.slice(0, i)).concat(selections.slice(i + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._editor.setSelections(selections);\n\t}\n\n\tprivate _executeEditorCommand(source: string, command: ICommand): void {\n\t\ttry {\n\t\t\tthis._ignoreModelContentChanged = true;\n\t\t\tthis._editor.pushUndoStop();\n\t\t\tthis._editor.executeCommand(source, command);\n\t\t\tthis._editor.pushUndoStop();\n\t\t} finally {\n\t\t\tthis._ignoreModelContentChanged = false;\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { findFirstIdxMonotonousOrArrLen } from '../../../../base/common/arraysFind.js';\nimport { RunOnceScheduler, TimeoutTimer } from '../../../../base/common/async.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport { DisposableStore, dispose } from '../../../../base/common/lifecycle.js';\nimport { Constants } from '../../../../base/common/uint.js';\nimport { IActiveCodeEditor } from '../../../browser/editorBrowser.js';\nimport { ReplaceCommand, ReplaceCommandThatPreservesSelection } from '../../../common/commands/replaceCommand.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { ICommand, ScrollType } from '../../../common/editorCommon.js';\nimport { EndOfLinePreference, FindMatch, ITextModel } from '../../../common/model.js';\nimport { SearchParams } from '../../../common/model/textModelSearch.js';\nimport { FindDecorations } from './findDecorations.js';\nimport { FindReplaceState, FindReplaceStateChangedEvent } from './findState.js';\nimport { ReplaceAllCommand } from './replaceAllCommand.js';\nimport { parseReplaceString, ReplacePattern } from './replacePattern.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IKeybindings } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\n\nexport const CONTEXT_FIND_WIDGET_VISIBLE = new RawContextKey<boolean>('findWidgetVisible', false);\nexport const CONTEXT_FIND_WIDGET_NOT_VISIBLE = CONTEXT_FIND_WIDGET_VISIBLE.toNegated();\n// Keep ContextKey use of 'Focussed' to not break when clauses\nexport const CONTEXT_FIND_INPUT_FOCUSED = new RawContextKey<boolean>('findInputFocussed', false);\nexport const CONTEXT_REPLACE_INPUT_FOCUSED = new RawContextKey<boolean>('replaceInputFocussed', false);\n\nexport const ToggleCaseSensitiveKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyC,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyC }\n};\nexport const ToggleWholeWordKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyW,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyW }\n};\nexport const ToggleRegexKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyR,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyR }\n};\nexport const ToggleSearchScopeKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyL,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyL }\n};\nexport const TogglePreserveCaseKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyP,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyP }\n};\n\nexport const FIND_IDS = {\n\tStartFindAction: 'actions.find',\n\tStartFindWithSelection: 'actions.findWithSelection',\n\tStartFindWithArgs: 'editor.actions.findWithArgs',\n\tNextMatchFindAction: 'editor.action.nextMatchFindAction',\n\tPreviousMatchFindAction: 'editor.action.previousMatchFindAction',\n\tGoToMatchFindAction: 'editor.action.goToMatchFindAction',\n\tNextSelectionMatchFindAction: 'editor.action.nextSelectionMatchFindAction',\n\tPreviousSelectionMatchFindAction: 'editor.action.previousSelectionMatchFindAction',\n\tStartFindReplaceAction: 'editor.action.startFindReplaceAction',\n\tCloseFindWidgetCommand: 'closeFindWidget',\n\tToggleCaseSensitiveCommand: 'toggleFindCaseSensitive',\n\tToggleWholeWordCommand: 'toggleFindWholeWord',\n\tToggleRegexCommand: 'toggleFindRegex',\n\tToggleSearchScopeCommand: 'toggleFindInSelection',\n\tTogglePreserveCaseCommand: 'togglePreserveCase',\n\tReplaceOneAction: 'editor.action.replaceOne',\n\tReplaceAllAction: 'editor.action.replaceAll',\n\tSelectAllMatchesAction: 'editor.action.selectAllMatches'\n};\n\nexport const MATCHES_LIMIT = 19999;\nconst RESEARCH_DELAY = 240;\n\nexport class FindModelBoundToEditorModel {\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _state: FindReplaceState;\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _decorations: FindDecorations;\n\tprivate _ignoreModelContentChanged: boolean;\n\tprivate readonly _startSearchingTimer: TimeoutTimer;\n\n\tprivate readonly _updateDecorationsScheduler: RunOnceScheduler;\n\tprivate _isDisposed: boolean;\n\n\tconstructor(editor: IActiveCodeEditor, state: FindReplaceState) {\n\t\tthis._editor = editor;\n\t\tthis._state = state;\n\t\tthis._isDisposed = false;\n\t\tthis._startSearchingTimer = new TimeoutTimer();\n\n\t\tthis._decorations = new FindDecorations(editor);\n\t\tthis._toDispose.add(this._decorations);\n\n\t\tthis._updateDecorationsScheduler = new RunOnceScheduler(() => {\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.research(false);\n\t\t}, 100);\n\t\tthis._toDispose.add(this._updateDecorationsScheduler);\n\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => {\n\t\t\tif (\n\t\t\t\te.reason === CursorChangeReason.Explicit\n\t\t\t\t|| e.reason === CursorChangeReason.Undo\n\t\t\t\t|| e.reason === CursorChangeReason.Redo\n\t\t\t) {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t}\n\t\t}));\n\n\t\tthis._ignoreModelContentChanged = false;\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tif (this._ignoreModelContentChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e.isFlush) {\n\t\t\t\t// a model.setValue() was called\n\t\t\t\tthis._decorations.reset();\n\t\t\t}\n\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\tthis._updateDecorationsScheduler.schedule();\n\t\t}));\n\n\t\tthis._toDispose.add(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));\n\n\t\tthis.research(false, this._state.searchScope);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._isDisposed = true;\n\t\tdispose(this._startSearchingTimer);\n\t\tthis._toDispose.dispose();\n\t}\n\n\tprivate _onStateChanged(e: FindReplaceStateChangedEvent): void {\n\t\tif (this._isDisposed) {\n\t\t\t// The find model is disposed during a find state changed event\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\t// The find model will be disposed momentarily\n\t\t\treturn;\n\t\t}\n\t\tif (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) {\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (model.isTooLargeForSyncing()) {\n\t\t\t\tthis._startSearchingTimer.cancel();\n\n\t\t\t\tthis._startSearchingTimer.setIfNotSet(() => {\n\t\t\t\t\tif (e.searchScope) {\n\t\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t\t}\n\t\t\t\t}, RESEARCH_DELAY);\n\t\t\t} else {\n\t\t\t\tif (e.searchScope) {\n\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t} else {\n\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static _getSearchRange(model: ITextModel, findScope: Range | null): Range {\n\t\t// If we have set now or before a find scope, use it for computing the search range\n\t\tif (findScope) {\n\t\t\treturn findScope;\n\t\t}\n\n\t\treturn model.getFullModelRange();\n\t}\n\n\tprivate research(moveCursor: boolean, newFindScope?: Range | Range[] | null): void {\n\t\tlet findScopes: Range[] | null = null;\n\t\tif (typeof newFindScope !== 'undefined') {\n\t\t\tif (newFindScope !== null) {\n\t\t\t\tif (!Array.isArray(newFindScope)) {\n\t\t\t\t\tfindScopes = [newFindScope as Range];\n\t\t\t\t} else {\n\t\t\t\t\tfindScopes = newFindScope;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfindScopes = this._decorations.getFindScopes();\n\t\t}\n\t\tif (findScopes !== null) {\n\t\t\tfindScopes = findScopes.map(findScope => {\n\t\t\t\tif (findScope.startLineNumber !== findScope.endLineNumber) {\n\t\t\t\t\tlet endLineNumber = findScope.endLineNumber;\n\n\t\t\t\t\tif (findScope.endColumn === 1) {\n\t\t\t\t\t\tendLineNumber = endLineNumber - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new Range(findScope.startLineNumber, 1, endLineNumber, this._editor.getModel().getLineMaxColumn(endLineNumber));\n\t\t\t\t}\n\t\t\t\treturn findScope;\n\t\t\t});\n\t\t}\n\n\t\tconst findMatches = this._findMatches(findScopes, false, MATCHES_LIMIT);\n\t\tthis._decorations.set(findMatches, findScopes);\n\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tlet currentMatchesPosition = this._decorations.getCurrentMatchesPosition(editorSelection);\n\t\tif (currentMatchesPosition === 0 && findMatches.length > 0) {\n\t\t\t// current selection is not on top of a match\n\t\t\t// try to find its nearest result from the top of the document\n\t\t\tconst matchAfterSelection = findFirstIdxMonotonousOrArrLen(findMatches.map(match => match.range), range => Range.compareRangesUsingStarts(range, editorSelection) >= 0);\n\t\t\tcurrentMatchesPosition = matchAfterSelection > 0 ? matchAfterSelection - 1 + 1 /** match position is one based */ : currentMatchesPosition;\n\t\t}\n\n\t\tthis._state.changeMatchInfo(\n\t\t\tcurrentMatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tundefined\n\t\t);\n\n\t\tif (moveCursor && this._editor.getOption(EditorOption.find).cursorMoveOnType) {\n\t\t\tthis._moveToNextMatch(this._decorations.getStartPosition());\n\t\t}\n\t}\n\n\tprivate _hasMatches(): boolean {\n\t\treturn (this._state.matchesCount > 0);\n\t}\n\n\tprivate _cannotFind(): boolean {\n\t\tif (!this._hasMatches()) {\n\t\t\tconst findScope = this._decorations.getFindScope();\n\t\t\tif (findScope) {\n\t\t\t\t// Reveal the selection so user is reminded that 'selection find' is on.\n\t\t\t\tthis._editor.revealRangeInCenterIfOutsideViewport(findScope, ScrollType.Smooth);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _setCurrentFindMatch(match: Range): void {\n\t\tconst matchesPosition = this._decorations.setCurrentFindMatch(match);\n\t\tthis._state.changeMatchInfo(\n\t\t\tmatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tmatch\n\t\t);\n\n\t\tthis._editor.setSelection(match);\n\t\tthis._editor.revealRangeInCenterIfOutsideViewport(match, ScrollType.Smooth);\n\t}\n\n\tprivate _prevSearchPosition(before: Position) {\n\t\tconst isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\t\tlet { lineNumber, column } = before;\n\t\tconst model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === 1) {\n\t\t\tif (lineNumber === 1) {\n\t\t\t\tlineNumber = model.getLineCount();\n\t\t\t} else {\n\t\t\t\tlineNumber--;\n\t\t\t}\n\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t} else {\n\t\t\tcolumn--;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToPrevMatch(before: Position, isRecursed: boolean = false): void {\n\t\tif (!this._state.canNavigateBack()) {\n\t\t\t// we are beyond the first matched find result\n\t\t\t// instead of doing nothing, we should refocus the first item\n\t\t\tconst nextMatchRange = this._decorations.matchAfterPosition(before);\n\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet prevMatchRange = this._decorations.matchBeforePosition(before);\n\n\t\t\tif (prevMatchRange && prevMatchRange.isEmpty() && prevMatchRange.getStartPosition().equals(before)) {\n\t\t\t\tbefore = this._prevSearchPosition(before);\n\t\t\t\tprevMatchRange = this._decorations.matchBeforePosition(before);\n\t\t\t}\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cannotFind()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScope = this._decorations.getFindScope();\n\t\tconst searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(before)) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (before.isBefore(searchRange.getStartPosition())) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\tconst { lineNumber, column } = before;\n\t\tconst model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\n\t\tif (prevMatch && prevMatch.range.isEmpty() && prevMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._prevSearchPosition(position);\n\t\t\tprevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\t\t}\n\n\t\tif (!prevMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(prevMatch.range)) {\n\t\t\treturn this._moveToPrevMatch(prevMatch.range.getStartPosition(), true);\n\t\t}\n\n\t\tthis._setCurrentFindMatch(prevMatch.range);\n\t}\n\n\tpublic moveToPrevMatch(): void {\n\t\tthis._moveToPrevMatch(this._editor.getSelection().getStartPosition());\n\t}\n\n\tprivate _nextSearchPosition(after: Position) {\n\t\tconst isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\n\t\tlet { lineNumber, column } = after;\n\t\tconst model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === model.getLineMaxColumn(lineNumber)) {\n\t\t\tif (lineNumber === model.getLineCount()) {\n\t\t\t\tlineNumber = 1;\n\t\t\t} else {\n\t\t\t\tlineNumber++;\n\t\t\t}\n\t\t\tcolumn = 1;\n\t\t} else {\n\t\t\tcolumn++;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToNextMatch(after: Position): void {\n\t\tif (!this._state.canNavigateForward()) {\n\t\t\t// we are beyond the last matched find result\n\t\t\t// instead of doing nothing, we should refocus the last item\n\t\t\tconst prevMatchRange = this._decorations.matchBeforePosition(after);\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet nextMatchRange = this._decorations.matchAfterPosition(after);\n\n\t\t\tif (nextMatchRange && nextMatchRange.isEmpty() && nextMatchRange.getStartPosition().equals(after)) {\n\t\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\t\tafter = this._nextSearchPosition(after);\n\t\t\t\tnextMatchRange = this._decorations.matchAfterPosition(after);\n\t\t\t}\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextMatch = this._getNextMatch(after, false, true);\n\t\tif (nextMatch) {\n\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t}\n\t}\n\n\tprivate _getNextMatch(after: Position, captureMatches: boolean, forceMove: boolean, isRecursed: boolean = false): FindMatch | null {\n\t\tif (this._cannotFind()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst findScope = this._decorations.getFindScope();\n\t\tconst searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(after)) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (after.isBefore(searchRange.getStartPosition())) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\tconst { lineNumber, column } = after;\n\t\tconst model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\n\t\tif (forceMove && nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._nextSearchPosition(position);\n\t\t\tnextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\t\t}\n\n\t\tif (!nextMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(nextMatch.range)) {\n\t\t\treturn this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, forceMove, true);\n\t\t}\n\n\t\treturn nextMatch;\n\t}\n\n\tpublic moveToNextMatch(): void {\n\t\tthis._moveToNextMatch(this._editor.getSelection().getEndPosition());\n\t}\n\n\tprivate _moveToMatch(index: number): void {\n\t\tconst decorationRange = this._decorations.getDecorationRangeAt(index);\n\t\tif (decorationRange) {\n\t\t\tthis._setCurrentFindMatch(decorationRange);\n\t\t}\n\t}\n\n\tpublic moveToMatch(index: number): void {\n\t\tthis._moveToMatch(index);\n\t}\n\n\tprivate _getReplacePattern(): ReplacePattern {\n\t\tif (this._state.isRegex) {\n\t\t\treturn parseReplaceString(this._state.replaceString);\n\t\t}\n\t\treturn ReplacePattern.fromStaticValue(this._state.replaceString);\n\t}\n\n\tpublic replace(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tconst selection = this._editor.getSelection();\n\t\tconst nextMatch = this._getNextMatch(selection.getStartPosition(), true, false);\n\t\tif (nextMatch) {\n\t\t\tif (selection.equalsRange(nextMatch.range)) {\n\t\t\t\t// selection sits on a find match => replace it!\n\t\t\t\tconst replaceString = replacePattern.buildReplaceString(nextMatch.matches, this._state.preserveCase);\n\n\t\t\t\tconst command = new ReplaceCommand(selection, replaceString);\n\n\t\t\t\tthis._executeEditorCommand('replace', command);\n\n\t\t\t\tthis._decorations.setStartPosition(new Position(selection.startLineNumber, selection.startColumn + replaceString.length));\n\t\t\t\tthis.research(true);\n\t\t\t} else {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _findMatches(findScopes: Range[] | null, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst searchRanges = (findScopes as [] || [null]).map((scope: Range | null) =>\n\t\t\tFindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), scope)\n\t\t);\n\n\t\treturn this._editor.getModel().findMatches(this._state.searchString, searchRanges, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches, limitResultCount);\n\t}\n\n\tpublic replaceAll(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\tif (findScopes === null && this._state.matchesCount >= MATCHES_LIMIT) {\n\t\t\t// Doing a replace on the entire file that is over ${MATCHES_LIMIT} matches\n\t\t\tthis._largeReplaceAll();\n\t\t} else {\n\t\t\tthis._regularReplaceAll(findScopes);\n\t\t}\n\n\t\tthis.research(false);\n\t}\n\n\tprivate _largeReplaceAll(): void {\n\t\tconst searchParams = new SearchParams(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null);\n\t\tconst searchData = searchParams.parseSearchRequest();\n\t\tif (!searchData) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet searchRegex = searchData.regex;\n\t\tif (!searchRegex.multiline) {\n\t\t\tlet mod = 'mu';\n\t\t\tif (searchRegex.ignoreCase) {\n\t\t\t\tmod += 'i';\n\t\t\t}\n\t\t\tif (searchRegex.global) {\n\t\t\t\tmod += 'g';\n\t\t\t}\n\t\t\tsearchRegex = new RegExp(searchRegex.source, mod);\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst modelText = model.getValue(EndOfLinePreference.LF);\n\t\tconst fullModelRange = model.getFullModelRange();\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tlet resultText: string;\n\t\tconst preserveCase = this._state.preserveCase;\n\n\t\tif (replacePattern.hasReplacementPatterns || preserveCase) {\n\t\t\tresultText = modelText.replace(searchRegex, function () {\n\t\t\t\treturn replacePattern.buildReplaceString(<string[]><any>arguments, preserveCase);\n\t\t\t});\n\t\t} else {\n\t\t\tresultText = modelText.replace(searchRegex, replacePattern.buildReplaceString(null, preserveCase));\n\t\t}\n\n\t\tconst command = new ReplaceCommandThatPreservesSelection(fullModelRange, resultText, this._editor.getSelection());\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tprivate _regularReplaceAll(findScopes: Range[] | null): void {\n\t\tconst replacePattern = this._getReplacePattern();\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tconst matches = this._findMatches(findScopes, replacePattern.hasReplacementPatterns || this._state.preserveCase, Constants.MAX_SAFE_SMALL_INTEGER);\n\n\t\tconst replaceStrings: string[] = [];\n\t\tfor (let i = 0, len = matches.length; i < len; i++) {\n\t\t\treplaceStrings[i] = replacePattern.buildReplaceString(matches[i].matches, this._state.preserveCase);\n\t\t}\n\n\t\tconst command = new ReplaceAllCommand(this._editor.getSelection(), matches.map(m => m.range), replaceStrings);\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tpublic selectAllMatches(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tconst matches = this._findMatches(findScopes, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\t\tlet selections = matches.map(m => new Selection(m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn));\n\n\t\t// If one of the ranges is the editor selection, then maintain it as primary\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst sel = selections[i];\n\t\t\tif (sel.equalsRange(editorSelection)) {\n\t\t\t\tselections = [editorSelection].concat(selections.slice(0, i)).concat(selections.slice(i + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._editor.setSelections(selections);\n\t}\n\n\tprivate _executeEditorCommand(source: string, command: ICommand): void {\n\t\ttry {\n\t\t\tthis._ignoreModelContentChanged = true;\n\t\t\tthis._editor.pushUndoStop();\n\t\t\tthis._editor.executeCommand(source, command);\n\t\t\tthis._editor.pushUndoStop();\n\t\t} finally {\n\t\t\tthis._ignoreModelContentChanged = false;\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/find/browser/findModel.ts","vs/editor/contrib/find/browser/findModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,gBA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AA4E;QAC5E,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YACvD,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,GAAG,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC;gBACtC,UAAU,GAAG,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC9F,MAAM;YACP,CAAC;QACF,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAEO,qBAAqB,CAAC,MAAc,EAAE,OAAiB;QAC9D,IAAI,CAAC;YACJ,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC;YACvC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAC5B,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC7B,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,0BAA0B,GAAG,KAAK,CAAC;QACzC,CAAC;IACF,CAAC;CACD","file":"findModel.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { findFirstIdxMonotonousOrArrLen } from '../../../../base/common/arraysFind.js';\nimport { RunOnceScheduler, TimeoutTimer } from '../../../../base/common/async.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport { DisposableStore, dispose } from '../../../../base/common/lifecycle.js';\nimport { Constants } from '../../../../base/common/uint.js';\nimport { IActiveCodeEditor } from '../../../browser/editorBrowser.js';\nimport { ReplaceCommand, ReplaceCommandThatPreservesSelection } from '../../../common/commands/replaceCommand.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { ICommand, ScrollType } from '../../../common/editorCommon.js';\nimport { EndOfLinePreference, FindMatch, ITextModel } from '../../../common/model.js';\nimport { SearchParams } from '../../../common/model/textModelSearch.js';\nimport { FindDecorations } from './findDecorations.js';\nimport { FindReplaceState, FindReplaceStateChangedEvent } from './findState.js';\nimport { ReplaceAllCommand } from './replaceAllCommand.js';\nimport { parseReplaceString, ReplacePattern } from './replacePattern.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IKeybindings } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\n\nexport const CONTEXT_FIND_WIDGET_VISIBLE = new RawContextKey<boolean>('findWidgetVisible', false);\nexport const CONTEXT_FIND_WIDGET_NOT_VISIBLE = CONTEXT_FIND_WIDGET_VISIBLE.toNegated();\n// Keep ContextKey use of 'Focussed' to not break when clauses\nexport const CONTEXT_FIND_INPUT_FOCUSED = new RawContextKey<boolean>('findInputFocussed', false);\nexport const CONTEXT_REPLACE_INPUT_FOCUSED = new RawContextKey<boolean>('replaceInputFocussed', false);\n\nexport const ToggleCaseSensitiveKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyC,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyC }\n};\nexport const ToggleWholeWordKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyW,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyW }\n};\nexport const ToggleRegexKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyR,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyR }\n};\nexport const ToggleSearchScopeKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyL,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyL }\n};\nexport const TogglePreserveCaseKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyP,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyP }\n};\n\nexport const FIND_IDS = {\n\tStartFindAction: 'actions.find',\n\tStartFindWithSelection: 'actions.findWithSelection',\n\tStartFindWithArgs: 'editor.actions.findWithArgs',\n\tNextMatchFindAction: 'editor.action.nextMatchFindAction',\n\tPreviousMatchFindAction: 'editor.action.previousMatchFindAction',\n\tGoToMatchFindAction: 'editor.action.goToMatchFindAction',\n\tNextSelectionMatchFindAction: 'editor.action.nextSelectionMatchFindAction',\n\tPreviousSelectionMatchFindAction: 'editor.action.previousSelectionMatchFindAction',\n\tStartFindReplaceAction: 'editor.action.startFindReplaceAction',\n\tCloseFindWidgetCommand: 'closeFindWidget',\n\tToggleCaseSensitiveCommand: 'toggleFindCaseSensitive',\n\tToggleWholeWordCommand: 'toggleFindWholeWord',\n\tToggleRegexCommand: 'toggleFindRegex',\n\tToggleSearchScopeCommand: 'toggleFindInSelection',\n\tTogglePreserveCaseCommand: 'togglePreserveCase',\n\tReplaceOneAction: 'editor.action.replaceOne',\n\tReplaceAllAction: 'editor.action.replaceAll',\n\tSelectAllMatchesAction: 'editor.action.selectAllMatches'\n};\n\nexport const MATCHES_LIMIT = 19999;\nconst RESEARCH_DELAY = 240;\n\nexport class FindModelBoundToEditorModel {\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _state: FindReplaceState;\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _decorations: FindDecorations;\n\tprivate _ignoreModelContentChanged: boolean;\n\tprivate readonly _startSearchingTimer: TimeoutTimer;\n\n\tprivate readonly _updateDecorationsScheduler: RunOnceScheduler;\n\tprivate _isDisposed: boolean;\n\n\tconstructor(editor: IActiveCodeEditor, state: FindReplaceState) {\n\t\tthis._editor = editor;\n\t\tthis._state = state;\n\t\tthis._isDisposed = false;\n\t\tthis._startSearchingTimer = new TimeoutTimer();\n\n\t\tthis._decorations = new FindDecorations(editor);\n\t\tthis._toDispose.add(this._decorations);\n\n\t\tthis._updateDecorationsScheduler = new RunOnceScheduler(() => {\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.research(false);\n\t\t}, 100);\n\t\tthis._toDispose.add(this._updateDecorationsScheduler);\n\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => {\n\t\t\tif (\n\t\t\t\te.reason === CursorChangeReason.Explicit\n\t\t\t\t|| e.reason === CursorChangeReason.Undo\n\t\t\t\t|| e.reason === CursorChangeReason.Redo\n\t\t\t) {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t}\n\t\t}));\n\n\t\tthis._ignoreModelContentChanged = false;\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tif (this._ignoreModelContentChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e.isFlush) {\n\t\t\t\t// a model.setValue() was called\n\t\t\t\tthis._decorations.reset();\n\t\t\t}\n\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\tthis._updateDecorationsScheduler.schedule();\n\t\t}));\n\n\t\tthis._toDispose.add(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));\n\n\t\tthis.research(false, this._state.searchScope);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._isDisposed = true;\n\t\tdispose(this._startSearchingTimer);\n\t\tthis._toDispose.dispose();\n\t}\n\n\tprivate _onStateChanged(e: FindReplaceStateChangedEvent): void {\n\t\tif (this._isDisposed) {\n\t\t\t// The find model is disposed during a find state changed event\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\t// The find model will be disposed momentarily\n\t\t\treturn;\n\t\t}\n\t\tif (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) {\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (model.isTooLargeForSyncing()) {\n\t\t\t\tthis._startSearchingTimer.cancel();\n\n\t\t\t\tthis._startSearchingTimer.setIfNotSet(() => {\n\t\t\t\t\tif (e.searchScope) {\n\t\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t\t}\n\t\t\t\t}, RESEARCH_DELAY);\n\t\t\t} else {\n\t\t\t\tif (e.searchScope) {\n\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t} else {\n\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static _getSearchRange(model: ITextModel, findScope: Range | null): Range {\n\t\t// If we have set now or before a find scope, use it for computing the search range\n\t\tif (findScope) {\n\t\t\treturn findScope;\n\t\t}\n\n\t\treturn model.getFullModelRange();\n\t}\n\n\tprivate research(moveCursor: boolean, newFindScope?: Range | Range[] | null): void {\n\t\tlet findScopes: Range[] | null = null;\n\t\tif (typeof newFindScope !== 'undefined') {\n\t\t\tif (newFindScope !== null) {\n\t\t\t\tif (!Array.isArray(newFindScope)) {\n\t\t\t\t\tfindScopes = [newFindScope as Range];\n\t\t\t\t} else {\n\t\t\t\t\tfindScopes = newFindScope;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfindScopes = this._decorations.getFindScopes();\n\t\t}\n\t\tif (findScopes !== null) {\n\t\t\tfindScopes = findScopes.map(findScope => {\n\t\t\t\tif (findScope.startLineNumber !== findScope.endLineNumber) {\n\t\t\t\t\tlet endLineNumber = findScope.endLineNumber;\n\n\t\t\t\t\tif (findScope.endColumn === 1) {\n\t\t\t\t\t\tendLineNumber = endLineNumber - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new Range(findScope.startLineNumber, 1, endLineNumber, this._editor.getModel().getLineMaxColumn(endLineNumber));\n\t\t\t\t}\n\t\t\t\treturn findScope;\n\t\t\t});\n\t\t}\n\n\t\tconst findMatches = this._findMatches(findScopes, false, MATCHES_LIMIT);\n\t\tthis._decorations.set(findMatches, findScopes);\n\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tlet currentMatchesPosition = this._decorations.getCurrentMatchesPosition(editorSelection);\n\t\tif (currentMatchesPosition === 0 && findMatches.length > 0) {\n\t\t\t// current selection is not on top of a match\n\t\t\t// try to find its nearest result from the top of the document\n\t\t\tconst matchAfterSelection = findFirstIdxMonotonousOrArrLen(findMatches.map(match => match.range), range => Range.compareRangesUsingStarts(range, editorSelection) >= 0);\n\t\t\tcurrentMatchesPosition = matchAfterSelection > 0 ? matchAfterSelection - 1 + 1 /** match position is one based */ : currentMatchesPosition;\n\t\t}\n\n\t\tthis._state.changeMatchInfo(\n\t\t\tcurrentMatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tundefined\n\t\t);\n\n\t\tif (moveCursor && this._editor.getOption(EditorOption.find).cursorMoveOnType) {\n\t\t\tthis._moveToNextMatch(this._decorations.getStartPosition());\n\t\t}\n\t}\n\n\tprivate _hasMatches(): boolean {\n\t\treturn (this._state.matchesCount > 0);\n\t}\n\n\tprivate _cannotFind(): boolean {\n\t\tif (!this._hasMatches()) {\n\t\t\tconst findScope = this._decorations.getFindScope();\n\t\t\tif (findScope) {\n\t\t\t\t// Reveal the selection so user is reminded that 'selection find' is on.\n\t\t\t\tthis._editor.revealRangeInCenterIfOutsideViewport(findScope, ScrollType.Smooth);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _setCurrentFindMatch(match: Range): void {\n\t\tconst matchesPosition = this._decorations.setCurrentFindMatch(match);\n\t\tthis._state.changeMatchInfo(\n\t\t\tmatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tmatch\n\t\t);\n\n\t\tthis._editor.setSelection(match);\n\t\tthis._editor.revealRangeInCenterIfOutsideViewport(match, ScrollType.Smooth);\n\t}\n\n\tprivate _prevSearchPosition(before: Position) {\n\t\tconst isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\t\tlet { lineNumber, column } = before;\n\t\tconst model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === 1) {\n\t\t\tif (lineNumber === 1) {\n\t\t\t\tlineNumber = model.getLineCount();\n\t\t\t} else {\n\t\t\t\tlineNumber--;\n\t\t\t}\n\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t} else {\n\t\t\tcolumn--;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToPrevMatch(before: Position, isRecursed: boolean = false): void {\n\t\tif (!this._state.canNavigateBack()) {\n\t\t\t// we are beyond the first matched find result\n\t\t\t// instead of doing nothing, we should refocus the first item\n\t\t\tconst nextMatchRange = this._decorations.matchAfterPosition(before);\n\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet prevMatchRange = this._decorations.matchBeforePosition(before);\n\n\t\t\tif (prevMatchRange && prevMatchRange.isEmpty() && prevMatchRange.getStartPosition().equals(before)) {\n\t\t\t\tbefore = this._prevSearchPosition(before);\n\t\t\t\tprevMatchRange = this._decorations.matchBeforePosition(before);\n\t\t\t}\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cannotFind()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScope = this._decorations.getFindScope();\n\t\tconst searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(before)) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (before.isBefore(searchRange.getStartPosition())) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\tconst { lineNumber, column } = before;\n\t\tconst model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\n\t\tif (prevMatch && prevMatch.range.isEmpty() && prevMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._prevSearchPosition(position);\n\t\t\tprevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\t\t}\n\n\t\tif (!prevMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(prevMatch.range)) {\n\t\t\treturn this._moveToPrevMatch(prevMatch.range.getStartPosition(), true);\n\t\t}\n\n\t\tthis._setCurrentFindMatch(prevMatch.range);\n\t}\n\n\tpublic moveToPrevMatch(): void {\n\t\tthis._moveToPrevMatch(this._editor.getSelection().getStartPosition());\n\t}\n\n\tprivate _nextSearchPosition(after: Position) {\n\t\tconst isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\n\t\tlet { lineNumber, column } = after;\n\t\tconst model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === model.getLineMaxColumn(lineNumber)) {\n\t\t\tif (lineNumber === model.getLineCount()) {\n\t\t\t\tlineNumber = 1;\n\t\t\t} else {\n\t\t\t\tlineNumber++;\n\t\t\t}\n\t\t\tcolumn = 1;\n\t\t} else {\n\t\t\tcolumn++;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToNextMatch(after: Position): void {\n\t\tif (!this._state.canNavigateForward()) {\n\t\t\t// we are beyond the last matched find result\n\t\t\t// instead of doing nothing, we should refocus the last item\n\t\t\tconst prevMatchRange = this._decorations.matchBeforePosition(after);\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet nextMatchRange = this._decorations.matchAfterPosition(after);\n\n\t\t\tif (nextMatchRange && nextMatchRange.isEmpty() && nextMatchRange.getStartPosition().equals(after)) {\n\t\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\t\tafter = this._nextSearchPosition(after);\n\t\t\t\tnextMatchRange = this._decorations.matchAfterPosition(after);\n\t\t\t}\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextMatch = this._getNextMatch(after, false, true);\n\t\tif (nextMatch) {\n\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t}\n\t}\n\n\tprivate _getNextMatch(after: Position, captureMatches: boolean, forceMove: boolean, isRecursed: boolean = false): FindMatch | null {\n\t\tif (this._cannotFind()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst findScope = this._decorations.getFindScope();\n\t\tconst searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(after)) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (after.isBefore(searchRange.getStartPosition())) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\tconst { lineNumber, column } = after;\n\t\tconst model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\n\t\tif (forceMove && nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._nextSearchPosition(position);\n\t\t\tnextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\t\t}\n\n\t\tif (!nextMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(nextMatch.range)) {\n\t\t\treturn this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, forceMove, true);\n\t\t}\n\n\t\treturn nextMatch;\n\t}\n\n\tpublic moveToNextMatch(): void {\n\t\tthis._moveToNextMatch(this._editor.getSelection().getEndPosition());\n\t}\n\n\tprivate _moveToMatch(index: number): void {\n\t\tconst decorationRange = this._decorations.getDecorationRangeAt(index);\n\t\tif (decorationRange) {\n\t\t\tthis._setCurrentFindMatch(decorationRange);\n\t\t}\n\t}\n\n\tpublic moveToMatch(index: number): void {\n\t\tthis._moveToMatch(index);\n\t}\n\n\tprivate _getReplacePattern(): ReplacePattern {\n\t\tif (this._state.isRegex) {\n\t\t\treturn parseReplaceString(this._state.replaceString);\n\t\t}\n\t\treturn ReplacePattern.fromStaticValue(this._state.replaceString);\n\t}\n\n\tpublic replace(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tconst selection = this._editor.getSelection();\n\t\tconst nextMatch = this._getNextMatch(selection.getStartPosition(), true, false);\n\t\tif (nextMatch) {\n\t\t\tif (selection.equalsRange(nextMatch.range)) {\n\t\t\t\t// selection sits on a find match => replace it!\n\t\t\t\tconst replaceString = replacePattern.buildReplaceString(nextMatch.matches, this._state.preserveCase);\n\n\t\t\t\tconst command = new ReplaceCommand(selection, replaceString);\n\n\t\t\t\tthis._executeEditorCommand('replace', command);\n\n\t\t\t\tthis._decorations.setStartPosition(new Position(selection.startLineNumber, selection.startColumn + replaceString.length));\n\t\t\t\tthis.research(true);\n\t\t\t} else {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _findMatches(findScopes: Range[] | null, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst searchRanges = (findScopes as [] || [null]).map((scope: Range | null) =>\n\t\t\tFindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), scope)\n\t\t);\n\n\t\treturn this._editor.getModel().findMatches(this._state.searchString, searchRanges, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches, limitResultCount);\n\t}\n\n\tpublic replaceAll(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\tif (findScopes === null && this._state.matchesCount >= MATCHES_LIMIT) {\n\t\t\t// Doing a replace on the entire file that is over ${MATCHES_LIMIT} matches\n\t\t\tthis._largeReplaceAll();\n\t\t} else {\n\t\t\tthis._regularReplaceAll(findScopes);\n\t\t}\n\n\t\tthis.research(false);\n\t}\n\n\tprivate _largeReplaceAll(): void {\n\t\tconst searchParams = new SearchParams(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null);\n\t\tconst searchData = searchParams.parseSearchRequest();\n\t\tif (!searchData) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet searchRegex = searchData.regex;\n\t\tif (!searchRegex.multiline) {\n\t\t\tlet mod = 'mu';\n\t\t\tif (searchRegex.ignoreCase) {\n\t\t\t\tmod += 'i';\n\t\t\t}\n\t\t\tif (searchRegex.global) {\n\t\t\t\tmod += 'g';\n\t\t\t}\n\t\t\tsearchRegex = new RegExp(searchRegex.source, mod);\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst modelText = model.getValue(EndOfLinePreference.LF);\n\t\tconst fullModelRange = model.getFullModelRange();\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tlet resultText: string;\n\t\tconst preserveCase = this._state.preserveCase;\n\n\t\tif (replacePattern.hasReplacementPatterns || preserveCase) {\n\t\t\tresultText = modelText.replace(searchRegex, function () {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\treturn replacePattern.buildReplaceString(<string[]><any>arguments, preserveCase);\n\t\t\t});\n\t\t} else {\n\t\t\tresultText = modelText.replace(searchRegex, replacePattern.buildReplaceString(null, preserveCase));\n\t\t}\n\n\t\tconst command = new ReplaceCommandThatPreservesSelection(fullModelRange, resultText, this._editor.getSelection());\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tprivate _regularReplaceAll(findScopes: Range[] | null): void {\n\t\tconst replacePattern = this._getReplacePattern();\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tconst matches = this._findMatches(findScopes, replacePattern.hasReplacementPatterns || this._state.preserveCase, Constants.MAX_SAFE_SMALL_INTEGER);\n\n\t\tconst replaceStrings: string[] = [];\n\t\tfor (let i = 0, len = matches.length; i < len; i++) {\n\t\t\treplaceStrings[i] = replacePattern.buildReplaceString(matches[i].matches, this._state.preserveCase);\n\t\t}\n\n\t\tconst command = new ReplaceAllCommand(this._editor.getSelection(), matches.map(m => m.range), replaceStrings);\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tpublic selectAllMatches(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tconst matches = this._findMatches(findScopes, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\t\tlet selections = matches.map(m => new Selection(m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn));\n\n\t\t// If one of the ranges is the editor selection, then maintain it as primary\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst sel = selections[i];\n\t\t\tif (sel.equalsRange(editorSelection)) {\n\t\t\t\tselections = [editorSelection].concat(selections.slice(0, i)).concat(selections.slice(i + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._editor.setSelections(selections);\n\t}\n\n\tprivate _executeEditorCommand(source: string, command: ICommand): void {\n\t\ttry {\n\t\t\tthis._ignoreModelContentChanged = true;\n\t\t\tthis._editor.pushUndoStop();\n\t\t\tthis._editor.executeCommand(source, command);\n\t\t\tthis._editor.pushUndoStop();\n\t\t} finally {\n\t\t\tthis._ignoreModelContentChanged = false;\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { findFirstIdxMonotonousOrArrLen } from '../../../../base/common/arraysFind.js';\nimport { RunOnceScheduler, TimeoutTimer } from '../../../../base/common/async.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport { DisposableStore, dispose } from '../../../../base/common/lifecycle.js';\nimport { Constants } from '../../../../base/common/uint.js';\nimport { IActiveCodeEditor } from '../../../browser/editorBrowser.js';\nimport { ReplaceCommand, ReplaceCommandThatPreservesSelection } from '../../../common/commands/replaceCommand.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { ICommand, ScrollType } from '../../../common/editorCommon.js';\nimport { EndOfLinePreference, FindMatch, ITextModel } from '../../../common/model.js';\nimport { SearchParams } from '../../../common/model/textModelSearch.js';\nimport { FindDecorations } from './findDecorations.js';\nimport { FindReplaceState, FindReplaceStateChangedEvent } from './findState.js';\nimport { ReplaceAllCommand } from './replaceAllCommand.js';\nimport { parseReplaceString, ReplacePattern } from './replacePattern.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IKeybindings } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\n\nexport const CONTEXT_FIND_WIDGET_VISIBLE = new RawContextKey<boolean>('findWidgetVisible', false);\nexport const CONTEXT_FIND_WIDGET_NOT_VISIBLE = CONTEXT_FIND_WIDGET_VISIBLE.toNegated();\n// Keep ContextKey use of 'Focussed' to not break when clauses\nexport const CONTEXT_FIND_INPUT_FOCUSED = new RawContextKey<boolean>('findInputFocussed', false);\nexport const CONTEXT_REPLACE_INPUT_FOCUSED = new RawContextKey<boolean>('replaceInputFocussed', false);\n\nexport const ToggleCaseSensitiveKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyC,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyC }\n};\nexport const ToggleWholeWordKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyW,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyW }\n};\nexport const ToggleRegexKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyR,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyR }\n};\nexport const ToggleSearchScopeKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyL,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyL }\n};\nexport const TogglePreserveCaseKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KeyP,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyP }\n};\n\nexport const FIND_IDS = {\n\tStartFindAction: 'actions.find',\n\tStartFindWithSelection: 'actions.findWithSelection',\n\tStartFindWithArgs: 'editor.actions.findWithArgs',\n\tNextMatchFindAction: 'editor.action.nextMatchFindAction',\n\tPreviousMatchFindAction: 'editor.action.previousMatchFindAction',\n\tGoToMatchFindAction: 'editor.action.goToMatchFindAction',\n\tNextSelectionMatchFindAction: 'editor.action.nextSelectionMatchFindAction',\n\tPreviousSelectionMatchFindAction: 'editor.action.previousSelectionMatchFindAction',\n\tStartFindReplaceAction: 'editor.action.startFindReplaceAction',\n\tCloseFindWidgetCommand: 'closeFindWidget',\n\tToggleCaseSensitiveCommand: 'toggleFindCaseSensitive',\n\tToggleWholeWordCommand: 'toggleFindWholeWord',\n\tToggleRegexCommand: 'toggleFindRegex',\n\tToggleSearchScopeCommand: 'toggleFindInSelection',\n\tTogglePreserveCaseCommand: 'togglePreserveCase',\n\tReplaceOneAction: 'editor.action.replaceOne',\n\tReplaceAllAction: 'editor.action.replaceAll',\n\tSelectAllMatchesAction: 'editor.action.selectAllMatches'\n};\n\nexport const MATCHES_LIMIT = 19999;\nconst RESEARCH_DELAY = 240;\n\nexport class FindModelBoundToEditorModel {\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _state: FindReplaceState;\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _decorations: FindDecorations;\n\tprivate _ignoreModelContentChanged: boolean;\n\tprivate readonly _startSearchingTimer: TimeoutTimer;\n\n\tprivate readonly _updateDecorationsScheduler: RunOnceScheduler;\n\tprivate _isDisposed: boolean;\n\n\tconstructor(editor: IActiveCodeEditor, state: FindReplaceState) {\n\t\tthis._editor = editor;\n\t\tthis._state = state;\n\t\tthis._isDisposed = false;\n\t\tthis._startSearchingTimer = new TimeoutTimer();\n\n\t\tthis._decorations = new FindDecorations(editor);\n\t\tthis._toDispose.add(this._decorations);\n\n\t\tthis._updateDecorationsScheduler = new RunOnceScheduler(() => {\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.research(false);\n\t\t}, 100);\n\t\tthis._toDispose.add(this._updateDecorationsScheduler);\n\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => {\n\t\t\tif (\n\t\t\t\te.reason === CursorChangeReason.Explicit\n\t\t\t\t|| e.reason === CursorChangeReason.Undo\n\t\t\t\t|| e.reason === CursorChangeReason.Redo\n\t\t\t) {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t}\n\t\t}));\n\n\t\tthis._ignoreModelContentChanged = false;\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent((e) => {\n\t\t\tif (this._ignoreModelContentChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e.isFlush) {\n\t\t\t\t// a model.setValue() was called\n\t\t\t\tthis._decorations.reset();\n\t\t\t}\n\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\tthis._updateDecorationsScheduler.schedule();\n\t\t}));\n\n\t\tthis._toDispose.add(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));\n\n\t\tthis.research(false, this._state.searchScope);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._isDisposed = true;\n\t\tdispose(this._startSearchingTimer);\n\t\tthis._toDispose.dispose();\n\t}\n\n\tprivate _onStateChanged(e: FindReplaceStateChangedEvent): void {\n\t\tif (this._isDisposed) {\n\t\t\t// The find model is disposed during a find state changed event\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\t// The find model will be disposed momentarily\n\t\t\treturn;\n\t\t}\n\t\tif (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) {\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (model.isTooLargeForSyncing()) {\n\t\t\t\tthis._startSearchingTimer.cancel();\n\n\t\t\t\tthis._startSearchingTimer.setIfNotSet(() => {\n\t\t\t\t\tif (e.searchScope) {\n\t\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t\t}\n\t\t\t\t}, RESEARCH_DELAY);\n\t\t\t} else {\n\t\t\t\tif (e.searchScope) {\n\t\t\t\t\tthis.research(e.moveCursor, this._state.searchScope);\n\t\t\t\t} else {\n\t\t\t\t\tthis.research(e.moveCursor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static _getSearchRange(model: ITextModel, findScope: Range | null): Range {\n\t\t// If we have set now or before a find scope, use it for computing the search range\n\t\tif (findScope) {\n\t\t\treturn findScope;\n\t\t}\n\n\t\treturn model.getFullModelRange();\n\t}\n\n\tprivate research(moveCursor: boolean, newFindScope?: Range | Range[] | null): void {\n\t\tlet findScopes: Range[] | null = null;\n\t\tif (typeof newFindScope !== 'undefined') {\n\t\t\tif (newFindScope !== null) {\n\t\t\t\tif (!Array.isArray(newFindScope)) {\n\t\t\t\t\tfindScopes = [newFindScope as Range];\n\t\t\t\t} else {\n\t\t\t\t\tfindScopes = newFindScope;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfindScopes = this._decorations.getFindScopes();\n\t\t}\n\t\tif (findScopes !== null) {\n\t\t\tfindScopes = findScopes.map(findScope => {\n\t\t\t\tif (findScope.startLineNumber !== findScope.endLineNumber) {\n\t\t\t\t\tlet endLineNumber = findScope.endLineNumber;\n\n\t\t\t\t\tif (findScope.endColumn === 1) {\n\t\t\t\t\t\tendLineNumber = endLineNumber - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new Range(findScope.startLineNumber, 1, endLineNumber, this._editor.getModel().getLineMaxColumn(endLineNumber));\n\t\t\t\t}\n\t\t\t\treturn findScope;\n\t\t\t});\n\t\t}\n\n\t\tconst findMatches = this._findMatches(findScopes, false, MATCHES_LIMIT);\n\t\tthis._decorations.set(findMatches, findScopes);\n\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tlet currentMatchesPosition = this._decorations.getCurrentMatchesPosition(editorSelection);\n\t\tif (currentMatchesPosition === 0 && findMatches.length > 0) {\n\t\t\t// current selection is not on top of a match\n\t\t\t// try to find its nearest result from the top of the document\n\t\t\tconst matchAfterSelection = findFirstIdxMonotonousOrArrLen(findMatches.map(match => match.range), range => Range.compareRangesUsingStarts(range, editorSelection) >= 0);\n\t\t\tcurrentMatchesPosition = matchAfterSelection > 0 ? matchAfterSelection - 1 + 1 /** match position is one based */ : currentMatchesPosition;\n\t\t}\n\n\t\tthis._state.changeMatchInfo(\n\t\t\tcurrentMatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tundefined\n\t\t);\n\n\t\tif (moveCursor && this._editor.getOption(EditorOption.find).cursorMoveOnType) {\n\t\t\tthis._moveToNextMatch(this._decorations.getStartPosition());\n\t\t}\n\t}\n\n\tprivate _hasMatches(): boolean {\n\t\treturn (this._state.matchesCount > 0);\n\t}\n\n\tprivate _cannotFind(): boolean {\n\t\tif (!this._hasMatches()) {\n\t\t\tconst findScope = this._decorations.getFindScope();\n\t\t\tif (findScope) {\n\t\t\t\t// Reveal the selection so user is reminded that 'selection find' is on.\n\t\t\t\tthis._editor.revealRangeInCenterIfOutsideViewport(findScope, ScrollType.Smooth);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _setCurrentFindMatch(match: Range): void {\n\t\tconst matchesPosition = this._decorations.setCurrentFindMatch(match);\n\t\tthis._state.changeMatchInfo(\n\t\t\tmatchesPosition,\n\t\t\tthis._decorations.getCount(),\n\t\t\tmatch\n\t\t);\n\n\t\tthis._editor.setSelection(match);\n\t\tthis._editor.revealRangeInCenterIfOutsideViewport(match, ScrollType.Smooth);\n\t}\n\n\tprivate _prevSearchPosition(before: Position) {\n\t\tconst isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\t\tlet { lineNumber, column } = before;\n\t\tconst model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === 1) {\n\t\t\tif (lineNumber === 1) {\n\t\t\t\tlineNumber = model.getLineCount();\n\t\t\t} else {\n\t\t\t\tlineNumber--;\n\t\t\t}\n\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t} else {\n\t\t\tcolumn--;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToPrevMatch(before: Position, isRecursed: boolean = false): void {\n\t\tif (!this._state.canNavigateBack()) {\n\t\t\t// we are beyond the first matched find result\n\t\t\t// instead of doing nothing, we should refocus the first item\n\t\t\tconst nextMatchRange = this._decorations.matchAfterPosition(before);\n\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet prevMatchRange = this._decorations.matchBeforePosition(before);\n\n\t\t\tif (prevMatchRange && prevMatchRange.isEmpty() && prevMatchRange.getStartPosition().equals(before)) {\n\t\t\t\tbefore = this._prevSearchPosition(before);\n\t\t\t\tprevMatchRange = this._decorations.matchBeforePosition(before);\n\t\t\t}\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cannotFind()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScope = this._decorations.getFindScope();\n\t\tconst searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(before)) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (before.isBefore(searchRange.getStartPosition())) {\n\t\t\tbefore = searchRange.getEndPosition();\n\t\t}\n\n\t\tconst { lineNumber, column } = before;\n\t\tconst model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\n\t\tif (prevMatch && prevMatch.range.isEmpty() && prevMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._prevSearchPosition(position);\n\t\t\tprevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, false);\n\t\t}\n\n\t\tif (!prevMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(prevMatch.range)) {\n\t\t\treturn this._moveToPrevMatch(prevMatch.range.getStartPosition(), true);\n\t\t}\n\n\t\tthis._setCurrentFindMatch(prevMatch.range);\n\t}\n\n\tpublic moveToPrevMatch(): void {\n\t\tthis._moveToPrevMatch(this._editor.getSelection().getStartPosition());\n\t}\n\n\tprivate _nextSearchPosition(after: Position) {\n\t\tconst isUsingLineStops = this._state.isRegex && (\n\t\t\tthis._state.searchString.indexOf('^') >= 0\n\t\t\t|| this._state.searchString.indexOf('$') >= 0\n\t\t);\n\n\t\tlet { lineNumber, column } = after;\n\t\tconst model = this._editor.getModel();\n\n\t\tif (isUsingLineStops || column === model.getLineMaxColumn(lineNumber)) {\n\t\t\tif (lineNumber === model.getLineCount()) {\n\t\t\t\tlineNumber = 1;\n\t\t\t} else {\n\t\t\t\tlineNumber++;\n\t\t\t}\n\t\t\tcolumn = 1;\n\t\t} else {\n\t\t\tcolumn++;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate _moveToNextMatch(after: Position): void {\n\t\tif (!this._state.canNavigateForward()) {\n\t\t\t// we are beyond the last matched find result\n\t\t\t// instead of doing nothing, we should refocus the last item\n\t\t\tconst prevMatchRange = this._decorations.matchBeforePosition(after);\n\n\t\t\tif (prevMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(prevMatchRange);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this._decorations.getCount() < MATCHES_LIMIT) {\n\t\t\tlet nextMatchRange = this._decorations.matchAfterPosition(after);\n\n\t\t\tif (nextMatchRange && nextMatchRange.isEmpty() && nextMatchRange.getStartPosition().equals(after)) {\n\t\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\t\tafter = this._nextSearchPosition(after);\n\t\t\t\tnextMatchRange = this._decorations.matchAfterPosition(after);\n\t\t\t}\n\t\t\tif (nextMatchRange) {\n\t\t\t\tthis._setCurrentFindMatch(nextMatchRange);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextMatch = this._getNextMatch(after, false, true);\n\t\tif (nextMatch) {\n\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t}\n\t}\n\n\tprivate _getNextMatch(after: Position, captureMatches: boolean, forceMove: boolean, isRecursed: boolean = false): FindMatch | null {\n\t\tif (this._cannotFind()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst findScope = this._decorations.getFindScope();\n\t\tconst searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\n\t\t// ...(----)...|...\n\t\tif (searchRange.getEndPosition().isBefore(after)) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\t// ...|...(----)...\n\t\tif (after.isBefore(searchRange.getStartPosition())) {\n\t\t\tafter = searchRange.getStartPosition();\n\t\t}\n\n\t\tconst { lineNumber, column } = after;\n\t\tconst model = this._editor.getModel();\n\n\t\tlet position = new Position(lineNumber, column);\n\n\t\tlet nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\n\t\tif (forceMove && nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) {\n\t\t\t// Looks like we're stuck at this position, unacceptable!\n\t\t\tposition = this._nextSearchPosition(position);\n\t\t\tnextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches);\n\t\t}\n\n\t\tif (!nextMatch) {\n\t\t\t// there is precisely one match and selection is on top of it\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!isRecursed && !searchRange.containsRange(nextMatch.range)) {\n\t\t\treturn this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, forceMove, true);\n\t\t}\n\n\t\treturn nextMatch;\n\t}\n\n\tpublic moveToNextMatch(): void {\n\t\tthis._moveToNextMatch(this._editor.getSelection().getEndPosition());\n\t}\n\n\tprivate _moveToMatch(index: number): void {\n\t\tconst decorationRange = this._decorations.getDecorationRangeAt(index);\n\t\tif (decorationRange) {\n\t\t\tthis._setCurrentFindMatch(decorationRange);\n\t\t}\n\t}\n\n\tpublic moveToMatch(index: number): void {\n\t\tthis._moveToMatch(index);\n\t}\n\n\tprivate _getReplacePattern(): ReplacePattern {\n\t\tif (this._state.isRegex) {\n\t\t\treturn parseReplaceString(this._state.replaceString);\n\t\t}\n\t\treturn ReplacePattern.fromStaticValue(this._state.replaceString);\n\t}\n\n\tpublic replace(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tconst selection = this._editor.getSelection();\n\t\tconst nextMatch = this._getNextMatch(selection.getStartPosition(), true, false);\n\t\tif (nextMatch) {\n\t\t\tif (selection.equalsRange(nextMatch.range)) {\n\t\t\t\t// selection sits on a find match => replace it!\n\t\t\t\tconst replaceString = replacePattern.buildReplaceString(nextMatch.matches, this._state.preserveCase);\n\n\t\t\t\tconst command = new ReplaceCommand(selection, replaceString);\n\n\t\t\t\tthis._executeEditorCommand('replace', command);\n\n\t\t\t\tthis._decorations.setStartPosition(new Position(selection.startLineNumber, selection.startColumn + replaceString.length));\n\t\t\t\tthis.research(true);\n\t\t\t} else {\n\t\t\t\tthis._decorations.setStartPosition(this._editor.getPosition());\n\t\t\t\tthis._setCurrentFindMatch(nextMatch.range);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _findMatches(findScopes: Range[] | null, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tconst searchRanges = (findScopes as [] || [null]).map((scope: Range | null) =>\n\t\t\tFindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), scope)\n\t\t);\n\n\t\treturn this._editor.getModel().findMatches(this._state.searchString, searchRanges, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null, captureMatches, limitResultCount);\n\t}\n\n\tpublic replaceAll(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\tif (findScopes === null && this._state.matchesCount >= MATCHES_LIMIT) {\n\t\t\t// Doing a replace on the entire file that is over ${MATCHES_LIMIT} matches\n\t\t\tthis._largeReplaceAll();\n\t\t} else {\n\t\t\tthis._regularReplaceAll(findScopes);\n\t\t}\n\n\t\tthis.research(false);\n\t}\n\n\tprivate _largeReplaceAll(): void {\n\t\tconst searchParams = new SearchParams(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(EditorOption.wordSeparators) : null);\n\t\tconst searchData = searchParams.parseSearchRequest();\n\t\tif (!searchData) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet searchRegex = searchData.regex;\n\t\tif (!searchRegex.multiline) {\n\t\t\tlet mod = 'mu';\n\t\t\tif (searchRegex.ignoreCase) {\n\t\t\t\tmod += 'i';\n\t\t\t}\n\t\t\tif (searchRegex.global) {\n\t\t\t\tmod += 'g';\n\t\t\t}\n\t\t\tsearchRegex = new RegExp(searchRegex.source, mod);\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst modelText = model.getValue(EndOfLinePreference.LF);\n\t\tconst fullModelRange = model.getFullModelRange();\n\n\t\tconst replacePattern = this._getReplacePattern();\n\t\tlet resultText: string;\n\t\tconst preserveCase = this._state.preserveCase;\n\n\t\tif (replacePattern.hasReplacementPatterns || preserveCase) {\n\t\t\tresultText = modelText.replace(searchRegex, function () {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\treturn replacePattern.buildReplaceString(<string[]><any>arguments, preserveCase);\n\t\t\t});\n\t\t} else {\n\t\t\tresultText = modelText.replace(searchRegex, replacePattern.buildReplaceString(null, preserveCase));\n\t\t}\n\n\t\tconst command = new ReplaceCommandThatPreservesSelection(fullModelRange, resultText, this._editor.getSelection());\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tprivate _regularReplaceAll(findScopes: Range[] | null): void {\n\t\tconst replacePattern = this._getReplacePattern();\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tconst matches = this._findMatches(findScopes, replacePattern.hasReplacementPatterns || this._state.preserveCase, Constants.MAX_SAFE_SMALL_INTEGER);\n\n\t\tconst replaceStrings: string[] = [];\n\t\tfor (let i = 0, len = matches.length; i < len; i++) {\n\t\t\treplaceStrings[i] = replacePattern.buildReplaceString(matches[i].matches, this._state.preserveCase);\n\t\t}\n\n\t\tconst command = new ReplaceAllCommand(this._editor.getSelection(), matches.map(m => m.range), replaceStrings);\n\t\tthis._executeEditorCommand('replaceAll', command);\n\t}\n\n\tpublic selectAllMatches(): void {\n\t\tif (!this._hasMatches()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst findScopes = this._decorations.getFindScopes();\n\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tconst matches = this._findMatches(findScopes, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\t\tlet selections = matches.map(m => new Selection(m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn));\n\n\t\t// If one of the ranges is the editor selection, then maintain it as primary\n\t\tconst editorSelection = this._editor.getSelection();\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst sel = selections[i];\n\t\t\tif (sel.equalsRange(editorSelection)) {\n\t\t\t\tselections = [editorSelection].concat(selections.slice(0, i)).concat(selections.slice(i + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._editor.setSelections(selections);\n\t}\n\n\tprivate _executeEditorCommand(source: string, command: ICommand): void {\n\t\ttry {\n\t\t\tthis._ignoreModelContentChanged = true;\n\t\t\tthis._editor.pushUndoStop();\n\t\t\tthis._editor.executeCommand(source, command);\n\t\t\tthis._editor.pushUndoStop();\n\t\t} finally {\n\t\t\tthis._ignoreModelContentChanged = false;\n\t\t}\n\t}\n}\n"]}
@@ -24,7 +24,7 @@
24
24
  background-color: var(--vscode-editorWidget-background);
25
25
  }
26
26
 
27
- .monaco-workbench.reduce-motion .monaco-editor .find-widget {
27
+ .monaco-reduce-motion .monaco-editor .find-widget {
28
28
  transition: transform 0ms linear;
29
29
  }
30
30
 
@@ -41,7 +41,7 @@
41
41
  display: flex;
42
42
  }
43
43
 
44
- .monaco-editor .find-widget.visible {
44
+ .monaco-editor .find-widget.visible {
45
45
  transform: translateY(0);
46
46
  }
47
47
 
@@ -101,7 +101,7 @@
101
101
  .monaco-editor .find-widget .monaco-findInput {
102
102
  vertical-align: middle;
103
103
  display: flex;
104
- flex:1;
104
+ flex: 1;
105
105
  }
106
106
 
107
107
  .monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element {
@@ -201,7 +201,7 @@
201
201
 
202
202
  /* REDUCED */
203
203
  .monaco-editor .find-widget.reduced-find-widget .matchesCount {
204
- display:none;
204
+ display: none;
205
205
  }
206
206
 
207
207
  /* NARROW (SMALLER THAN REDUCED) */
@@ -219,7 +219,7 @@
219
219
  .monaco-editor .find-widget.collapsed-find-widget .button.replace,
220
220
  .monaco-editor .find-widget.collapsed-find-widget .button.replace-all,
221
221
  .monaco-editor .find-widget.collapsed-find-widget > .find-part .monaco-findInput .controls {
222
- display:none;
222
+ display: none;
223
223
  }
224
224
 
225
225
  .monaco-editor .find-widget.no-results .matchesCount {
@@ -16,10 +16,10 @@
16
16
  margin-left: 2px;
17
17
  }
18
18
 
19
- .monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,
20
- .monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,
21
- .monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,
22
- .monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed {
19
+ .monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,
20
+ .monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,
21
+ .monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,
22
+ .monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed {
23
23
  transition: initial;
24
24
  }
25
25