monaco-editor-core 0.56.0-dev-20251124 → 0.56.0-dev-20251217

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 (337) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +34 -2
  18. package/esm/vs/base/browser/dom.js +1 -4
  19. package/esm/vs/base/browser/dom.js.map +1 -1
  20. package/esm/vs/base/browser/markdownRenderer.js +25 -11
  21. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  22. package/esm/vs/base/browser/ui/button/button.js +15 -8
  23. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  24. package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
  25. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  26. package/esm/vs/base/browser/ui/list/list.css +1 -0
  27. package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
  28. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  29. package/esm/vs/base/common/async.js +11 -0
  30. package/esm/vs/base/common/async.js.map +1 -1
  31. package/esm/vs/base/common/codiconsLibrary.js +11 -2
  32. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  33. package/esm/vs/base/common/defaultAccount.js +6 -0
  34. package/esm/vs/base/common/defaultAccount.js.map +1 -0
  35. package/esm/vs/base/common/equals.js +73 -24
  36. package/esm/vs/base/common/equals.js.map +1 -1
  37. package/esm/vs/base/common/event.js +14 -4
  38. package/esm/vs/base/common/event.js.map +1 -1
  39. package/esm/vs/base/common/iterator.js.map +1 -1
  40. package/esm/vs/base/common/keybindings.js +0 -8
  41. package/esm/vs/base/common/keybindings.js.map +1 -1
  42. package/esm/vs/base/common/lifecycle.js +2 -2
  43. package/esm/vs/base/common/lifecycle.js.map +1 -1
  44. package/esm/vs/base/common/marshallingIds.js.map +1 -1
  45. package/esm/vs/base/common/observableInternal/index.js +1 -1
  46. package/esm/vs/base/common/observableInternal/index.js.map +1 -1
  47. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
  48. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
  49. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
  50. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
  51. package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
  52. package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
  53. package/esm/vs/base/common/product.js.map +1 -1
  54. package/esm/vs/base/common/strings.js +3 -1
  55. package/esm/vs/base/common/strings.js.map +1 -1
  56. package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
  57. package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
  58. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
  59. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  60. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
  61. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  62. package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
  63. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
  64. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  65. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
  66. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
  67. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
  68. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
  69. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
  70. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
  71. package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
  72. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  73. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  74. package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
  75. package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
  76. package/esm/vs/editor/browser/view.js +11 -2
  77. package/esm/vs/editor/browser/view.js.map +1 -1
  78. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
  79. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  80. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
  81. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  82. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  83. package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
  84. package/esm/vs/editor/common/config/fontInfo.js +1 -1
  85. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  86. package/esm/vs/editor/common/core/edits/edit.js +19 -0
  87. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  88. package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
  89. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  90. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  91. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
  92. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
  93. package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
  94. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  95. package/esm/vs/editor/common/cursor/cursorWordOperations.js +6 -3
  96. package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
  97. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
  98. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
  99. package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
  100. package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
  101. package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
  102. package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
  103. package/esm/vs/editor/common/languages.js +2 -1
  104. package/esm/vs/editor/common/languages.js.map +1 -1
  105. package/esm/vs/editor/common/model/decorationProvider.js +21 -1
  106. package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
  107. package/esm/vs/editor/common/model/textModel.js +49 -30
  108. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  109. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
  110. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
  111. package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
  112. package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
  113. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
  114. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
  115. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
  116. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
  117. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
  118. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
  119. package/esm/vs/editor/common/textModelEditSource.js +2 -0
  120. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  121. package/esm/vs/editor/common/textModelEvents.js.map +1 -1
  122. package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
  123. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +1 -1
  124. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  125. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +54 -36
  126. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  127. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +14 -1
  128. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  129. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
  130. package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
  131. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
  132. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  133. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  134. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
  135. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  136. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +2 -0
  137. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
  138. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +33 -4
  139. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
  140. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
  141. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
  142. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
  143. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  144. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  145. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  146. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -1
  147. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
  148. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
  149. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
  150. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
  151. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
  152. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
  153. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
  154. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -65
  155. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  156. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +69 -13
  157. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  158. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +159 -94
  159. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  160. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +124 -50
  161. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
  162. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +393 -0
  163. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -0
  164. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  165. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
  166. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
  167. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
  168. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  169. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +29 -8
  170. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
  171. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +78 -46
  172. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  173. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
  174. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  175. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
  176. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  177. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
  178. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  179. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +48 -0
  180. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  181. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +18 -15
  182. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  183. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
  184. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
  185. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
  186. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
  187. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
  188. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
  189. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
  190. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
  191. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +8 -8
  192. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
  193. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
  194. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
  195. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
  196. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
  197. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
  198. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
  199. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
  200. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
  201. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
  202. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
  203. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
  204. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
  205. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
  206. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
  207. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
  208. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
  209. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
  210. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  211. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
  212. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
  213. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
  214. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  215. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  216. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  217. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
  218. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  219. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  220. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  221. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  222. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  223. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  224. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  225. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  226. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +11 -11
  227. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  228. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  229. package/esm/vs/editor/contrib/rename/browser/rename.js +19 -11
  230. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  231. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  232. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +3 -2
  233. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
  234. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  235. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  236. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js +33 -0
  237. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
  238. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  239. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  240. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -4
  241. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  242. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
  243. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
  244. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
  245. package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
  246. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
  247. package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
  248. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
  249. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
  250. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
  251. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
  252. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
  253. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  254. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  255. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  256. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  257. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  258. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  259. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  260. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  261. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  262. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  263. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  264. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
  265. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
  266. package/esm/vs/editor/editor.api.d.ts +37 -2
  267. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
  268. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  269. package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
  270. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  271. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
  272. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js.map +1 -1
  273. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  274. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  275. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  276. package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -8
  277. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  278. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  279. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  280. package/esm/vs/platform/actions/common/actions.js +11 -4
  281. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  282. package/esm/vs/platform/actions/common/menuService.js +2 -2
  283. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  284. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  285. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  286. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  287. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  288. package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
  289. package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
  290. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  291. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  292. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  293. package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
  294. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
  295. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  296. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  297. package/esm/vs/platform/list/browser/listService.js +27 -27
  298. package/esm/vs/platform/log/common/log.js +1 -1
  299. package/esm/vs/platform/log/common/log.js.map +1 -1
  300. package/esm/vs/platform/markers/common/markerService.js +6 -6
  301. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  302. package/esm/vs/platform/markers/common/markers.js +6 -6
  303. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  304. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  305. package/esm/vs/platform/quickinput/browser/media/quickInput.css +7 -3
  306. package/esm/vs/platform/quickinput/browser/quickInput.js +19 -11
  307. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  308. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  309. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  310. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  311. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  312. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  313. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  314. package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
  315. package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
  316. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  317. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  318. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  319. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  320. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  321. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  322. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  323. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  324. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  325. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  326. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  327. package/esm/vs/platform/undoRedo/common/undoRedoService.js +21 -21
  328. package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
  329. package/esm/vs/platform/window/common/window.js +1 -1
  330. package/esm/vs/platform/window/common/window.js.map +1 -1
  331. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  332. package/monaco.d.ts +37 -2
  333. package/package.json +2 -2
  334. package/version.txt +1 -1
  335. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
  336. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
  337. package/esm/vs/platform/product/common/productService.js.map +0 -1
