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,393 @@
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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
6
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
9
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ import { raceTimeout } from '../../../../../base/common/async.js';
15
+ import { CancellationTokenSource } from '../../../../../base/common/cancellation.js';
16
+ import { LcsDiff, StringDiffSequence } from '../../../../../base/common/diff/diff.js';
17
+ import { Disposable } from '../../../../../base/common/lifecycle.js';
18
+ import { localize } from '../../../../../nls.js';
19
+ import { CommandsRegistry, ICommandService } from '../../../../../platform/commands/common/commands.js';
20
+ import { IBulkEditService } from '../../../../browser/services/bulkEditService.js';
21
+ import { TextReplacement } from '../../../../common/core/edits/textEdit.js';
22
+ import { Position } from '../../../../common/core/position.js';
23
+ import { Range } from '../../../../common/core/range.js';
24
+ import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';
25
+ import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';
26
+ import { EditSources } from '../../../../common/textModelEditSource.js';
27
+ import { hasProvider, rawRename } from '../../../rename/browser/rename.js';
28
+ import { renameSymbolCommandId } from '../controller/commandIds.js';
29
+ import { InlineSuggestionItem } from './inlineSuggestionItem.js';
30
+ import { Codicon } from '../../../../../base/common/codicons.js';
31
+ var RenameKind;
32
+ (function (RenameKind) {
33
+ RenameKind["no"] = "no";
34
+ RenameKind["yes"] = "yes";
35
+ RenameKind["maybe"] = "maybe";
36
+ })(RenameKind || (RenameKind = {}));
37
+ (function (RenameKind) {
38
+ function fromString(value) {
39
+ switch (value) {
40
+ case 'no': return RenameKind.no;
41
+ case 'yes': return RenameKind.yes;
42
+ case 'maybe': return RenameKind.maybe;
43
+ default: return RenameKind.no;
44
+ }
45
+ }
46
+ RenameKind.fromString = fromString;
47
+ })(RenameKind || (RenameKind = {}));
48
+ export class RenameInferenceEngine {
49
+ constructor() {
50
+ }
51
+ inferRename(textModel, editRange, insertText, wordDefinition) {
52
+ // Extend the edit range to full lines to capture prefix/suffix renames
53
+ const extendedRange = new Range(editRange.startLineNumber, 1, editRange.endLineNumber, textModel.getLineMaxColumn(editRange.endLineNumber));
54
+ const startDiff = editRange.startColumn - extendedRange.startColumn;
55
+ const endDiff = extendedRange.endColumn - editRange.endColumn;
56
+ const originalText = textModel.getValueInRange(extendedRange);
57
+ const modifiedText = textModel.getValueInRange(new Range(extendedRange.startLineNumber, extendedRange.startColumn, extendedRange.startLineNumber, extendedRange.startColumn + startDiff)) +
58
+ insertText +
59
+ textModel.getValueInRange(new Range(extendedRange.endLineNumber, extendedRange.endColumn - endDiff, extendedRange.endLineNumber, extendedRange.endColumn));
60
+ // console.log(`Original: ${originalText} \nmodified: ${modifiedText}`);
61
+ const others = [];
62
+ const renames = [];
63
+ let oldName = undefined;
64
+ let newName = undefined;
65
+ let position = undefined;
66
+ const nesOffset = textModel.getOffsetAt(extendedRange.getStartPosition());
67
+ const { changes: originalChanges } = (new LcsDiff(new StringDiffSequence(originalText), new StringDiffSequence(modifiedText))).ComputeDiff(true);
68
+ if (originalChanges.length === 0) {
69
+ return undefined;
70
+ }
71
+ // Fold the changes to larger changes if the gap between two changes is a full word. This covers cases like renaming
72
+ // `foo` to `abcfoobar`
73
+ const changes = [];
74
+ for (const change of originalChanges) {
75
+ if (changes.length === 0) {
76
+ changes.push(change);
77
+ continue;
78
+ }
79
+ const lastChange = changes[changes.length - 1];
80
+ const gapOriginalLength = change.originalStart - (lastChange.originalStart + lastChange.originalLength);
81
+ if (gapOriginalLength > 0) {
82
+ const gapStartOffset = nesOffset + lastChange.originalStart + lastChange.originalLength;
83
+ const gapStartPos = textModel.getPositionAt(gapStartOffset);
84
+ const wordRange = textModel.getWordAtPosition(gapStartPos);
85
+ if (wordRange) {
86
+ const wordStartOffset = textModel.getOffsetAt(new Position(gapStartPos.lineNumber, wordRange.startColumn));
87
+ const wordEndOffset = textModel.getOffsetAt(new Position(gapStartPos.lineNumber, wordRange.endColumn));
88
+ const gapEndOffset = gapStartOffset + gapOriginalLength;
89
+ if (wordStartOffset <= gapStartOffset && gapEndOffset <= wordEndOffset && wordStartOffset <= gapEndOffset && gapEndOffset <= wordEndOffset) {
90
+ lastChange.originalLength = (change.originalStart + change.originalLength) - lastChange.originalStart;
91
+ lastChange.modifiedLength = (change.modifiedStart + change.modifiedLength) - lastChange.modifiedStart;
92
+ continue;
93
+ }
94
+ }
95
+ }
96
+ changes.push(change);
97
+ }
98
+ let tokenDiff = 0;
99
+ for (const change of changes) {
100
+ const originalTextSegment = originalText.substring(change.originalStart, change.originalStart + change.originalLength);
101
+ const insertedTextSegment = modifiedText.substring(change.modifiedStart, change.modifiedStart + change.modifiedLength);
102
+ const startOffset = nesOffset + change.originalStart;
103
+ const startPos = textModel.getPositionAt(startOffset);
104
+ const endOffset = startOffset + change.originalLength;
105
+ const endPos = textModel.getPositionAt(endOffset);
106
+ const range = Range.fromPositions(startPos, endPos);
107
+ const diff = insertedTextSegment.length - change.originalLength;
108
+ // If the original text segment contains a whitespace character we don't consider this a rename since
109
+ // identifiers in programming languages can't contain whitespace characters usually
110
+ if (/\s/.test(originalTextSegment)) {
111
+ others.push(new TextReplacement(range, insertedTextSegment));
112
+ tokenDiff += diff;
113
+ continue;
114
+ }
115
+ if (originalTextSegment.length > 0) {
116
+ wordDefinition.lastIndex = 0;
117
+ const match = wordDefinition.exec(originalTextSegment);
118
+ if (match === null || match.index !== 0 || match[0].length !== originalTextSegment.length) {
119
+ others.push(new TextReplacement(range, insertedTextSegment));
120
+ tokenDiff += diff;
121
+ continue;
122
+ }
123
+ }
124
+ // If the inserted text contains a whitespace character we don't consider this a rename since identifiers in
125
+ // programming languages can't contain whitespace characters usually
126
+ if (/\s/.test(insertedTextSegment)) {
127
+ others.push(new TextReplacement(range, insertedTextSegment));
128
+ tokenDiff += diff;
129
+ continue;
130
+ }
131
+ if (insertedTextSegment.length > 0) {
132
+ wordDefinition.lastIndex = 0;
133
+ const match = wordDefinition.exec(insertedTextSegment);
134
+ if (match === null || match.index !== 0 || match[0].length !== insertedTextSegment.length) {
135
+ others.push(new TextReplacement(range, insertedTextSegment));
136
+ tokenDiff += diff;
137
+ continue;
138
+ }
139
+ }
140
+ const wordRange = textModel.getWordAtPosition(startPos);
141
+ // If we don't have a word range at the start position of the current document then we
142
+ // don't treat it as a rename assuming that the rename refactoring will fail as well since
143
+ // there can't be an identifier at that position.
144
+ if (wordRange === null) {
145
+ others.push(new TextReplacement(range, insertedTextSegment));
146
+ tokenDiff += diff;
147
+ continue;
148
+ }
149
+ const originalStartColumn = change.originalStart + 1;
150
+ const isInsertion = change.originalLength === 0 && change.modifiedLength > 0;
151
+ let tokenInfo;
152
+ // Word info is left aligned whereas token info is right aligned for insertions.
153
+ // We prefer a suffix insertion for renames so we take the word range for the token info.
154
+ if (isInsertion && originalStartColumn === wordRange.endColumn && wordRange.endColumn > wordRange.startColumn) {
155
+ tokenInfo = this.getTokenAtPosition(textModel, new Position(startPos.lineNumber, wordRange.startColumn));
156
+ }
157
+ else {
158
+ tokenInfo = this.getTokenAtPosition(textModel, startPos);
159
+ }
160
+ if (wordRange.startColumn !== tokenInfo.range.startColumn || wordRange.endColumn !== tokenInfo.range.endColumn) {
161
+ others.push(new TextReplacement(range, insertedTextSegment));
162
+ tokenDiff += diff;
163
+ continue;
164
+ }
165
+ if (tokenInfo.type === 0 /* StandardTokenType.Other */) {
166
+ let identifier = textModel.getValueInRange(tokenInfo.range);
167
+ if (identifier.length === 0) {
168
+ others.push(new TextReplacement(range, insertedTextSegment));
169
+ tokenDiff += diff;
170
+ continue;
171
+ }
172
+ if (oldName === undefined) {
173
+ oldName = identifier;
174
+ }
175
+ else if (oldName !== identifier) {
176
+ others.push(new TextReplacement(range, insertedTextSegment));
177
+ tokenDiff += diff;
178
+ continue;
179
+ }
180
+ // We assume that the new name starts at the same position as the old name from a token range perspective.
181
+ const tokenStartPos = textModel.getOffsetAt(tokenInfo.range.getStartPosition()) - nesOffset + tokenDiff;
182
+ const tokenEndPos = textModel.getOffsetAt(tokenInfo.range.getEndPosition()) - nesOffset + tokenDiff;
183
+ identifier = modifiedText.substring(tokenStartPos, tokenEndPos + diff);
184
+ if (identifier.length === 0) {
185
+ others.push(new TextReplacement(range, insertedTextSegment));
186
+ tokenDiff += diff;
187
+ continue;
188
+ }
189
+ if (newName === undefined) {
190
+ newName = identifier;
191
+ }
192
+ else if (newName !== identifier) {
193
+ others.push(new TextReplacement(range, insertedTextSegment));
194
+ tokenDiff += diff;
195
+ continue;
196
+ }
197
+ if (position === undefined) {
198
+ position = tokenInfo.range.getStartPosition();
199
+ }
200
+ if (oldName !== undefined && newName !== undefined && oldName.length > 0 && newName.length > 0 && oldName !== newName) {
201
+ renames.push(new TextReplacement(tokenInfo.range, newName));
202
+ }
203
+ else {
204
+ renames.push(new TextReplacement(range, insertedTextSegment));
205
+ }
206
+ tokenDiff += diff;
207
+ }
208
+ else {
209
+ others.push(new TextReplacement(range, insertedTextSegment));
210
+ tokenDiff += insertedTextSegment.length - change.originalLength;
211
+ }
212
+ }
213
+ if (oldName === undefined || newName === undefined || position === undefined || oldName.length === 0 || newName.length === 0 || oldName === newName) {
214
+ return undefined;
215
+ }
216
+ wordDefinition.lastIndex = 0;
217
+ let match = wordDefinition.exec(oldName);
218
+ if (match === null || match.index !== 0 || match[0].length !== oldName.length) {
219
+ return undefined;
220
+ }
221
+ wordDefinition.lastIndex = 0;
222
+ match = wordDefinition.exec(newName);
223
+ if (match === null || match.index !== 0 || match[0].length !== newName.length) {
224
+ return undefined;
225
+ }
226
+ return {
227
+ renames: { edits: renames, position, oldName, newName },
228
+ others: { edits: others }
229
+ };
230
+ }
231
+ getTokenAtPosition(textModel, position) {
232
+ textModel.tokenization.tokenizeIfCheap(position.lineNumber);
233
+ const tokens = textModel.tokenization.getLineTokens(position.lineNumber);
234
+ const idx = tokens.findTokenIndexAtOffset(position.column - 1);
235
+ return {
236
+ type: tokens.getStandardTokenType(idx),
237
+ range: new Range(position.lineNumber, 1 + tokens.getStartOffset(idx), position.lineNumber, 1 + tokens.getEndOffset(idx))
238
+ };
239
+ }
240
+ }
241
+ class RenameSymbolRunnable {
242
+ constructor(languageFeaturesService, textModel, position, newName) {
243
+ this._result = undefined;
244
+ this._cancellationTokenSource = new CancellationTokenSource();
245
+ this._promise = rawRename(languageFeaturesService.renameProvider, textModel, position, newName, this._cancellationTokenSource.token);
246
+ }
247
+ cancel() {
248
+ this._cancellationTokenSource.cancel();
249
+ }
250
+ async getCount() {
251
+ const result = await this.getResult();
252
+ if (result === undefined) {
253
+ return 0;
254
+ }
255
+ return result.edits.length;
256
+ }
257
+ async getWorkspaceEdit() {
258
+ return this.getResult();
259
+ }
260
+ async getResult() {
261
+ if (this._result === undefined) {
262
+ this._result = await this._promise;
263
+ }
264
+ if (this._result.rejectReason) {
265
+ return undefined;
266
+ }
267
+ return this._result;
268
+ }
269
+ }
270
+ let RenameSymbolProcessor = class RenameSymbolProcessor extends Disposable {
271
+ constructor(_commandService, _languageFeaturesService, _languageConfigurationService, bulkEditService) {
272
+ super();
273
+ this._commandService = _commandService;
274
+ this._languageFeaturesService = _languageFeaturesService;
275
+ this._languageConfigurationService = _languageConfigurationService;
276
+ this._renameInferenceEngine = new RenameInferenceEngine();
277
+ const self = this;
278
+ this._register(CommandsRegistry.registerCommand(renameSymbolCommandId, async (_, textModel, position, newName, source, id) => {
279
+ if (self._renameRunnable === undefined) {
280
+ return;
281
+ }
282
+ let workspaceEdit;
283
+ if (self._renameRunnable.id !== id) {
284
+ self._renameRunnable.runnable.cancel();
285
+ self._renameRunnable = undefined;
286
+ const runnable = new RenameSymbolRunnable(self._languageFeaturesService, textModel, position, newName);
287
+ workspaceEdit = await runnable.getWorkspaceEdit();
288
+ }
289
+ else {
290
+ workspaceEdit = await self._renameRunnable.runnable.getWorkspaceEdit();
291
+ self._renameRunnable = undefined;
292
+ }
293
+ if (workspaceEdit === undefined) {
294
+ return;
295
+ }
296
+ bulkEditService.apply(workspaceEdit, { reason: source });
297
+ }));
298
+ }
299
+ async proposeRenameRefactoring(textModel, suggestItem) {
300
+ if (!suggestItem.supportsRename || suggestItem.action?.kind !== 'edit') {
301
+ return suggestItem;
302
+ }
303
+ if (!hasProvider(this._languageFeaturesService.renameProvider, textModel)) {
304
+ return suggestItem;
305
+ }
306
+ const start = Date.now();
307
+ const edit = suggestItem.action.textReplacement;
308
+ const languageConfiguration = this._languageConfigurationService.getLanguageConfiguration(textModel.getLanguageId());
309
+ // Check synchronously if a rename is possible
310
+ const edits = this._renameInferenceEngine.inferRename(textModel, edit.range, edit.text, languageConfiguration.wordDefinition);
311
+ if (edits === undefined || edits.renames.edits.length === 0) {
312
+ return suggestItem;
313
+ }
314
+ const { oldName, newName, position, edits: renameEdits } = edits.renames;
315
+ // Check asynchronously if a rename is possible
316
+ let timedOut = false;
317
+ const check = await raceTimeout(this.checkRenamePrecondition(suggestItem, textModel, position, oldName, newName), 100, () => { timedOut = true; });
318
+ const renamePossible = check === RenameKind.yes || check === RenameKind.maybe;
319
+ suggestItem.setRenameProcessingInfo({
320
+ createdRename: renamePossible,
321
+ duration: Date.now() - start,
322
+ timedOut,
323
+ droppedOtherEdits: renamePossible ? edits.others.edits.length : undefined,
324
+ droppedRenameEdits: renamePossible ? renameEdits.length - 1 : undefined,
325
+ });
326
+ if (!renamePossible) {
327
+ return suggestItem;
328
+ }
329
+ // Prepare the rename edits
330
+ const id = suggestItem.identity.id;
331
+ if (this._renameRunnable !== undefined) {
332
+ this._renameRunnable.runnable.cancel();
333
+ this._renameRunnable = undefined;
334
+ }
335
+ const runnable = new RenameSymbolRunnable(this._languageFeaturesService, textModel, position, newName);
336
+ this._renameRunnable = { id, runnable };
337
+ // Create alternative action
338
+ const source = EditSources.inlineCompletionAccept({
339
+ nes: suggestItem.isInlineEdit,
340
+ requestUuid: suggestItem.requestUuid,
341
+ providerId: suggestItem.source.provider.providerId,
342
+ languageId: textModel.getLanguageId(),
343
+ correlationId: suggestItem.getSourceCompletion().correlationId,
344
+ });
345
+ const command = {
346
+ id: renameSymbolCommandId,
347
+ title: localize(1220, "Rename"),
348
+ arguments: [textModel, position, newName, source, id],
349
+ };
350
+ const alternativeAction = {
351
+ label: localize(1221, "Rename"),
352
+ icon: Codicon.replaceAll,
353
+ command,
354
+ count: runnable.getCount(),
355
+ };
356
+ const renameAction = {
357
+ kind: 'edit',
358
+ range: renameEdits[0].range,
359
+ insertText: renameEdits[0].text,
360
+ snippetInfo: suggestItem.snippetInfo,
361
+ alternativeAction,
362
+ uri: textModel.uri
363
+ };
364
+ return InlineSuggestionItem.create(suggestItem.withAction(renameAction), textModel, false);
365
+ }
366
+ async checkRenamePrecondition(suggestItem, textModel, position, oldName, newName) {
367
+ // const result = await prepareRename(this._languageFeaturesService.renameProvider, textModel, position, CancellationToken.None);
368
+ // if (result === undefined || result.rejectReason) {
369
+ // return RenameKind.no;
370
+ // }
371
+ // return oldName === result.text ? RenameKind.yes : RenameKind.no;
372
+ try {
373
+ const result = await this._commandService.executeCommand('github.copilot.nes.prepareRename', textModel.uri, position, oldName, newName, suggestItem.requestUuid);
374
+ if (result === undefined) {
375
+ return RenameKind.no;
376
+ }
377
+ else {
378
+ return RenameKind.fromString(result);
379
+ }
380
+ }
381
+ catch (error) {
382
+ return RenameKind.no;
383
+ }
384
+ }
385
+ };
386
+ RenameSymbolProcessor = __decorate([
387
+ __param(0, ICommandService),
388
+ __param(1, ILanguageFeaturesService),
389
+ __param(2, ILanguageConfigurationService),
390
+ __param(3, IBulkEditService)
391
+ ], RenameSymbolProcessor);
392
+ export { RenameSymbolProcessor };
393
+ //# sourceMappingURL=renameSymbolProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAu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B,CAAC;iBAAM,CAAC;gBACP,OAAO,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACtC,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,UAAU,CAAC,EAAE,CAAC;QACtB,CAAC;IACF,CAAC;CACD,CAAA;AAnIY,qBAAqB;IAO/B,WAAA,eAAe,CAAA;IACf,WAAA,wBAAwB,CAAA;IACxB,WAAA,6BAA6B,CAAA;IAC7B,WAAA,gBAAgB,CAAA;GAVN,qBAAqB,CAmIjC","file":"renameSymbolProcessor.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 { raceTimeout } from '../../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { LcsDiff, StringDiffSequence } from '../../../../../base/common/diff/diff.js';\nimport { Disposable } from '../../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../../nls.js';\nimport { CommandsRegistry, ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { ServicesAccessor } from '../../../../browser/editorExtensions.js';\nimport { IBulkEditService } from '../../../../browser/services/bulkEditService.js';\nimport { TextReplacement } from '../../../../common/core/edits/textEdit.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { StandardTokenType } from '../../../../common/encodedTokenAttributes.js';\nimport { Command, type Rejection, type WorkspaceEdit } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { EditSources, TextModelEditSource } from '../../../../common/textModelEditSource.js';\nimport { hasProvider, rawRename } from '../../../rename/browser/rename.js';\nimport { renameSymbolCommandId } from '../controller/commandIds.js';\nimport { InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { IInlineSuggestDataActionEdit } from './provideInlineCompletions.js';\nimport { InlineSuggestAlternativeAction } from './InlineSuggestAlternativeAction.js';\nimport { Codicon } from '../../../../../base/common/codicons.js';\n\nenum RenameKind {\n\tno = 'no',\n\tyes = 'yes',\n\tmaybe = 'maybe'\n}\n\nnamespace RenameKind {\n\texport function fromString(value: string): RenameKind {\n\t\tswitch (value) {\n\t\t\tcase 'no': return RenameKind.no;\n\t\t\tcase 'yes': return RenameKind.yes;\n\t\t\tcase 'maybe': return RenameKind.maybe;\n\t\t\tdefault: return RenameKind.no;\n\t\t}\n\t}\n}\n\nexport type RenameEdits = {\n\trenames: { edits: TextReplacement[]; position: Position; oldName: string; newName: string };\n\tothers: { edits: TextReplacement[] };\n};\n\nexport class RenameInferenceEngine {\n\n\tpublic constructor() {\n\t}\n\n\tpublic inferRename(textModel: ITextModel, editRange: Range, insertText: string, wordDefinition: RegExp): RenameEdits | undefined {\n\n\t\t// Extend the edit range to full lines to capture prefix/suffix renames\n\t\tconst extendedRange = new Range(editRange.startLineNumber, 1, editRange.endLineNumber, textModel.getLineMaxColumn(editRange.endLineNumber));\n\t\tconst startDiff = editRange.startColumn - extendedRange.startColumn;\n\t\tconst endDiff = extendedRange.endColumn - editRange.endColumn;\n\n\t\tconst originalText = textModel.getValueInRange(extendedRange);\n\t\tconst modifiedText =\n\t\t\ttextModel.getValueInRange(new Range(extendedRange.startLineNumber, extendedRange.startColumn, extendedRange.startLineNumber, extendedRange.startColumn + startDiff)) +\n\t\t\tinsertText +\n\t\t\ttextModel.getValueInRange(new Range(extendedRange.endLineNumber, extendedRange.endColumn - endDiff, extendedRange.endLineNumber, extendedRange.endColumn));\n\n\t\t// console.log(`Original: ${originalText} \\nmodified: ${modifiedText}`);\n\t\tconst others: TextReplacement[] = [];\n\t\tconst renames: TextReplacement[] = [];\n\t\tlet oldName: string | undefined = undefined;\n\t\tlet newName: string | undefined = undefined;\n\t\tlet position: Position | undefined = undefined;\n\n\t\tconst nesOffset = textModel.getOffsetAt(extendedRange.getStartPosition());\n\n\t\tconst { changes: originalChanges } = (new LcsDiff(new StringDiffSequence(originalText), new StringDiffSequence(modifiedText))).ComputeDiff(true);\n\t\tif (originalChanges.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Fold the changes to larger changes if the gap between two changes is a full word. This covers cases like renaming\n\t\t// `foo` to `abcfoobar`\n\t\tconst changes: typeof originalChanges = [];\n\t\tfor (const change of originalChanges) {\n\t\t\tif (changes.length === 0) {\n\t\t\t\tchanges.push(change);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst lastChange = changes[changes.length - 1];\n\t\t\tconst gapOriginalLength = change.originalStart - (lastChange.originalStart + lastChange.originalLength);\n\n\t\t\tif (gapOriginalLength > 0) {\n\t\t\t\tconst gapStartOffset = nesOffset + lastChange.originalStart + lastChange.originalLength;\n\t\t\t\tconst gapStartPos = textModel.getPositionAt(gapStartOffset);\n\t\t\t\tconst wordRange = textModel.getWordAtPosition(gapStartPos);\n\n\t\t\t\tif (wordRange) {\n\t\t\t\t\tconst wordStartOffset = textModel.getOffsetAt(new Position(gapStartPos.lineNumber, wordRange.startColumn));\n\t\t\t\t\tconst wordEndOffset = textModel.getOffsetAt(new Position(gapStartPos.lineNumber, wordRange.endColumn));\n\t\t\t\t\tconst gapEndOffset = gapStartOffset + gapOriginalLength;\n\n\t\t\t\t\tif (wordStartOffset <= gapStartOffset && gapEndOffset <= wordEndOffset && wordStartOffset <= gapEndOffset && gapEndOffset <= wordEndOffset) {\n\t\t\t\t\t\tlastChange.originalLength = (change.originalStart + change.originalLength) - lastChange.originalStart;\n\t\t\t\t\t\tlastChange.modifiedLength = (change.modifiedStart + change.modifiedLength) - lastChange.modifiedStart;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchanges.push(change);\n\t\t}\n\n\t\tlet tokenDiff: number = 0;\n\t\tfor (const change of changes) {\n\t\t\tconst originalTextSegment = originalText.substring(change.originalStart, change.originalStart + change.originalLength);\n\t\t\tconst insertedTextSegment = modifiedText.substring(change.modifiedStart, change.modifiedStart + change.modifiedLength);\n\n\t\t\tconst startOffset = nesOffset + change.originalStart;\n\t\t\tconst startPos = textModel.getPositionAt(startOffset);\n\n\t\t\tconst endOffset = startOffset + change.originalLength;\n\t\t\tconst endPos = textModel.getPositionAt(endOffset);\n\n\t\t\tconst range = Range.fromPositions(startPos, endPos);\n\n\t\t\tconst diff = insertedTextSegment.length - change.originalLength;\n\n\t\t\t// If the original text segment contains a whitespace character we don't consider this a rename since\n\t\t\t// identifiers in programming languages can't contain whitespace characters usually\n\t\t\tif (/\\s/.test(originalTextSegment)) {\n\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\ttokenDiff += diff;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (originalTextSegment.length > 0) {\n\t\t\t\twordDefinition.lastIndex = 0;\n\t\t\t\tconst match = wordDefinition.exec(originalTextSegment);\n\t\t\t\tif (match === null || match.index !== 0 || match[0].length !== originalTextSegment.length) {\n\t\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\t\ttokenDiff += diff;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If the inserted text contains a whitespace character we don't consider this a rename since identifiers in\n\t\t\t// programming languages can't contain whitespace characters usually\n\t\t\tif (/\\s/.test(insertedTextSegment)) {\n\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\ttokenDiff += diff;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (insertedTextSegment.length > 0) {\n\t\t\t\twordDefinition.lastIndex = 0;\n\t\t\t\tconst match = wordDefinition.exec(insertedTextSegment);\n\t\t\t\tif (match === null || match.index !== 0 || match[0].length !== insertedTextSegment.length) {\n\t\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\t\ttokenDiff += diff;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst wordRange = textModel.getWordAtPosition(startPos);\n\t\t\t// If we don't have a word range at the start position of the current document then we\n\t\t\t// don't treat it as a rename assuming that the rename refactoring will fail as well since\n\t\t\t// there can't be an identifier at that position.\n\t\t\tif (wordRange === null) {\n\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\ttokenDiff += diff;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst originalStartColumn = change.originalStart + 1;\n\t\t\tconst isInsertion = change.originalLength === 0 && change.modifiedLength > 0;\n\t\t\tlet tokenInfo: { type: StandardTokenType; range: Range };\n\t\t\t// Word info is left aligned whereas token info is right aligned for insertions.\n\t\t\t// We prefer a suffix insertion for renames so we take the word range for the token info.\n\t\t\tif (isInsertion && originalStartColumn === wordRange.endColumn && wordRange.endColumn > wordRange.startColumn) {\n\t\t\t\ttokenInfo = this.getTokenAtPosition(textModel, new Position(startPos.lineNumber, wordRange.startColumn));\n\t\t\t} else {\n\t\t\t\ttokenInfo = this.getTokenAtPosition(textModel, startPos);\n\t\t\t}\n\t\t\tif (wordRange.startColumn !== tokenInfo.range.startColumn || wordRange.endColumn !== tokenInfo.range.endColumn) {\n\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\ttokenDiff += diff;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (tokenInfo.type === StandardTokenType.Other) {\n\n\t\t\t\tlet identifier = textModel.getValueInRange(tokenInfo.range);\n\t\t\t\tif (identifier.length === 0) {\n\t\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\t\ttokenDiff += diff;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (oldName === undefined) {\n\t\t\t\t\toldName = identifier;\n\t\t\t\t} else if (oldName !== identifier) {\n\t\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\t\ttokenDiff += diff;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// We assume that the new name starts at the same position as the old name from a token range perspective.\n\t\t\t\tconst tokenStartPos = textModel.getOffsetAt(tokenInfo.range.getStartPosition()) - nesOffset + tokenDiff;\n\t\t\t\tconst tokenEndPos = textModel.getOffsetAt(tokenInfo.range.getEndPosition()) - nesOffset + tokenDiff;\n\t\t\t\tidentifier = modifiedText.substring(tokenStartPos, tokenEndPos + diff);\n\t\t\t\tif (identifier.length === 0) {\n\t\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\t\ttokenDiff += diff;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (newName === undefined) {\n\t\t\t\t\tnewName = identifier;\n\t\t\t\t} else if (newName !== identifier) {\n\t\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\t\ttokenDiff += diff;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (position === undefined) {\n\t\t\t\t\tposition = tokenInfo.range.getStartPosition();\n\t\t\t\t}\n\n\t\t\t\tif (oldName !== undefined && newName !== undefined && oldName.length > 0 && newName.length > 0 && oldName !== newName) {\n\t\t\t\t\trenames.push(new TextReplacement(tokenInfo.range, newName));\n\t\t\t\t} else {\n\t\t\t\t\trenames.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\t}\n\t\t\t\ttokenDiff += diff;\n\t\t\t} else {\n\t\t\t\tothers.push(new TextReplacement(range, insertedTextSegment));\n\t\t\t\ttokenDiff += insertedTextSegment.length - change.originalLength;\n\t\t\t}\n\t\t}\n\n\t\tif (oldName === undefined || newName === undefined || position === undefined || oldName.length === 0 || newName.length === 0 || oldName === newName) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\twordDefinition.lastIndex = 0;\n\t\tlet match = wordDefinition.exec(oldName);\n\t\tif (match === null || match.index !== 0 || match[0].length !== oldName.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\twordDefinition.lastIndex = 0;\n\t\tmatch = wordDefinition.exec(newName);\n\t\tif (match === null || match.index !== 0 || match[0].length !== newName.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\trenames: { edits: renames, position, oldName, newName },\n\t\t\tothers: { edits: others }\n\t\t};\n\t}\n\n\n\tprotected getTokenAtPosition(textModel: ITextModel, position: Position): { type: StandardTokenType; range: Range } {\n\t\ttextModel.tokenization.tokenizeIfCheap(position.lineNumber);\n\t\tconst tokens = textModel.tokenization.getLineTokens(position.lineNumber);\n\t\tconst idx = tokens.findTokenIndexAtOffset(position.column - 1);\n\t\treturn {\n\t\t\ttype: tokens.getStandardTokenType(idx),\n\t\t\trange: new Range(position.lineNumber, 1 + tokens.getStartOffset(idx), position.lineNumber, 1 + tokens.getEndOffset(idx))\n\t\t};\n\t}\n}\n\nclass RenameSymbolRunnable {\n\n\tprivate readonly _cancellationTokenSource: CancellationTokenSource;\n\tprivate readonly _promise: Promise<WorkspaceEdit & Rejection>;\n\tprivate _result: WorkspaceEdit & Rejection | undefined = undefined;\n\n\tconstructor(languageFeaturesService: ILanguageFeaturesService, textModel: ITextModel, position: Position, newName: string) {\n\t\tthis._cancellationTokenSource = new CancellationTokenSource();\n\t\tthis._promise = rawRename(languageFeaturesService.renameProvider, textModel, position, newName, this._cancellationTokenSource.token);\n\t}\n\n\tpublic cancel(): void {\n\t\tthis._cancellationTokenSource.cancel();\n\t}\n\n\tpublic async getCount(): Promise<number> {\n\t\tconst result = await this.getResult();\n\t\tif (result === undefined) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn result.edits.length;\n\t}\n\n\tpublic async getWorkspaceEdit(): Promise<WorkspaceEdit | undefined> {\n\t\treturn this.getResult();\n\t}\n\n\tprivate async getResult(): Promise<WorkspaceEdit | undefined> {\n\t\tif (this._result === undefined) {\n\t\t\tthis._result = await this._promise;\n\t\t}\n\t\tif (this._result.rejectReason) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._result;\n\t}\n}\n\nexport class RenameSymbolProcessor extends Disposable {\n\n\tprivate readonly _renameInferenceEngine = new RenameInferenceEngine();\n\n\tprivate _renameRunnable: { id: string; runnable: RenameSymbolRunnable } | undefined;\n\n\tconstructor(\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@IBulkEditService bulkEditService: IBulkEditService,\n\t) {\n\t\tsuper();\n\t\tconst self = this;\n\t\tthis._register(CommandsRegistry.registerCommand(renameSymbolCommandId, async (_: ServicesAccessor, textModel: ITextModel, position: Position, newName: string, source: TextModelEditSource, id: string) => {\n\t\t\tif (self._renameRunnable === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet workspaceEdit: WorkspaceEdit | undefined;\n\t\t\tif (self._renameRunnable.id !== id) {\n\t\t\t\tself._renameRunnable.runnable.cancel();\n\t\t\t\tself._renameRunnable = undefined;\n\t\t\t\tconst runnable = new RenameSymbolRunnable(self._languageFeaturesService, textModel, position, newName);\n\t\t\t\tworkspaceEdit = await runnable.getWorkspaceEdit();\n\t\t\t} else {\n\t\t\t\tworkspaceEdit = await self._renameRunnable.runnable.getWorkspaceEdit();\n\t\t\t\tself._renameRunnable = undefined;\n\t\t\t}\n\t\t\tif (workspaceEdit === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbulkEditService.apply(workspaceEdit, { reason: source });\n\t\t}));\n\t}\n\n\tpublic async proposeRenameRefactoring(textModel: ITextModel, suggestItem: InlineSuggestionItem): Promise<InlineSuggestionItem> {\n\t\tif (!suggestItem.supportsRename || suggestItem.action?.kind !== 'edit') {\n\t\t\treturn suggestItem;\n\t\t}\n\n\t\tif (!hasProvider(this._languageFeaturesService.renameProvider, textModel)) {\n\t\t\treturn suggestItem;\n\t\t}\n\n\t\tconst start = Date.now();\n\t\tconst edit = suggestItem.action.textReplacement;\n\t\tconst languageConfiguration = this._languageConfigurationService.getLanguageConfiguration(textModel.getLanguageId());\n\n\t\t// Check synchronously if a rename is possible\n\t\tconst edits = this._renameInferenceEngine.inferRename(textModel, edit.range, edit.text, languageConfiguration.wordDefinition);\n\t\tif (edits === undefined || edits.renames.edits.length === 0) {\n\t\t\treturn suggestItem;\n\t\t}\n\n\t\tconst { oldName, newName, position, edits: renameEdits } = edits.renames;\n\n\t\t// Check asynchronously if a rename is possible\n\t\tlet timedOut = false;\n\t\tconst check = await raceTimeout<RenameKind>(this.checkRenamePrecondition(suggestItem, textModel, position, oldName, newName), 100, () => { timedOut = true; });\n\t\tconst renamePossible = check === RenameKind.yes || check === RenameKind.maybe;\n\n\t\tsuggestItem.setRenameProcessingInfo({\n\t\t\tcreatedRename: renamePossible,\n\t\t\tduration: Date.now() - start,\n\t\t\ttimedOut,\n\t\t\tdroppedOtherEdits: renamePossible ? edits.others.edits.length : undefined,\n\t\t\tdroppedRenameEdits: renamePossible ? renameEdits.length - 1 : undefined,\n\t\t});\n\n\t\tif (!renamePossible) {\n\t\t\treturn suggestItem;\n\t\t}\n\n\t\t// Prepare the rename edits\n\t\tconst id = suggestItem.identity.id;\n\t\tif (this._renameRunnable !== undefined) {\n\t\t\tthis._renameRunnable.runnable.cancel();\n\t\t\tthis._renameRunnable = undefined;\n\t\t}\n\t\tconst runnable = new RenameSymbolRunnable(this._languageFeaturesService, textModel, position, newName);\n\t\tthis._renameRunnable = { id, runnable };\n\n\t\t// Create alternative action\n\t\tconst source = EditSources.inlineCompletionAccept({\n\t\t\tnes: suggestItem.isInlineEdit,\n\t\t\trequestUuid: suggestItem.requestUuid,\n\t\t\tproviderId: suggestItem.source.provider.providerId,\n\t\t\tlanguageId: textModel.getLanguageId(),\n\t\t\tcorrelationId: suggestItem.getSourceCompletion().correlationId,\n\t\t});\n\t\tconst command: Command = {\n\t\t\tid: renameSymbolCommandId,\n\t\t\ttitle: localize('rename', \"Rename\"),\n\t\t\targuments: [textModel, position, newName, source, id],\n\t\t};\n\t\tconst alternativeAction: InlineSuggestAlternativeAction = {\n\t\t\tlabel: localize('rename', \"Rename\"),\n\t\t\ticon: Codicon.replaceAll,\n\t\t\tcommand,\n\t\t\tcount: runnable.getCount(),\n\t\t};\n\t\tconst renameAction: IInlineSuggestDataActionEdit = {\n\t\t\tkind: 'edit',\n\t\t\trange: renameEdits[0].range,\n\t\t\tinsertText: renameEdits[0].text,\n\t\t\tsnippetInfo: suggestItem.snippetInfo,\n\t\t\talternativeAction,\n\t\t\turi: textModel.uri\n\t\t};\n\n\t\treturn InlineSuggestionItem.create(suggestItem.withAction(renameAction), textModel, false);\n\t}\n\n\tprivate async checkRenamePrecondition(suggestItem: InlineSuggestionItem, textModel: ITextModel, position: Position, oldName: string, newName: string): Promise<RenameKind> {\n\t\t// const result = await prepareRename(this._languageFeaturesService.renameProvider, textModel, position, CancellationToken.None);\n\t\t// if (result === undefined || result.rejectReason) {\n\t\t// \treturn RenameKind.no;\n\t\t// }\n\t\t// return oldName === result.text ? RenameKind.yes : RenameKind.no;\n\n\t\ttry {\n\t\t\tconst result = await this._commandService.executeCommand<RenameKind>('github.copilot.nes.prepareRename', textModel.uri, position, oldName, newName, suggestItem.requestUuid);\n\t\t\tif (result === undefined) {\n\t\t\t\treturn RenameKind.no;\n\t\t\t} else {\n\t\t\t\treturn RenameKind.fromString(result);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn RenameKind.no;\n\t\t}\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/telemetry.ts","vs/editor/contrib/inlineCompletions/browser/telemetry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,UAAU,uCAAuC,CAAC,WAAkD,EAAE,gBAAgD;IAC3J,WAAW,CAAC,UAAU,CAA2E,4BAA4B,EAAE,gBAAgB,CAAC,CAAC;AAClJ,CAAC","file":"telemetry.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 { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\tnotShownReason: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\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 { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\tnotShownReason: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n};\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/telemetry.ts","vs/editor/contrib/inlineCompletions/browser/telemetry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,UAAU,uCAAuC,CAAC,WAAkD,EAAE,gBAAgD;IAC3J,WAAW,CAAC,UAAU,CAA2E,4BAA4B,EAAE,gBAAgB,CAAC,CAAC;AAClJ,CAAC","file":"telemetry.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 { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\tskuPlan: string | undefined;\n\tskuType: string | undefined;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tacceptedAlternativeAction: boolean | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\tnotShownReason: string | undefined;\n\trenameCreated: boolean | undefined;\n\trenameDuration: number | undefined;\n\trenameTimedOut: boolean | undefined;\n\trenameDroppedOtherEdits: number | undefined;\n\trenameDroppedRenameEdits: number | undefined;\n\tperformanceMarkers: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\tlongDistanceHintVisible: boolean | undefined;\n\tlongDistanceHintDistance: number | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n\t// shape\n\teditKind: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tskuPlan: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The the plan the user is subscribed to' };\n\tskuType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The sku type of the user' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tacceptedAlternativeAction: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the user performed an alternative action when accepting the inline completion' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\trenameCreated: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether a rename operation was created' };\n\trenameDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration of the rename processor' };\n\trenameTimedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the rename prepare operation timed out' };\n\trenameDroppedOtherEdits: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of non-rename edits dropped due to rename processing' };\n\trenameDroppedRenameEdits: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of rename edits dropped due to rename processing' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tlongDistanceHintVisible: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether a long distance hint was rendered' };\n\tlongDistanceHintDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'The distance in lines between the long distance hint and the inline edit' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n\tperformanceMarkers: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Performance markers for the inline completion lifecycle' };\n\teditKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of edit made by the inline completion' };\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 { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\tskuPlan: string | undefined;\n\tskuType: string | undefined;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tacceptedAlternativeAction: boolean | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\tnotShownReason: string | undefined;\n\trenameCreated: boolean | undefined;\n\trenameDuration: number | undefined;\n\trenameTimedOut: boolean | undefined;\n\trenameDroppedOtherEdits: number | undefined;\n\trenameDroppedRenameEdits: number | undefined;\n\tperformanceMarkers: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\tlongDistanceHintVisible: boolean | undefined;\n\tlongDistanceHintDistance: number | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n\t// shape\n\teditKind: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tskuPlan: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The the plan the user is subscribed to' };\n\tskuType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The sku type of the user' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tacceptedAlternativeAction: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the user performed an alternative action when accepting the inline completion' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\trenameCreated: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether a rename operation was created' };\n\trenameDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration of the rename processor' };\n\trenameTimedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the rename prepare operation timed out' };\n\trenameDroppedOtherEdits: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of non-rename edits dropped due to rename processing' };\n\trenameDroppedRenameEdits: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of rename edits dropped due to rename processing' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tlongDistanceHintVisible: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether a long distance hint was rendered' };\n\tlongDistanceHintDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'The distance in lines between the long distance hint and the inline edit' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n\tperformanceMarkers: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Performance markers for the inline completion lifecycle' };\n\teditKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of edit made by the inline completion' };\n};\n"]}
@@ -77,4 +77,24 @@ export function wait(ms, cancellationToken) {
77
77
  }
78
78
  });
79
79
  }
80
+ export class ErrorResult {
81
+ static message(message) {
82
+ return new ErrorResult(undefined, message);
83
+ }
84
+ constructor(error, message = undefined) {
85
+ this.error = error;
86
+ this.message = message;
87
+ }
88
+ static is(obj) {
89
+ return obj instanceof ErrorResult;
90
+ }
91
+ logError() {
92
+ if (this.message) {
93
+ console.error(`ErrorResult: ${this.message}`, this.error);
94
+ }
95
+ else {
96
+ console.error(`ErrorResult: An unexpected error-case occurred, usually caused by invalid input.`, this.error);
97
+ }
98
+ }
99
+ }
80
100
  //# sourceMappingURL=utils.js.map