@@ -0,0 +1,198 @@
1
+ const syntacticalChars = new Set([';', ',', '=', '+', '-', '*', '/', '{', '}', '(', ')', '[', ']', '<', '>', ':', '.', '!', '?', '&', '|', '^', '%', '@', '#', '~', '`', '\\', '\'', '"', '$']);
2
+ function isSyntacticalChar(char) {
3
+ return syntacticalChars.has(char);
4
+ }
5
+ function isIdentifierChar(char) {
6
+ return /[a-zA-Z0-9_]/.test(char);
7
+ }
8
+ function isWhitespaceChar(char) {
9
+ return char === ' ' || char === '\t';
10
+ }
11
+ function analyzeTextShape(text) {
12
+ const lines = text.split(/\r\n|\r|\n/);
13
+ if (lines.length > 1) {
14
+ return {
15
+ kind: 'multiLine',
16
+ lineCount: lines.length,
17
+ };
18
+ }
19
+ const isSingleChar = text.length === 1;
20
+ let singleCharKind;
21
+ if (isSingleChar) {
22
+ if (isSyntacticalChar(text)) {
23
+ singleCharKind = 'syntactical';
24
+ }
25
+ else if (isIdentifierChar(text)) {
26
+ singleCharKind = 'identifier';
27
+ }
28
+ else if (isWhitespaceChar(text)) {
29
+ singleCharKind = 'whitespace';
30
+ }
31
+ }
32
+ // Analyze whitespace patterns
33
+ const whitespaceMatches = text.match(/[ \t]+/g) || [];
34
+ const isMultipleWhitespace = whitespaceMatches.some(ws => ws.length > 1);
35
+ const hasDuplicatedWhitespace = whitespaceMatches.some(ws => (ws.includes(' ') || ws.includes('\t\t')));
36
+ // Analyze word patterns
37
+ const words = text.split(/\s+/).filter(w => w.length > 0);
38
+ const isWord = words.length === 1 && /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(words[0]);
39
+ const isMultipleWords = words.length > 1;
40
+ return {
41
+ kind: 'singleLine',
42
+ isSingleCharacter: isSingleChar,
43
+ singleCharacterKind: singleCharKind,
44
+ isWord,
45
+ isMultipleWords,
46
+ isMultipleWhitespace,
47
+ hasDuplicatedWhitespace,
48
+ };
49
+ }
50
+ export class InlineSuggestionEditKind {
51
+ constructor(edits) {
52
+ this.edits = edits;
53
+ }
54
+ toString() {
55
+ return JSON.stringify({ edits: this.edits });
56
+ }
57
+ }
58
+ export function computeEditKind(edit, textModel, cursorPosition) {
59
+ if (edit.replacements.length === 0) {
60
+ // Empty edit - return undefined as there's no edit to classify
61
+ return undefined;
62
+ }
63
+ return new InlineSuggestionEditKind(edit.replacements.map(rep => computeSingleEditKind(rep, textModel, cursorPosition)));
64
+ }
65
+ function countLines(text) {
66
+ if (text.length === 0) {
67
+ return 0;
68
+ }
69
+ return text.split(/\r\n|\r|\n/).length - 1;
70
+ }
71
+ function computeSingleEditKind(replacement, textModel, cursorPosition) {
72
+ const replaceRange = replacement.replaceRange;
73
+ const newText = replacement.newText;
74
+ const deletedLength = replaceRange.length;
75
+ const insertedLength = newText.length;
76
+ const linesInserted = countLines(newText);
77
+ const kind = replaceRange.isEmpty ? 'insert' : (newText.length === 0 ? 'delete' : 'replace');
78
+ switch (kind) {
79
+ case 'insert':
80
+ return {
81
+ operation: 'insert',
82
+ properties: computeInsertProperties(replaceRange.start, newText, textModel, cursorPosition),
83
+ charactersInserted: insertedLength,
84
+ charactersDeleted: 0,
85
+ linesInserted,
86
+ linesDeleted: 0,
87
+ };
88
+ case 'delete': {
89
+ const deletedText = textModel.getValue().substring(replaceRange.start, replaceRange.endExclusive);
90
+ return {
91
+ operation: 'delete',
92
+ properties: computeDeleteProperties(replaceRange.start, replaceRange.endExclusive, textModel),
93
+ charactersInserted: 0,
94
+ charactersDeleted: deletedLength,
95
+ linesInserted: 0,
96
+ linesDeleted: countLines(deletedText),
97
+ };
98
+ }
99
+ case 'replace': {
100
+ const oldText = textModel.getValue().substring(replaceRange.start, replaceRange.endExclusive);
101
+ return {
102
+ operation: 'replace',
103
+ properties: computeReplaceProperties(oldText, newText),
104
+ charactersInserted: insertedLength,
105
+ charactersDeleted: deletedLength,
106
+ linesInserted,
107
+ linesDeleted: countLines(oldText),
108
+ };
109
+ }
110
+ }
111
+ }
112
+ function computeInsertProperties(offset, newText, textModel, cursorPosition) {
113
+ const textShape = analyzeTextShape(newText);
114
+ const insertPosition = textModel.getPositionAt(offset);
115
+ const lineContent = textModel.getLineContent(insertPosition.lineNumber);
116
+ const lineLength = lineContent.length;
117
+ // Determine location shape
118
+ let locationShape;
119
+ const isLineEmpty = lineContent.trim().length === 0;
120
+ const isAtEndOfLine = insertPosition.column > lineLength;
121
+ const isAtStartOfLine = insertPosition.column === 1;
122
+ if (isLineEmpty) {
123
+ locationShape = 'emptyLine';
124
+ }
125
+ else if (isAtEndOfLine) {
126
+ locationShape = 'endOfLine';
127
+ }
128
+ else if (isAtStartOfLine) {
129
+ locationShape = 'startOfLine';
130
+ }
131
+ else {
132
+ locationShape = 'middleOfLine';
133
+ }
134
+ // Compute relative to cursor if cursor position is provided
135
+ let relativeToCursor;
136
+ if (cursorPosition) {
137
+ const cursorLine = cursorPosition.lineNumber;
138
+ const insertLine = insertPosition.lineNumber;
139
+ const cursorColumn = cursorPosition.column;
140
+ const insertColumn = insertPosition.column;
141
+ const atCursor = cursorLine === insertLine && cursorColumn === insertColumn;
142
+ const beforeCursorOnSameLine = cursorLine === insertLine && insertColumn < cursorColumn;
143
+ const afterCursorOnSameLine = cursorLine === insertLine && insertColumn > cursorColumn;
144
+ const linesAbove = insertLine < cursorLine ? cursorLine - insertLine : undefined;
145
+ const linesBelow = insertLine > cursorLine ? insertLine - cursorLine : undefined;
146
+ relativeToCursor = {
147
+ atCursor,
148
+ beforeCursorOnSameLine,
149
+ afterCursorOnSameLine,
150
+ linesAbove,
151
+ linesBelow,
152
+ };
153
+ }
154
+ return {
155
+ textShape,
156
+ locationShape,
157
+ relativeToCursor,
158
+ };
159
+ }
160
+ function computeDeleteProperties(startOffset, endOffset, textModel) {
161
+ const deletedText = textModel.getValue().substring(startOffset, endOffset);
162
+ const textShape = analyzeTextShape(deletedText);
163
+ const startPosition = textModel.getPositionAt(startOffset);
164
+ const endPosition = textModel.getPositionAt(endOffset);
165
+ // Check if delete is at end of line
166
+ const lineContent = textModel.getLineContent(endPosition.lineNumber);
167
+ const isAtEndOfLine = endPosition.column > lineContent.length;
168
+ // Check if entire line content is deleted
169
+ const deletesEntireLineContent = startPosition.lineNumber === endPosition.lineNumber &&
170
+ startPosition.column === 1 &&
171
+ endPosition.column > lineContent.length;
172
+ return {
173
+ textShape,
174
+ isAtEndOfLine,
175
+ deletesEntireLineContent,
176
+ };
177
+ }
178
+ function computeReplaceProperties(oldText, newText) {
179
+ const oldShape = analyzeTextShape(oldText);
180
+ const newShape = analyzeTextShape(newText);
181
+ const oldIsWord = oldShape.kind === 'singleLine' && oldShape.isWord;
182
+ const newIsWord = newShape.kind === 'singleLine' && newShape.isWord;
183
+ const isWordToWordReplacement = oldIsWord && newIsWord;
184
+ const isAdditive = newText.length > oldText.length;
185
+ const isSubtractive = newText.length < oldText.length;
186
+ const isSingleLineToSingleLine = oldShape.kind === 'singleLine' && newShape.kind === 'singleLine';
187
+ const isSingleLineToMultiLine = oldShape.kind === 'singleLine' && newShape.kind === 'multiLine';
188
+ const isMultiLineToSingleLine = oldShape.kind === 'multiLine' && newShape.kind === 'singleLine';
189
+ return {
190
+ isWordToWordReplacement,
191
+ isAdditive,
192
+ isSubtractive,
193
+ isSingleLineToSingleLine,
194
+ isSingleLineToMultiLine,
195
+ isMultiLineToSingleLine,
196
+ };
197
+ }
198
+ //# sourceMappingURL=editKind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/model/editKind.ts","vs/editor/contrib/inlineCompletions/browser/model/editKind.ts"],"names":[],"mappings":"AAQA,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEhM,SAAS,iBAAiB,CAAC,IAAY;IACtC,OAAO,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY;IACrC,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY;IACrC,OAAO,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC;AACtC,CAAC;AAqBD,SAAS,gBAAgB,CAAC,IAAY;IACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK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---------------------------------------------------------------------------------------------\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 *--------------------------------------------------------------------------------------------*/\nimport { Position } from '../../../../common/core/position.js';\nimport { StringEdit, StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { ITextModel } from '../../../../common/model.js';\n\nconst syntacticalChars = new Set([';', ',', '=', '+', '-', '*', '/', '{', '}', '(', ')', '[', ']', '<', '>', ':', '.', '!', '?', '&', '|', '^', '%', '@', '#', '~', '`', '\\\\', '\\'', '\"', '$']);\n\nfunction isSyntacticalChar(char: string): boolean {\n\treturn syntacticalChars.has(char);\n}\n\nfunction isIdentifierChar(char: string): boolean {\n\treturn /[a-zA-Z0-9_]/.test(char);\n}\n\nfunction isWhitespaceChar(char: string): boolean {\n\treturn char === ' ' || char === '\\t';\n}\n\ntype SingleCharacterKind = 'syntactical' | 'identifier' | 'whitespace';\n\ninterface SingleLineTextShape {\n\treadonly kind: 'singleLine';\n\treadonly isSingleCharacter: boolean;\n\treadonly singleCharacterKind: SingleCharacterKind | undefined;\n\treadonly isWord: boolean;\n\treadonly isMultipleWords: boolean;\n\treadonly isMultipleWhitespace: boolean;\n\treadonly hasDuplicatedWhitespace: boolean;\n}\n\ninterface MultiLineTextShape {\n\treadonly kind: 'multiLine';\n\treadonly lineCount: number;\n}\n\ntype TextShape = SingleLineTextShape | MultiLineTextShape;\n\nfunction analyzeTextShape(text: string): TextShape {\n\tconst lines = text.split(/\\r\\n|\\r|\\n/);\n\tif (lines.length > 1) {\n\t\treturn {\n\t\t\tkind: 'multiLine',\n\t\t\tlineCount: lines.length,\n\t\t};\n\t}\n\n\tconst isSingleChar = text.length === 1;\n\tlet singleCharKind: SingleCharacterKind | undefined;\n\tif (isSingleChar) {\n\t\tif (isSyntacticalChar(text)) {\n\t\t\tsingleCharKind = 'syntactical';\n\t\t} else if (isIdentifierChar(text)) {\n\t\t\tsingleCharKind = 'identifier';\n\t\t} else if (isWhitespaceChar(text)) {\n\t\t\tsingleCharKind = 'whitespace';\n\t\t}\n\t}\n\n\t// Analyze whitespace patterns\n\tconst whitespaceMatches = text.match(/[ \\t]+/g) || [];\n\tconst isMultipleWhitespace = whitespaceMatches.some(ws => ws.length > 1);\n\tconst hasDuplicatedWhitespace = whitespaceMatches.some(ws =>\n\t\t(ws.includes(' ') || ws.includes('\\t\\t'))\n\t);\n\n\t// Analyze word patterns\n\tconst words = text.split(/\\s+/).filter(w => w.length > 0);\n\tconst isWord = words.length === 1 && /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(words[0]);\n\tconst isMultipleWords = words.length > 1;\n\n\treturn {\n\t\tkind: 'singleLine',\n\t\tisSingleCharacter: isSingleChar,\n\t\tsingleCharacterKind: singleCharKind,\n\t\tisWord,\n\t\tisMultipleWords,\n\t\tisMultipleWhitespace,\n\t\thasDuplicatedWhitespace,\n\t};\n}\n\ntype InsertLocationShape = 'endOfLine' | 'emptyLine' | 'startOfLine' | 'middleOfLine';\n\ninterface InsertLocationRelativeToCursor {\n\treadonly atCursor: boolean;\n\treadonly beforeCursorOnSameLine: boolean;\n\treadonly afterCursorOnSameLine: boolean;\n\treadonly linesAbove: number | undefined;\n\treadonly linesBelow: number | undefined;\n}\n\nexport interface InsertProperties {\n\treadonly textShape: TextShape;\n\treadonly locationShape: InsertLocationShape;\n\treadonly relativeToCursor: InsertLocationRelativeToCursor | undefined;\n}\n\nexport interface DeleteProperties {\n\treadonly textShape: TextShape;\n\treadonly isAtEndOfLine: boolean;\n\treadonly deletesEntireLineContent: boolean;\n}\n\nexport interface ReplaceProperties {\n\treadonly isWordToWordReplacement: boolean;\n\treadonly isAdditive: boolean;\n\treadonly isSubtractive: boolean;\n\treadonly isSingleLineToSingleLine: boolean;\n\treadonly isSingleLineToMultiLine: boolean;\n\treadonly isMultiLineToSingleLine: boolean;\n}\n\ntype EditOperation = 'insert' | 'delete' | 'replace';\n\ninterface IInlineSuggestionEditKindEdit {\n\treadonly operation: EditOperation;\n\treadonly properties: InsertProperties | DeleteProperties | ReplaceProperties;\n\treadonly charactersInserted: number;\n\treadonly charactersDeleted: number;\n\treadonly linesInserted: number;\n\treadonly linesDeleted: number;\n}\nexport class InlineSuggestionEditKind {\n\tconstructor(readonly edits: IInlineSuggestionEditKindEdit[]) { }\n\ttoString(): string {\n\t\treturn JSON.stringify({ edits: this.edits });\n\t}\n}\n\nexport function computeEditKind(edit: StringEdit, textModel: ITextModel, cursorPosition?: Position): InlineSuggestionEditKind | undefined {\n\tif (edit.replacements.length === 0) {\n\t\t// Empty edit - return undefined as there's no edit to classify\n\t\treturn undefined;\n\t}\n\n\treturn new InlineSuggestionEditKind(edit.replacements.map(rep => computeSingleEditKind(rep, textModel, cursorPosition)));\n}\n\nfunction countLines(text: string): number {\n\tif (text.length === 0) {\n\t\treturn 0;\n\t}\n\treturn text.split(/\\r\\n|\\r|\\n/).length - 1;\n}\n\nfunction computeSingleEditKind(replacement: StringReplacement, textModel: ITextModel, cursorPosition?: Position): IInlineSuggestionEditKindEdit {\n\tconst replaceRange = replacement.replaceRange;\n\tconst newText = replacement.newText;\n\tconst deletedLength = replaceRange.length;\n\tconst insertedLength = newText.length;\n\tconst linesInserted = countLines(newText);\n\n\tconst kind = replaceRange.isEmpty ? 'insert' : (newText.length === 0 ? 'delete' : 'replace');\n\tswitch (kind) {\n\t\tcase 'insert':\n\t\t\treturn {\n\t\t\t\toperation: 'insert',\n\t\t\t\tproperties: computeInsertProperties(replaceRange.start, newText, textModel, cursorPosition),\n\t\t\t\tcharactersInserted: insertedLength,\n\t\t\t\tcharactersDeleted: 0,\n\t\t\t\tlinesInserted,\n\t\t\t\tlinesDeleted: 0,\n\t\t\t};\n\t\tcase 'delete': {\n\t\t\tconst deletedText = textModel.getValue().substring(replaceRange.start, replaceRange.endExclusive);\n\t\t\treturn {\n\t\t\t\toperation: 'delete',\n\t\t\t\tproperties: computeDeleteProperties(replaceRange.start, replaceRange.endExclusive, textModel),\n\t\t\t\tcharactersInserted: 0,\n\t\t\t\tcharactersDeleted: deletedLength,\n\t\t\t\tlinesInserted: 0,\n\t\t\t\tlinesDeleted: countLines(deletedText),\n\t\t\t};\n\t\t}\n\t\tcase 'replace': {\n\t\t\tconst oldText = textModel.getValue().substring(replaceRange.start, replaceRange.endExclusive);\n\t\t\treturn {\n\t\t\t\toperation: 'replace',\n\t\t\t\tproperties: computeReplaceProperties(oldText, newText),\n\t\t\t\tcharactersInserted: insertedLength,\n\t\t\t\tcharactersDeleted: deletedLength,\n\t\t\t\tlinesInserted,\n\t\t\t\tlinesDeleted: countLines(oldText),\n\t\t\t};\n\t\t}\n\t}\n}\n\nfunction computeInsertProperties(offset: number, newText: string, textModel: ITextModel, cursorPosition?: Position): InsertProperties {\n\tconst textShape = analyzeTextShape(newText);\n\tconst insertPosition = textModel.getPositionAt(offset);\n\tconst lineContent = textModel.getLineContent(insertPosition.lineNumber);\n\tconst lineLength = lineContent.length;\n\n\t// Determine location shape\n\tlet locationShape: InsertLocationShape;\n\tconst isLineEmpty = lineContent.trim().length === 0;\n\tconst isAtEndOfLine = insertPosition.column > lineLength;\n\tconst isAtStartOfLine = insertPosition.column === 1;\n\n\tif (isLineEmpty) {\n\t\tlocationShape = 'emptyLine';\n\t} else if (isAtEndOfLine) {\n\t\tlocationShape = 'endOfLine';\n\t} else if (isAtStartOfLine) {\n\t\tlocationShape = 'startOfLine';\n\t} else {\n\t\tlocationShape = 'middleOfLine';\n\t}\n\n\t// Compute relative to cursor if cursor position is provided\n\tlet relativeToCursor: InsertLocationRelativeToCursor | undefined;\n\tif (cursorPosition) {\n\t\tconst cursorLine = cursorPosition.lineNumber;\n\t\tconst insertLine = insertPosition.lineNumber;\n\t\tconst cursorColumn = cursorPosition.column;\n\t\tconst insertColumn = insertPosition.column;\n\n\t\tconst atCursor = cursorLine === insertLine && cursorColumn === insertColumn;\n\t\tconst beforeCursorOnSameLine = cursorLine === insertLine && insertColumn < cursorColumn;\n\t\tconst afterCursorOnSameLine = cursorLine === insertLine && insertColumn > cursorColumn;\n\t\tconst linesAbove = insertLine < cursorLine ? cursorLine - insertLine : undefined;\n\t\tconst linesBelow = insertLine > cursorLine ? insertLine - cursorLine : undefined;\n\n\t\trelativeToCursor = {\n\t\t\tatCursor,\n\t\t\tbeforeCursorOnSameLine,\n\t\t\tafterCursorOnSameLine,\n\t\t\tlinesAbove,\n\t\t\tlinesBelow,\n\t\t};\n\t}\n\n\treturn {\n\t\ttextShape,\n\t\tlocationShape,\n\t\trelativeToCursor,\n\t};\n}\n\nfunction computeDeleteProperties(startOffset: number, endOffset: number, textModel: ITextModel): DeleteProperties {\n\tconst deletedText = textModel.getValue().substring(startOffset, endOffset);\n\tconst textShape = analyzeTextShape(deletedText);\n\n\tconst startPosition = textModel.getPositionAt(startOffset);\n\tconst endPosition = textModel.getPositionAt(endOffset);\n\n\t// Check if delete is at end of line\n\tconst lineContent = textModel.getLineContent(endPosition.lineNumber);\n\tconst isAtEndOfLine = endPosition.column > lineContent.length;\n\n\t// Check if entire line content is deleted\n\tconst deletesEntireLineContent =\n\t\tstartPosition.lineNumber === endPosition.lineNumber &&\n\t\tstartPosition.column === 1 &&\n\t\tendPosition.column > lineContent.length;\n\n\treturn {\n\t\ttextShape,\n\t\tisAtEndOfLine,\n\t\tdeletesEntireLineContent,\n\t};\n}\n\nfunction computeReplaceProperties(oldText: string, newText: string): ReplaceProperties {\n\tconst oldShape = analyzeTextShape(oldText);\n\tconst newShape = analyzeTextShape(newText);\n\n\tconst oldIsWord = oldShape.kind === 'singleLine' && oldShape.isWord;\n\tconst newIsWord = newShape.kind === 'singleLine' && newShape.isWord;\n\tconst isWordToWordReplacement = oldIsWord && newIsWord;\n\n\tconst isAdditive = newText.length > oldText.length;\n\tconst isSubtractive = newText.length < oldText.length;\n\n\tconst isSingleLineToSingleLine = oldShape.kind === 'singleLine' && newShape.kind === 'singleLine';\n\tconst isSingleLineToMultiLine = oldShape.kind === 'singleLine' && newShape.kind === 'multiLine';\n\tconst isMultiLineToSingleLine = oldShape.kind === 'multiLine' && newShape.kind === 'singleLine';\n\n\treturn {\n\t\tisWordToWordReplacement,\n\t\tisAdditive,\n\t\tisSubtractive,\n\t\tisSingleLineToSingleLine,\n\t\tisSingleLineToMultiLine,\n\t\tisMultiLineToSingleLine,\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 *--------------------------------------------------------------------------------------------*/\nimport { Position } from '../../../../common/core/position.js';\nimport { StringEdit, StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { ITextModel } from '../../../../common/model.js';\n\nconst syntacticalChars = new Set([';', ',', '=', '+', '-', '*', '/', '{', '}', '(', ')', '[', ']', '<', '>', ':', '.', '!', '?', '&', '|', '^', '%', '@', '#', '~', '`', '\\\\', '\\'', '\"', '$']);\n\nfunction isSyntacticalChar(char: string): boolean {\n\treturn syntacticalChars.has(char);\n}\n\nfunction isIdentifierChar(char: string): boolean {\n\treturn /[a-zA-Z0-9_]/.test(char);\n}\n\nfunction isWhitespaceChar(char: string): boolean {\n\treturn char === ' ' || char === '\\t';\n}\n\ntype SingleCharacterKind = 'syntactical' | 'identifier' | 'whitespace';\n\ninterface SingleLineTextShape {\n\treadonly kind: 'singleLine';\n\treadonly isSingleCharacter: boolean;\n\treadonly singleCharacterKind: SingleCharacterKind | undefined;\n\treadonly isWord: boolean;\n\treadonly isMultipleWords: boolean;\n\treadonly isMultipleWhitespace: boolean;\n\treadonly hasDuplicatedWhitespace: boolean;\n}\n\ninterface MultiLineTextShape {\n\treadonly kind: 'multiLine';\n\treadonly lineCount: number;\n}\n\ntype TextShape = SingleLineTextShape | MultiLineTextShape;\n\nfunction analyzeTextShape(text: string): TextShape {\n\tconst lines = text.split(/\\r\\n|\\r|\\n/);\n\tif (lines.length > 1) {\n\t\treturn {\n\t\t\tkind: 'multiLine',\n\t\t\tlineCount: lines.length,\n\t\t};\n\t}\n\n\tconst isSingleChar = text.length === 1;\n\tlet singleCharKind: SingleCharacterKind | undefined;\n\tif (isSingleChar) {\n\t\tif (isSyntacticalChar(text)) {\n\t\t\tsingleCharKind = 'syntactical';\n\t\t} else if (isIdentifierChar(text)) {\n\t\t\tsingleCharKind = 'identifier';\n\t\t} else if (isWhitespaceChar(text)) {\n\t\t\tsingleCharKind = 'whitespace';\n\t\t}\n\t}\n\n\t// Analyze whitespace patterns\n\tconst whitespaceMatches = text.match(/[ \\t]+/g) || [];\n\tconst isMultipleWhitespace = whitespaceMatches.some(ws => ws.length > 1);\n\tconst hasDuplicatedWhitespace = whitespaceMatches.some(ws =>\n\t\t(ws.includes(' ') || ws.includes('\\t\\t'))\n\t);\n\n\t// Analyze word patterns\n\tconst words = text.split(/\\s+/).filter(w => w.length > 0);\n\tconst isWord = words.length === 1 && /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(words[0]);\n\tconst isMultipleWords = words.length > 1;\n\n\treturn {\n\t\tkind: 'singleLine',\n\t\tisSingleCharacter: isSingleChar,\n\t\tsingleCharacterKind: singleCharKind,\n\t\tisWord,\n\t\tisMultipleWords,\n\t\tisMultipleWhitespace,\n\t\thasDuplicatedWhitespace,\n\t};\n}\n\ntype InsertLocationShape = 'endOfLine' | 'emptyLine' | 'startOfLine' | 'middleOfLine';\n\ninterface InsertLocationRelativeToCursor {\n\treadonly atCursor: boolean;\n\treadonly beforeCursorOnSameLine: boolean;\n\treadonly afterCursorOnSameLine: boolean;\n\treadonly linesAbove: number | undefined;\n\treadonly linesBelow: number | undefined;\n}\n\nexport interface InsertProperties {\n\treadonly textShape: TextShape;\n\treadonly locationShape: InsertLocationShape;\n\treadonly relativeToCursor: InsertLocationRelativeToCursor | undefined;\n}\n\nexport interface DeleteProperties {\n\treadonly textShape: TextShape;\n\treadonly isAtEndOfLine: boolean;\n\treadonly deletesEntireLineContent: boolean;\n}\n\nexport interface ReplaceProperties {\n\treadonly isWordToWordReplacement: boolean;\n\treadonly isAdditive: boolean;\n\treadonly isSubtractive: boolean;\n\treadonly isSingleLineToSingleLine: boolean;\n\treadonly isSingleLineToMultiLine: boolean;\n\treadonly isMultiLineToSingleLine: boolean;\n}\n\ntype EditOperation = 'insert' | 'delete' | 'replace';\n\ninterface IInlineSuggestionEditKindEdit {\n\treadonly operation: EditOperation;\n\treadonly properties: InsertProperties | DeleteProperties | ReplaceProperties;\n\treadonly charactersInserted: number;\n\treadonly charactersDeleted: number;\n\treadonly linesInserted: number;\n\treadonly linesDeleted: number;\n}\nexport class InlineSuggestionEditKind {\n\tconstructor(readonly edits: IInlineSuggestionEditKindEdit[]) { }\n\ttoString(): string {\n\t\treturn JSON.stringify({ edits: this.edits });\n\t}\n}\n\nexport function computeEditKind(edit: StringEdit, textModel: ITextModel, cursorPosition?: Position): InlineSuggestionEditKind | undefined {\n\tif (edit.replacements.length === 0) {\n\t\t// Empty edit - return undefined as there's no edit to classify\n\t\treturn undefined;\n\t}\n\n\treturn new InlineSuggestionEditKind(edit.replacements.map(rep => computeSingleEditKind(rep, textModel, cursorPosition)));\n}\n\nfunction countLines(text: string): number {\n\tif (text.length === 0) {\n\t\treturn 0;\n\t}\n\treturn text.split(/\\r\\n|\\r|\\n/).length - 1;\n}\n\nfunction computeSingleEditKind(replacement: StringReplacement, textModel: ITextModel, cursorPosition?: Position): IInlineSuggestionEditKindEdit {\n\tconst replaceRange = replacement.replaceRange;\n\tconst newText = replacement.newText;\n\tconst deletedLength = replaceRange.length;\n\tconst insertedLength = newText.length;\n\tconst linesInserted = countLines(newText);\n\n\tconst kind = replaceRange.isEmpty ? 'insert' : (newText.length === 0 ? 'delete' : 'replace');\n\tswitch (kind) {\n\t\tcase 'insert':\n\t\t\treturn {\n\t\t\t\toperation: 'insert',\n\t\t\t\tproperties: computeInsertProperties(replaceRange.start, newText, textModel, cursorPosition),\n\t\t\t\tcharactersInserted: insertedLength,\n\t\t\t\tcharactersDeleted: 0,\n\t\t\t\tlinesInserted,\n\t\t\t\tlinesDeleted: 0,\n\t\t\t};\n\t\tcase 'delete': {\n\t\t\tconst deletedText = textModel.getValue().substring(replaceRange.start, replaceRange.endExclusive);\n\t\t\treturn {\n\t\t\t\toperation: 'delete',\n\t\t\t\tproperties: computeDeleteProperties(replaceRange.start, replaceRange.endExclusive, textModel),\n\t\t\t\tcharactersInserted: 0,\n\t\t\t\tcharactersDeleted: deletedLength,\n\t\t\t\tlinesInserted: 0,\n\t\t\t\tlinesDeleted: countLines(deletedText),\n\t\t\t};\n\t\t}\n\t\tcase 'replace': {\n\t\t\tconst oldText = textModel.getValue().substring(replaceRange.start, replaceRange.endExclusive);\n\t\t\treturn {\n\t\t\t\toperation: 'replace',\n\t\t\t\tproperties: computeReplaceProperties(oldText, newText),\n\t\t\t\tcharactersInserted: insertedLength,\n\t\t\t\tcharactersDeleted: deletedLength,\n\t\t\t\tlinesInserted,\n\t\t\t\tlinesDeleted: countLines(oldText),\n\t\t\t};\n\t\t}\n\t}\n}\n\nfunction computeInsertProperties(offset: number, newText: string, textModel: ITextModel, cursorPosition?: Position): InsertProperties {\n\tconst textShape = analyzeTextShape(newText);\n\tconst insertPosition = textModel.getPositionAt(offset);\n\tconst lineContent = textModel.getLineContent(insertPosition.lineNumber);\n\tconst lineLength = lineContent.length;\n\n\t// Determine location shape\n\tlet locationShape: InsertLocationShape;\n\tconst isLineEmpty = lineContent.trim().length === 0;\n\tconst isAtEndOfLine = insertPosition.column > lineLength;\n\tconst isAtStartOfLine = insertPosition.column === 1;\n\n\tif (isLineEmpty) {\n\t\tlocationShape = 'emptyLine';\n\t} else if (isAtEndOfLine) {\n\t\tlocationShape = 'endOfLine';\n\t} else if (isAtStartOfLine) {\n\t\tlocationShape = 'startOfLine';\n\t} else {\n\t\tlocationShape = 'middleOfLine';\n\t}\n\n\t// Compute relative to cursor if cursor position is provided\n\tlet relativeToCursor: InsertLocationRelativeToCursor | undefined;\n\tif (cursorPosition) {\n\t\tconst cursorLine = cursorPosition.lineNumber;\n\t\tconst insertLine = insertPosition.lineNumber;\n\t\tconst cursorColumn = cursorPosition.column;\n\t\tconst insertColumn = insertPosition.column;\n\n\t\tconst atCursor = cursorLine === insertLine && cursorColumn === insertColumn;\n\t\tconst beforeCursorOnSameLine = cursorLine === insertLine && insertColumn < cursorColumn;\n\t\tconst afterCursorOnSameLine = cursorLine === insertLine && insertColumn > cursorColumn;\n\t\tconst linesAbove = insertLine < cursorLine ? cursorLine - insertLine : undefined;\n\t\tconst linesBelow = insertLine > cursorLine ? insertLine - cursorLine : undefined;\n\n\t\trelativeToCursor = {\n\t\t\tatCursor,\n\t\t\tbeforeCursorOnSameLine,\n\t\t\tafterCursorOnSameLine,\n\t\t\tlinesAbove,\n\t\t\tlinesBelow,\n\t\t};\n\t}\n\n\treturn {\n\t\ttextShape,\n\t\tlocationShape,\n\t\trelativeToCursor,\n\t};\n}\n\nfunction computeDeleteProperties(startOffset: number, endOffset: number, textModel: ITextModel): DeleteProperties {\n\tconst deletedText = textModel.getValue().substring(startOffset, endOffset);\n\tconst textShape = analyzeTextShape(deletedText);\n\n\tconst startPosition = textModel.getPositionAt(startOffset);\n\tconst endPosition = textModel.getPositionAt(endOffset);\n\n\t// Check if delete is at end of line\n\tconst lineContent = textModel.getLineContent(endPosition.lineNumber);\n\tconst isAtEndOfLine = endPosition.column > lineContent.length;\n\n\t// Check if entire line content is deleted\n\tconst deletesEntireLineContent =\n\t\tstartPosition.lineNumber === endPosition.lineNumber &&\n\t\tstartPosition.column === 1 &&\n\t\tendPosition.column > lineContent.length;\n\n\treturn {\n\t\ttextShape,\n\t\tisAtEndOfLine,\n\t\tdeletesEntireLineContent,\n\t};\n}\n\nfunction computeReplaceProperties(oldText: string, newText: string): ReplaceProperties {\n\tconst oldShape = analyzeTextShape(oldText);\n\tconst newShape = analyzeTextShape(newText);\n\n\tconst oldIsWord = oldShape.kind === 'singleLine' && oldShape.isWord;\n\tconst newIsWord = newShape.kind === 'singleLine' && newShape.isWord;\n\tconst isWordToWordReplacement = oldIsWord && newIsWord;\n\n\tconst isAdditive = newText.length > oldText.length;\n\tconst isSubtractive = newText.length < oldText.length;\n\n\tconst isSingleLineToSingleLine = oldShape.kind === 'singleLine' && newShape.kind === 'singleLine';\n\tconst isSingleLineToMultiLine = oldShape.kind === 'singleLine' && newShape.kind === 'multiLine';\n\tconst isMultiLineToSingleLine = oldShape.kind === 'multiLine' && newShape.kind === 'singleLine';\n\n\treturn {\n\t\tisWordToWordReplacement,\n\t\tisAdditive,\n\t\tisSubtractive,\n\t\tisSingleLineToSingleLine,\n\t\tisSingleLineToMultiLine,\n\t\tisMultiLineToSingleLine,\n\t};\n}\n"]}
@@ -0,0 +1,40 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { matchesSubString } from '../../../../../base/common/filters.js';
6
+ import { singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js';
7
+ export function inlineCompletionIsVisible(singleTextEdit, originalRange, model, cursorPosition) {
8
+ const minimizedReplacement = singleTextRemoveCommonPrefix(singleTextEdit, model);
9
+ const editRange = singleTextEdit.range;
10
+ if (!editRange
11
+ || (originalRange && !originalRange.getStartPosition().equals(editRange.getStartPosition()))
12
+ || cursorPosition.lineNumber !== minimizedReplacement.range.startLineNumber
13
+ || minimizedReplacement.isEmpty // if the completion is empty after removing the common prefix of the completion and the model, the completion item would not be visible
14
+ ) {
15
+ return false;
16
+ }
17
+ // We might consider comparing by .toLowerText, but this requires GhostTextReplacement
18
+ const originalValue = model.getValueInRange(minimizedReplacement.range, 1 /* EndOfLinePreference.LF */);
19
+ const filterText = minimizedReplacement.text;
20
+ const cursorPosIndex = Math.max(0, cursorPosition.column - minimizedReplacement.range.startColumn);
21
+ let filterTextBefore = filterText.substring(0, cursorPosIndex);
22
+ let filterTextAfter = filterText.substring(cursorPosIndex);
23
+ let originalValueBefore = originalValue.substring(0, cursorPosIndex);
24
+ let originalValueAfter = originalValue.substring(cursorPosIndex);
25
+ const originalValueIndent = model.getLineIndentColumn(minimizedReplacement.range.startLineNumber);
26
+ if (minimizedReplacement.range.startColumn <= originalValueIndent) {
27
+ // Remove indentation
28
+ originalValueBefore = originalValueBefore.trimStart();
29
+ if (originalValueBefore.length === 0) {
30
+ originalValueAfter = originalValueAfter.trimStart();
31
+ }
32
+ filterTextBefore = filterTextBefore.trimStart();
33
+ if (filterTextBefore.length === 0) {
34
+ filterTextAfter = filterTextAfter.trimStart();
35
+ }
36
+ }
37
+ return filterTextBefore.startsWith(originalValueBefore)
38
+ && !!matchesSubString(originalValueAfter, filterTextAfter);
39
+ }
40
+ //# sourceMappingURL=inlineCompletionIsVisible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.ts","vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAKzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,UAAU,yBAAyB,CAAC,cAA+B,EAAE,aAAgC,EAAE,KAAiB,EAAE,cAAwB;IACvJ,MAAM,oBAAoB,GAAG,4BAA4B,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACjF,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC;IACvC,IAAI,CAAC,SAAS;WACV,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC;WACzF,cAAc,CAAC,UAAU,KAAK,oBAAoB,CAAC,KAAK,CAAC,eAAe;WACxE,oBAAoB,CAAC,OAAO,CAAC,wIAAwI;MACvK,CAAC;QACF,OAAO,KAAK,CAAC;IAC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C,CAAC;AAC7D,CAAC","file":"inlineCompletionIsVisible.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 *--------------------------------------------------------------------------------------------*/\nimport { matchesSubString } from '../../../../../base/common/filters.js';\nimport { TextReplacement } from '../../../../common/core/edits/textEdit.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { ITextModel, EndOfLinePreference } from '../../../../common/model.js';\nimport { singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js';\n\nexport function inlineCompletionIsVisible(singleTextEdit: TextReplacement, originalRange: Range | undefined, model: ITextModel, cursorPosition: Position): boolean {\n\tconst minimizedReplacement = singleTextRemoveCommonPrefix(singleTextEdit, model);\n\tconst editRange = singleTextEdit.range;\n\tif (!editRange\n\t\t|| (originalRange && !originalRange.getStartPosition().equals(editRange.getStartPosition()))\n\t\t|| cursorPosition.lineNumber !== minimizedReplacement.range.startLineNumber\n\t\t|| minimizedReplacement.isEmpty // if the completion is empty after removing the common prefix of the completion and the model, the completion item would not be visible\n\t) {\n\t\treturn false;\n\t}\n\n\t// We might consider comparing by .toLowerText, but this requires GhostTextReplacement\n\tconst originalValue = model.getValueInRange(minimizedReplacement.range, EndOfLinePreference.LF);\n\tconst filterText = minimizedReplacement.text;\n\n\tconst cursorPosIndex = Math.max(0, cursorPosition.column - minimizedReplacement.range.startColumn);\n\n\tlet filterTextBefore = filterText.substring(0, cursorPosIndex);\n\tlet filterTextAfter = filterText.substring(cursorPosIndex);\n\n\tlet originalValueBefore = originalValue.substring(0, cursorPosIndex);\n\tlet originalValueAfter = originalValue.substring(cursorPosIndex);\n\n\tconst originalValueIndent = model.getLineIndentColumn(minimizedReplacement.range.startLineNumber);\n\tif (minimizedReplacement.range.startColumn <= originalValueIndent) {\n\t\t// Remove indentation\n\t\toriginalValueBefore = originalValueBefore.trimStart();\n\t\tif (originalValueBefore.length === 0) {\n\t\t\toriginalValueAfter = originalValueAfter.trimStart();\n\t\t}\n\t\tfilterTextBefore = filterTextBefore.trimStart();\n\t\tif (filterTextBefore.length === 0) {\n\t\t\tfilterTextAfter = filterTextAfter.trimStart();\n\t\t}\n\t}\n\n\treturn filterTextBefore.startsWith(originalValueBefore)\n\t\t&& !!matchesSubString(originalValueAfter, filterTextAfter);\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 *--------------------------------------------------------------------------------------------*/\nimport { matchesSubString } from '../../../../../base/common/filters.js';\nimport { TextReplacement } from '../../../../common/core/edits/textEdit.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { ITextModel, EndOfLinePreference } from '../../../../common/model.js';\nimport { singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js';\n\nexport function inlineCompletionIsVisible(singleTextEdit: TextReplacement, originalRange: Range | undefined, model: ITextModel, cursorPosition: Position): boolean {\n\tconst minimizedReplacement = singleTextRemoveCommonPrefix(singleTextEdit, model);\n\tconst editRange = singleTextEdit.range;\n\tif (!editRange\n\t\t|| (originalRange && !originalRange.getStartPosition().equals(editRange.getStartPosition()))\n\t\t|| cursorPosition.lineNumber !== minimizedReplacement.range.startLineNumber\n\t\t|| minimizedReplacement.isEmpty // if the completion is empty after removing the common prefix of the completion and the model, the completion item would not be visible\n\t) {\n\t\treturn false;\n\t}\n\n\t// We might consider comparing by .toLowerText, but this requires GhostTextReplacement\n\tconst originalValue = model.getValueInRange(minimizedReplacement.range, EndOfLinePreference.LF);\n\tconst filterText = minimizedReplacement.text;\n\n\tconst cursorPosIndex = Math.max(0, cursorPosition.column - minimizedReplacement.range.startColumn);\n\n\tlet filterTextBefore = filterText.substring(0, cursorPosIndex);\n\tlet filterTextAfter = filterText.substring(cursorPosIndex);\n\n\tlet originalValueBefore = originalValue.substring(0, cursorPosIndex);\n\tlet originalValueAfter = originalValue.substring(cursorPosIndex);\n\n\tconst originalValueIndent = model.getLineIndentColumn(minimizedReplacement.range.startLineNumber);\n\tif (minimizedReplacement.range.startColumn <= originalValueIndent) {\n\t\t// Remove indentation\n\t\toriginalValueBefore = originalValueBefore.trimStart();\n\t\tif (originalValueBefore.length === 0) {\n\t\t\toriginalValueAfter = originalValueAfter.trimStart();\n\t\t}\n\t\tfilterTextBefore = filterTextBefore.trimStart();\n\t\tif (filterTextBefore.length === 0) {\n\t\t\tfilterTextAfter = filterTextAfter.trimStart();\n\t\t}\n\t}\n\n\treturn filterTextBefore.startsWith(originalValueBefore)\n\t\t&& !!matchesSubString(originalValueAfter, filterTextAfter);\n}\n"]}