monaco-editor-core 0.58.0 → 0.59.0-dev-20261124

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 (211) 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 +2 -0
  18. package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
  19. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +3 -0
  20. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
  21. package/esm/vs/base/browser/ui/selectBox/selectBoxNative.js +4 -2
  22. package/esm/vs/base/browser/ui/selectBox/selectBoxNative.js.map +1 -1
  23. package/esm/vs/base/browser/ui/tree/abstractTree.js +27 -1
  24. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  25. package/esm/vs/base/common/cancellation.js +3 -1
  26. package/esm/vs/base/common/cancellation.js.map +1 -1
  27. package/esm/vs/editor/browser/controller/mouseHandler.js +8 -1
  28. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  29. package/esm/vs/editor/browser/controller/mouseTarget.js +15 -6
  30. package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
  31. package/esm/vs/editor/browser/view.js +3 -2
  32. package/esm/vs/editor/browser/view.js.map +1 -1
  33. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +12 -8
  34. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  35. package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js +7 -11
  36. package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
  37. package/esm/vs/editor/common/config/editorOptions.js +246 -238
  38. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  39. package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
  40. package/esm/vs/editor/common/editorContextKeys.js +53 -53
  41. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  42. package/esm/vs/editor/common/languages.js +56 -56
  43. package/esm/vs/editor/common/model/editStack.js +1 -1
  44. package/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js +3 -1
  45. package/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js.map +1 -1
  46. package/esm/vs/editor/common/model/textModel.js +1 -0
  47. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  48. package/esm/vs/editor/common/model.js.map +1 -1
  49. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  50. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  51. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  52. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  53. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  54. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  55. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
  56. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  57. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  58. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  59. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  60. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  61. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  62. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  63. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  64. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  65. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  66. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  67. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  68. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +13 -13
  69. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  70. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  71. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
  72. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  73. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  74. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  75. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
  76. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  77. package/esm/vs/editor/contrib/find/browser/findController.js +17 -17
  78. package/esm/vs/editor/contrib/find/browser/findWidget.js +29 -29
  79. package/esm/vs/editor/contrib/folding/browser/folding.css +15 -0
  80. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  81. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  82. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  83. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  84. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  85. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  86. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  87. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  88. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  89. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  90. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  91. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  92. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  93. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  94. package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +1 -1
  95. package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js.map +1 -1
  96. package/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js +0 -5
  97. package/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js.map +1 -1
  98. package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +0 -3
  99. package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js.map +1 -1
  100. package/esm/vs/editor/contrib/hover/browser/hover.css +6 -2
  101. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  102. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  103. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  104. package/esm/vs/editor/contrib/hover/browser/hoverTypes.js.map +1 -1
  105. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +19 -39
  106. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  107. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +7 -7
  108. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  109. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  110. package/esm/vs/editor/contrib/indentation/common/indentation.js +14 -3
  111. package/esm/vs/editor/contrib/indentation/common/indentation.js.map +1 -1
  112. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  113. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
  114. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
  115. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +6 -6
  116. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  117. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +4 -4
  118. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
  119. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  120. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  121. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
  122. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  123. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  124. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  125. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
  126. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  127. package/esm/vs/editor/contrib/links/browser/links.js +11 -10
  128. package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
  129. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  130. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  131. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  132. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  133. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  134. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  135. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
  136. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
  137. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  138. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  139. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  140. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  141. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  142. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
  143. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  144. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  145. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  146. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
  147. package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +93 -38
  148. package/esm/vs/editor/contrib/suggest/browser/suggestModel.js.map +1 -1
  149. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +18 -18
  150. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +3 -3
  151. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  152. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  153. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  154. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  155. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  156. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  157. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  158. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  159. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  160. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  161. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
  162. package/esm/vs/editor/editor.api.d.ts +5 -0
  163. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +68 -68
  164. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  165. package/esm/vs/platform/actionWidget/browser/actionList.js +30 -31
  166. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  167. package/esm/vs/platform/actionWidget/browser/actionWidget.css +1 -1
  168. package/esm/vs/platform/actionWidget/browser/actionWidget.js +12 -12
  169. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +3 -3
  170. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  171. package/esm/vs/platform/actions/common/menuService.js +2 -2
  172. package/esm/vs/platform/configuration/common/configurationModels.js +15 -3
  173. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  174. package/esm/vs/platform/configuration/common/configurationRegistry.js +12 -12
  175. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  176. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  177. package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
  178. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  179. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  180. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  181. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  182. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  183. package/esm/vs/platform/list/browser/listService.js +27 -27
  184. package/esm/vs/platform/markers/common/markerService.js +2 -2
  185. package/esm/vs/platform/markers/common/markers.js +6 -6
  186. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  187. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  188. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  189. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  190. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  191. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  192. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  193. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  194. package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  195. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  196. package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
  197. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  198. package/esm/vs/platform/theme/common/colors/confettiColors.js +6 -6
  199. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  200. package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
  201. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  202. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  203. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  204. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  205. package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
  206. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  207. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  208. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  209. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  210. package/monaco.d.ts +5 -0
  211. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestModel.ts","vs/editor/contrib/suggest/browser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AC,CAAC;oBAElD,IAAI,QAAQ,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBACnD,iDAAiD;wBACjD,kDAAkD;wBAClD,IAAI,CAAC,MAAM,EAAE,CAAC;wBACd,OAAO;oBACR,CAAC;gBAEF,CAAC;qBAAM,CAAC;oBACP,eAAe;oBACf,IAAI,CAAC,MAAM,EAAE,CAAC;oBACd,OAAO;gBACR,CAAC;YACF,CAAC;YAED,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;gBACvB,eAAe,EAAE,IAAI,CAAC,gBAAgB;gBACtC,cAAc,EAAE,GAAG,CAAC,cAAc;gBAClC,QAAQ;aACR,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD,CAAA;AAtsBY,YAAY;IAwBtB,WAAA,oBAAoB,CAAA;IACpB,WAAA,iBAAiB,CAAA;IACjB,WAAA,iBAAiB,CAAA;IACjB,WAAA,WAAW,CAAA;IACX,WAAA,kBAAkB,CAAA;IAClB,WAAA,qBAAqB,CAAA;IACrB,WAAA,wBAAwB,CAAA;IACxB,WAAA,mBAAmB,CAAA;GA/BT,YAAY,CAssBxB","file":"suggestModel.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 { disposableTimeout, TimeoutTimer } from '../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { FuzzyScoreOptions } from '../../../../base/common/filters.js';\nimport { DisposableStore, dispose, IDisposable } from '../../../../base/common/lifecycle.js';\nimport { registerAutorunSelfDisposable } from '../../../../base/common/observable.js';\nimport { getLeadingWhitespace, isHighSurrogate, isLowSurrogate } from '../../../../base/common/strings.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IEnvironmentService } from '../../../../platform/environment/common/environment.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { IWordAtPosition } from '../../../common/core/wordHelper.js';\nimport { CursorChangeReason, ICursorSelectionChangedEvent } from '../../../common/cursorEvents.js';\nimport { CompletionContext, CompletionItemKind, CompletionItemProvider, CompletionTriggerKind } from '../../../common/languages.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { IEditorWorkerService } from '../../../common/services/editorWorker.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getInlineCompletionsController } from '../../inlineCompletions/browser/controller/common.js';\nimport { InlineCompletionContextKeys } from '../../inlineCompletions/browser/controller/inlineCompletionContextKeys.js';\nimport { SnippetController2 } from '../../snippet/browser/snippetController2.js';\nimport { CompletionModel } from './completionModel.js';\nimport { CompletionDurations, CompletionItem, CompletionOptions, getSnippetSuggestSupport, provideSuggestionItems, QuickSuggestionsOptions, SnippetSortOrder } from './suggest.js';\nimport { WordDistance } from './wordDistance.js';\n\nexport interface ICancelEvent {\n\treadonly retrigger: boolean;\n}\n\nexport interface ITriggerEvent {\n\treadonly auto: boolean;\n\treadonly shy: boolean;\n\treadonly position: IPosition;\n}\n\nexport interface ISuggestEvent {\n\treadonly completionModel: CompletionModel;\n\treadonly isFrozen: boolean;\n\treadonly triggerOptions: SuggestTriggerOptions;\n}\n\nexport interface SuggestTriggerOptions {\n\treadonly auto: boolean;\n\treadonly shy?: boolean;\n\treadonly refilter?: boolean;\n\treadonly retrigger?: boolean;\n\treadonly triggerKind?: CompletionTriggerKind;\n\treadonly triggerCharacter?: string;\n\treadonly clipboardText?: string;\n\tcompletionOptions?: Partial<CompletionOptions>;\n}\n\nexport class LineContext {\n\n\tstatic shouldAutoTrigger(editor: ICodeEditor): boolean {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tconst pos = editor.getPosition();\n\t\tmodel.tokenization.tokenizeIfCheap(pos.lineNumber);\n\n\t\tconst word = model.getWordAtPosition(pos);\n\t\tif (!word) {\n\t\t\treturn false;\n\t\t}\n\t\tif (word.endColumn !== pos.column &&\n\t\t\tword.startColumn + 1 !== pos.column /* after typing a single character before a word */) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!isNaN(Number(word.word))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\treadonly lineNumber: number;\n\treadonly column: number;\n\treadonly leadingLineContent: string;\n\treadonly leadingWord: IWordAtPosition;\n\treadonly triggerOptions: SuggestTriggerOptions;\n\n\tconstructor(model: ITextModel, position: Position, triggerOptions: SuggestTriggerOptions) {\n\t\tthis.leadingLineContent = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\tthis.leadingWord = model.getWordUntilPosition(position);\n\t\tthis.lineNumber = position.lineNumber;\n\t\tthis.column = position.column;\n\t\tthis.triggerOptions = triggerOptions;\n\t}\n}\n\nexport const enum State {\n\tIdle = 0,\n\tManual = 1,\n\tAuto = 2\n}\n\nfunction canShowQuickSuggest(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue(InlineCompletionContextKeys.inlineSuggestionVisible.key))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\tconst suppressSuggestions = contextKeyService.getContextKeyValue<boolean | undefined>(InlineCompletionContextKeys.suppressSuggestions.key);\n\tif (suppressSuggestions !== undefined) {\n\t\treturn !suppressSuggestions;\n\t}\n\treturn !editor.getOption(EditorOption.inlineSuggest).suppressSuggestions;\n}\n\nfunction canShowSuggestOnTriggerCharacters(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue('inlineSuggestionVisible'))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\tconst suppressSuggestions = contextKeyService.getContextKeyValue<boolean | undefined>(InlineCompletionContextKeys.suppressSuggestions.key);\n\tif (suppressSuggestions !== undefined) {\n\t\treturn !suppressSuggestions;\n\t}\n\treturn !editor.getOption(EditorOption.inlineSuggest).suppressSuggestions;\n}\n\nexport class SuggestModel implements IDisposable {\n\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _triggerCharacterListener = new DisposableStore();\n\tprivate readonly _triggerQuickSuggest = new TimeoutTimer();\n\tprivate _waitForInlineCompletions: DisposableStore | undefined;\n\n\tprivate _triggerState: SuggestTriggerOptions | undefined = undefined;\n\tprivate _requestToken?: CancellationTokenSource;\n\tprivate _context?: LineContext;\n\tprivate _currentSelection: Selection;\n\n\tprivate _completionModel: CompletionModel | undefined;\n\tprivate readonly _completionDisposables = new DisposableStore();\n\tprivate readonly _onDidCancel = new Emitter<ICancelEvent>();\n\tprivate readonly _onDidTrigger = new Emitter<ITriggerEvent>();\n\tprivate readonly _onDidSuggest = new Emitter<ISuggestEvent>();\n\n\treadonly onDidCancel: Event<ICancelEvent> = this._onDidCancel.event;\n\treadonly onDidTrigger: Event<ITriggerEvent> = this._onDidTrigger.event;\n\treadonly onDidSuggest: Event<ISuggestEvent> = this._onDidSuggest.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@ITelemetryService private readonly _telemetryService: ITelemetryService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEnvironmentService private readonly _envService: IEnvironmentService,\n\t) {\n\t\tthis._currentSelection = this._editor.getSelection() || new Selection(1, 1, 1, 1);\n\n\t\t// wire up various listeners\n\t\tthis._toDispose.add(this._editor.onDidChangeModel(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelLanguage(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeConfiguration(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t}));\n\t\tthis._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis._updateActiveSuggestSession();\n\t\t}));\n\n\t\tlet editorIsComposing = false;\n\t\tthis._toDispose.add(this._editor.onDidCompositionStart(() => {\n\t\t\teditorIsComposing = true;\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidCompositionEnd(() => {\n\t\t\teditorIsComposing = false;\n\t\t\tthis._onCompositionEnd();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorSelection(e => {\n\t\t\t// only trigger suggest when the editor isn't composing a character\n\t\t\tif (!editorIsComposing) {\n\t\t\t\tthis._onCursorChange(e);\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\t// only filter completions when the editor isn't composing a character\n\t\t\t// allow-any-unicode-next-line\n\t\t\t// e.g. ¨ + u makes ü but just ¨ cannot be used for filtering\n\t\t\tif (!editorIsComposing && this._triggerState !== undefined) {\n\t\t\t\tthis._refilterCompletionItems();\n\t\t\t}\n\t\t}));\n\n\t\tthis._updateTriggerCharacters();\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._triggerCharacterListener);\n\t\tdispose([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]);\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._toDispose.dispose();\n\t\tthis._completionDisposables.dispose();\n\t\tthis.cancel();\n\t}\n\n\tprivate _updateTriggerCharacters(): void {\n\t\tthis._triggerCharacterListener.clear();\n\n\t\tif (this._editor.getOption(EditorOption.readOnly)\n\t\t\t|| !this._editor.hasModel()\n\t\t\t|| !this._editor.getOption(EditorOption.suggestOnTriggerCharacters)) {\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst supportsByTriggerCharacter = new Map<string, Set<CompletionItemProvider>>();\n\t\tfor (const support of this._languageFeaturesService.completionProvider.all(this._editor.getModel())) {\n\t\t\tfor (const ch of support.triggerCharacters || []) {\n\t\t\t\tlet set = supportsByTriggerCharacter.get(ch);\n\t\t\t\tif (!set) {\n\t\t\t\t\tset = new Set();\n\t\t\t\t\tconst suggestSupport = getSnippetSuggestSupport();\n\t\t\t\t\tif (suggestSupport) {\n\t\t\t\t\t\tset.add(suggestSupport);\n\t\t\t\t\t}\n\t\t\t\t\tsupportsByTriggerCharacter.set(ch, set);\n\t\t\t\t}\n\t\t\t\tset.add(support);\n\t\t\t}\n\t\t}\n\n\n\t\tconst checkTriggerCharacter = (text?: string) => {\n\n\t\t\tif (!canShowSuggestOnTriggerCharacters(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\t// don't trigger by trigger characters when this is a case for quick suggest\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!text) {\n\t\t\t\t// came here from the compositionEnd-event\n\t\t\t\tconst position = this._editor.getPosition()!;\n\t\t\t\tconst model = this._editor.getModel()!;\n\t\t\t\ttext = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\t\t}\n\n\t\t\tlet lastChar = '';\n\t\t\tif (isLowSurrogate(text.charCodeAt(text.length - 1))) {\n\t\t\t\tif (isHighSurrogate(text.charCodeAt(text.length - 2))) {\n\t\t\t\t\tlastChar = text.substr(text.length - 2);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlastChar = text.charAt(text.length - 1);\n\t\t\t}\n\n\t\t\tconst supports = supportsByTriggerCharacter.get(lastChar);\n\t\t\tif (supports) {\n\n\t\t\t\t// keep existing items that where not computed by the\n\t\t\t\t// supports/providers that want to trigger now\n\t\t\t\tconst providerItemsToReuse = new Map<CompletionItemProvider, CompletionItem[]>();\n\t\t\t\tif (this._completionModel) {\n\t\t\t\t\tfor (const [provider, items] of this._completionModel.getItemsByProvider()) {\n\t\t\t\t\t\tif (!supports.has(provider)) {\n\t\t\t\t\t\t\tproviderItemsToReuse.set(provider, items);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.trigger({\n\t\t\t\t\tauto: true,\n\t\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\t\ttriggerCharacter: lastChar,\n\t\t\t\t\tretrigger: Boolean(this._completionModel),\n\t\t\t\t\tclipboardText: this._completionModel?.clipboardText,\n\t\t\t\t\tcompletionOptions: { providerFilter: supports, providerItemsToReuse }\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tthis._triggerCharacterListener.add(this._editor.onDidType(checkTriggerCharacter));\n\t\tthis._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => checkTriggerCharacter()));\n\t}\n\n\t// --- trigger/retrigger/cancel suggest\n\n\tget state(): State {\n\t\tif (!this._triggerState) {\n\t\t\treturn State.Idle;\n\t\t} else if (!this._triggerState.auto) {\n\t\t\treturn State.Manual;\n\t\t} else {\n\t\t\treturn State.Auto;\n\t\t}\n\t}\n\n\tcancel(retrigger: boolean = false): void {\n\t\tthis._triggerQuickSuggest.cancel();\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._waitForInlineCompletions = undefined;\n\n\t\tif (this._triggerState !== undefined) {\n\t\t\tthis._requestToken?.cancel();\n\t\t\tthis._requestToken = undefined;\n\t\t\tthis._triggerState = undefined;\n\t\t\tthis._completionModel = undefined;\n\t\t\tthis._context = undefined;\n\t\t\tthis._onDidCancel.fire({ retrigger });\n\t\t}\n\t}\n\n\tclear() {\n\t\tthis._completionDisposables.clear();\n\t}\n\n\tprivate _updateActiveSuggestSession(): void {\n\t\tif (this._triggerState !== undefined) {\n\t\t\tif (!this._editor.hasModel() || !this._languageFeaturesService.completionProvider.has(this._editor.getModel())) {\n\t\t\t\tthis.cancel();\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: this._triggerState.auto, retrigger: true });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _onCursorChange(e: ICursorSelectionChangedEvent): void {\n\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevSelection = this._currentSelection;\n\t\tthis._currentSelection = this._editor.getSelection();\n\n\t\tif (!e.selection.isEmpty()\n\t\t\t|| (e.reason !== CursorChangeReason.NotSet && e.reason !== CursorChangeReason.Explicit)\n\t\t\t|| (e.source !== 'keyboard' && e.source !== 'deleteLeft')\n\t\t) {\n\t\t\t// Early exit if nothing needs to be done!\n\t\t\t// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (this._triggerState === undefined && e.reason === CursorChangeReason.NotSet) {\n\t\t\tif (prevSelection.containsRange(this._currentSelection) || prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) {\n\t\t\t\t// cursor did move RIGHT due to typing -> trigger quick suggest\n\t\t\t\tthis._doTriggerQuickSuggest();\n\t\t\t}\n\n\t\t} else if (this._triggerState !== undefined && e.reason === CursorChangeReason.Explicit) {\n\t\t\t// suggest is active and something like cursor keys are used to move\n\t\t\t// the cursor. this means we can refilter at the new position\n\t\t\tthis._refilterCompletionItems();\n\t\t}\n\t}\n\n\tprivate _onCompositionEnd(): void {\n\t\t// trigger or refilter when composition ends\n\t\tif (this._triggerState === undefined) {\n\t\t\tthis._doTriggerQuickSuggest();\n\t\t} else {\n\t\t\tthis._refilterCompletionItems();\n\t\t}\n\t}\n\n\tprivate _doTriggerQuickSuggest(): void {\n\n\t\tif (QuickSuggestionsOptions.isAllOff(this._editor.getOption(EditorOption.quickSuggestions))) {\n\t\t\t// not enabled\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._editor.getOption(EditorOption.suggest).snippetsPreventQuickSuggestions && SnippetController2.get(this._editor)?.isInSnippet()) {\n\t\t\t// no quick suggestion when in snippet mode\n\t\t\treturn;\n\t\t}\n\n\t\tthis.cancel();\n\n\t\t// Cancel any in-flight wait for inline completions from a previous cycle\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._waitForInlineCompletions = undefined;\n\n\t\tthis._triggerQuickSuggest.cancelAndSet(() => {\n\t\t\tif (this._triggerState !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = this._editor.getModel();\n\t\t\tconst pos = this._editor.getPosition();\n\t\t\t// validate enabled now\n\t\t\tconst config = this._editor.getOption(EditorOption.quickSuggestions);\n\t\t\tif (QuickSuggestionsOptions.isAllOff(config)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet waitForInlineCompletions = false;\n\t\t\tif (!QuickSuggestionsOptions.isAllOn(config)) {\n\t\t\t\t// Check the type of the token that triggered this\n\t\t\t\tmodel.tokenization.tokenizeIfCheap(pos.lineNumber);\n\t\t\t\tconst lineTokens = model.tokenization.getLineTokens(pos.lineNumber);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(pos.column - 1 - 1, 0)));\n\t\t\t\tconst value = QuickSuggestionsOptions.valueFor(config, tokenType);\n\t\t\t\tif (value === 'off' || value === 'inline') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (value === 'offWhenInlineCompletions') {\n\t\t\t\t\twaitForInlineCompletions = this._languageFeaturesService.inlineCompletionsProvider.has(model)\n\t\t\t\t\t\t&& this._editor.getOption(EditorOption.inlineSuggest).enabled;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!canShowQuickSuggest(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\t// do not trigger quick suggestions if inline suggestions are shown\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this._languageFeaturesService.completionProvider.has(model)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (waitForInlineCompletions) {\n\t\t\t\t// Wait for inline completions to resolve before deciding\n\t\t\t\tthis._waitForInlineCompletionsAndTrigger(model, pos);\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: true });\n\t\t\t}\n\n\t\t}, this._editor.getOption(EditorOption.quickSuggestionsDelay));\n\t}\n\n\tprivate _waitForInlineCompletionsAndTrigger(initialModel: ITextModel, initialPosition: Position): void {\n\t\tconst initialModelVersion = initialModel.getVersionId();\n\t\tconst inlineController = getInlineCompletionsController(this._editor);\n\t\tconst inlineModel = inlineController?.model.get();\n\t\tif (!inlineController || !inlineModel) {\n\t\t\tthis.trigger({ auto: true });\n\t\t\treturn;\n\t\t}\n\n\t\tconst state = inlineModel.state.get();\n\t\tif (state?.inlineSuggestion) {\n\t\t\t// Inline completions are already showing - suppress\n\t\t\treturn;\n\t\t}\n\n\t\tconst store = new DisposableStore();\n\t\tthis._waitForInlineCompletions = store;\n\n\t\tconst triggerAndCleanUp = (doTrigger: boolean) => {\n\t\t\tstore.dispose();\n\t\t\tif (this._waitForInlineCompletions === store) {\n\t\t\t\tthis._waitForInlineCompletions = undefined;\n\t\t\t}\n\t\t\tif (this._triggerState !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!doTrigger) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst currentModel = this._editor.getModel();\n\t\t\tconst currentPosition = this._editor.getPosition();\n\t\t\tif (currentModel === initialModel\n\t\t\t\t&& currentModel.getVersionId() === initialModelVersion\n\t\t\t\t&& currentPosition?.equals(initialPosition)\n\t\t\t\t&& this._editor.hasWidgetFocus()\n\t\t\t) {\n\t\t\t\tthis.trigger({ auto: true });\n\t\t\t}\n\t\t};\n\n\t\t// Reading `inlineController.model` first in a single autorun binds the\n\t\t// wait to the model's lifetime: nested autoruns would have no defined\n\t\t// run order, so an inner state-watcher could fire on a disposed model\n\t\t// before the outer model-watcher cleaned it up.\n\t\tdisposableTimeout(() => {\n\t\t\ttriggerAndCleanUp(true);\n\t\t\tinlineModel.stop('automatic');\n\t\t}, 750, store);\n\n\t\tregisterAutorunSelfDisposable(store, reader => {\n\t\t\tconst currentInlineModel = inlineController.model.read(reader);\n\t\t\tif (currentInlineModel !== inlineModel) {\n\t\t\t\treader.dispose();\n\t\t\t\ttriggerAndCleanUp(false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst status = inlineModel.status.read(reader);\n\t\t\tconst currentState = inlineModel.state.read(reader);\n\t\t\tif (!currentState && status === 'loading') {\n\t\t\t\t// Still loading\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treader.dispose();\n\t\t\ttriggerAndCleanUp(!currentState);\n\t\t});\n\t}\n\n\tprivate _refilterCompletionItems(): void {\n\t\tassertType(this._editor.hasModel());\n\t\tassertType(this._triggerState !== undefined);\n\n\t\tconst model = this._editor.getModel();\n\t\tconst position = this._editor.getPosition();\n\t\tconst ctx = new LineContext(model, position, { ...this._triggerState, refilter: true });\n\t\tthis._onNewContext(ctx);\n\t}\n\n\ttrigger(options: SuggestTriggerOptions): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst ctx = new LineContext(model, this._editor.getPosition(), options);\n\n\t\t// Cancel previous requests, change state & update UI\n\t\tthis.cancel(options.retrigger);\n\t\tthis._triggerState = options;\n\t\tthis._onDidTrigger.fire({ auto: options.auto, shy: options.shy ?? false, position: this._editor.getPosition() });\n\n\t\t// Capture context when request was sent\n\t\tthis._context = ctx;\n\n\t\t// Build context for request\n\t\tlet suggestCtx: CompletionContext = { triggerKind: options.triggerKind ?? CompletionTriggerKind.Invoke };\n\t\tif (options.triggerCharacter) {\n\t\t\tsuggestCtx = {\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\ttriggerCharacter: options.triggerCharacter\n\t\t\t};\n\t\t}\n\n\t\tthis._requestToken = new CancellationTokenSource();\n\n\t\t// kind filter and snippet sort rules\n\t\tconst snippetSuggestions = this._editor.getOption(EditorOption.snippetSuggestions);\n\t\tlet snippetSortOrder = SnippetSortOrder.Inline;\n\t\tswitch (snippetSuggestions) {\n\t\t\tcase 'top':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Top;\n\t\t\t\tbreak;\n\t\t\t// \t↓ that's the default anyways...\n\t\t\t// case 'inline':\n\t\t\t// \tsnippetSortOrder = SnippetSortOrder.Inline;\n\t\t\t// \tbreak;\n\t\t\tcase 'bottom':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Bottom;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst { itemKind: itemKindFilter, showDeprecated } = SuggestModel.createSuggestFilter(this._editor);\n\t\tconst completionOptions = new CompletionOptions(snippetSortOrder, options.completionOptions?.kindFilter ?? itemKindFilter, options.completionOptions?.providerFilter, options.completionOptions?.providerItemsToReuse, showDeprecated);\n\t\tconst wordDistance = WordDistance.create(this._editorWorkerService, this._editor);\n\n\t\tconst completions = provideSuggestionItems(\n\t\t\tthis._languageFeaturesService.completionProvider,\n\t\t\tmodel,\n\t\t\tthis._editor.getPosition(),\n\t\t\tcompletionOptions,\n\t\t\tsuggestCtx,\n\t\t\tthis._requestToken.token\n\t\t);\n\n\t\tPromise.all([completions, wordDistance]).then(async ([completions, wordDistance]) => {\n\n\t\t\tthis._requestToken?.dispose();\n\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\tcompletions.disposable.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet clipboardText = options?.clipboardText;\n\t\t\tif (!clipboardText && completions.needsClipboard) {\n\t\t\t\tclipboardText = await this._clipboardService.readText();\n\t\t\t}\n\n\t\t\tif (this._triggerState === undefined) {\n\t\t\t\tcompletions.disposable.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst model = this._editor.getModel();\n\t\t\t// const items = completions.items;\n\n\t\t\t// if (existing) {\n\t\t\t// \tconst cmpFn = getSuggestionComparator(snippetSortOrder);\n\t\t\t// \titems = items.concat(existing.items).sort(cmpFn);\n\t\t\t// }\n\n\t\t\tconst ctx = new LineContext(model, this._editor.getPosition(), options);\n\t\t\tconst fuzzySearchOptions = {\n\t\t\t\t...FuzzyScoreOptions.default,\n\t\t\t\tfirstMatchCanBeWeak: !this._editor.getOption(EditorOption.suggest).matchOnWordStartOnly\n\t\t\t};\n\t\t\tthis._completionModel = new CompletionModel(completions.items, this._context!.column, {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context!.column\n\t\t\t},\n\t\t\t\twordDistance,\n\t\t\t\tthis._editor.getOption(EditorOption.suggest),\n\t\t\t\tthis._editor.getOption(EditorOption.snippetSuggestions),\n\t\t\t\tfuzzySearchOptions,\n\t\t\t\tclipboardText\n\t\t\t);\n\n\t\t\t// store containers so that they can be disposed later\n\t\t\tthis._completionDisposables.add(completions.disposable);\n\n\t\t\tthis._onNewContext(ctx);\n\n\t\t\t// finally report telemetry about durations\n\t\t\tthis._reportDurationsTelemetry(completions.durations);\n\n\t\t\t// report invalid completions by source\n\t\t\tif (!this._envService.isBuilt || this._envService.isExtensionDevelopment) {\n\t\t\t\tfor (const item of completions.items) {\n\t\t\t\t\tif (item.isInvalid) {\n\t\t\t\t\t\tthis._logService.warn(`[suggest] did IGNORE invalid completion item from ${item.provider._debugDisplayName}`, item.completion);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}).catch(onUnexpectedError);\n\t}\n\n\t/**\n\t * Report durations telemetry with a 1% sampling rate.\n\t * The telemetry is reported only if a random number between 0 and 100 is less than or equal to 1.\n\t */\n\tprivate _reportDurationsTelemetry(durations: CompletionDurations): void {\n\t\tif (Math.random() > 0.0001) { // 0.01%\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\ttype Durations = { data: string };\n\t\t\ttype DurationsClassification = {\n\t\t\t\towner: 'jrieken';\n\t\t\t\tcomment: 'Completions performance numbers';\n\t\t\t\tdata: { comment: 'Durations per source and overall'; classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth' };\n\t\t\t};\n\t\t\tthis._telemetryService.publicLog2<Durations, DurationsClassification>('suggest.durations.json', { data: JSON.stringify(durations) });\n\t\t\tthis._logService.debug('suggest.durations.json', durations);\n\t\t});\n\t}\n\n\tstatic createSuggestFilter(editor: ICodeEditor): { itemKind: Set<CompletionItemKind>; showDeprecated: boolean } {\n\t\t// kind filter and snippet sort rules\n\t\tconst result = new Set<CompletionItemKind>();\n\n\t\t// snippet setting\n\t\tconst snippetSuggestions = editor.getOption(EditorOption.snippetSuggestions);\n\t\tif (snippetSuggestions === 'none') {\n\t\t\tresult.add(CompletionItemKind.Snippet);\n\t\t}\n\n\t\t// type setting\n\t\tconst suggestOptions = editor.getOption(EditorOption.suggest);\n\t\tif (!suggestOptions.showMethods) { result.add(CompletionItemKind.Method); }\n\t\tif (!suggestOptions.showFunctions) { result.add(CompletionItemKind.Function); }\n\t\tif (!suggestOptions.showConstructors) { result.add(CompletionItemKind.Constructor); }\n\t\tif (!suggestOptions.showFields) { result.add(CompletionItemKind.Field); }\n\t\tif (!suggestOptions.showVariables) { result.add(CompletionItemKind.Variable); }\n\t\tif (!suggestOptions.showClasses) { result.add(CompletionItemKind.Class); }\n\t\tif (!suggestOptions.showStructs) { result.add(CompletionItemKind.Struct); }\n\t\tif (!suggestOptions.showInterfaces) { result.add(CompletionItemKind.Interface); }\n\t\tif (!suggestOptions.showModules) { result.add(CompletionItemKind.Module); }\n\t\tif (!suggestOptions.showProperties) { result.add(CompletionItemKind.Property); }\n\t\tif (!suggestOptions.showEvents) { result.add(CompletionItemKind.Event); }\n\t\tif (!suggestOptions.showOperators) { result.add(CompletionItemKind.Operator); }\n\t\tif (!suggestOptions.showUnits) { result.add(CompletionItemKind.Unit); }\n\t\tif (!suggestOptions.showValues) { result.add(CompletionItemKind.Value); }\n\t\tif (!suggestOptions.showConstants) { result.add(CompletionItemKind.Constant); }\n\t\tif (!suggestOptions.showEnums) { result.add(CompletionItemKind.Enum); }\n\t\tif (!suggestOptions.showEnumMembers) { result.add(CompletionItemKind.EnumMember); }\n\t\tif (!suggestOptions.showKeywords) { result.add(CompletionItemKind.Keyword); }\n\t\tif (!suggestOptions.showWords) { result.add(CompletionItemKind.Text); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Color); }\n\t\tif (!suggestOptions.showFiles) { result.add(CompletionItemKind.File); }\n\t\tif (!suggestOptions.showReferences) { result.add(CompletionItemKind.Reference); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Customcolor); }\n\t\tif (!suggestOptions.showFolders) { result.add(CompletionItemKind.Folder); }\n\t\tif (!suggestOptions.showTypeParameters) { result.add(CompletionItemKind.TypeParameter); }\n\t\tif (!suggestOptions.showSnippets) { result.add(CompletionItemKind.Snippet); }\n\t\tif (!suggestOptions.showUsers) { result.add(CompletionItemKind.User); }\n\t\tif (!suggestOptions.showIssues) { result.add(CompletionItemKind.Issue); }\n\n\t\treturn { itemKind: result, showDeprecated: suggestOptions.showDeprecated };\n\t}\n\n\tprivate _onNewContext(ctx: LineContext): void {\n\n\t\tif (!this._context) {\n\t\t\t// happens when 24x7 IntelliSense is enabled and still in its delay\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.lineNumber !== this._context.lineNumber) {\n\t\t\t// e.g. happens when pressing Enter while IntelliSense is computed\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (getLeadingWhitespace(ctx.leadingLineContent) !== getLeadingWhitespace(this._context.leadingLineContent)) {\n\t\t\t// cancel IntelliSense when line start changes\n\t\t\t// happens when the current word gets outdented\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column < this._context.column) {\n\t\t\t// typed -> moved cursor LEFT -> retrigger if still on a word\n\t\t\tif (ctx.leadingWord.word) {\n\t\t\t\tthis.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });\n\t\t\t} else {\n\t\t\t\tthis.cancel();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._completionModel) {\n\t\t\t// happens when IntelliSense is not yet computed\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.leadingWord.word.length !== 0 && ctx.leadingWord.startColumn > this._context.leadingWord.startColumn) {\n\t\t\t// started a new word while IntelliSense shows -> retrigger but reuse all items that we currently have\n\t\t\tconst shouldAutoTrigger = LineContext.shouldAutoTrigger(this._editor);\n\t\t\tif (shouldAutoTrigger && this._context) {\n\t\t\t\t// shouldAutoTrigger forces tokenization, which can cause pending cursor change events to be emitted, which can cause\n\t\t\t\t// suggestions to be cancelled, which causes `this._context` to be undefined\n\t\t\t\tconst map = this._completionModel.getItemsByProvider();\n\t\t\t\tthis.trigger({\n\t\t\t\t\tauto: this._context.triggerOptions.auto,\n\t\t\t\t\tretrigger: true,\n\t\t\t\t\tclipboardText: this._completionModel.clipboardText,\n\t\t\t\t\tcompletionOptions: { providerItemsToReuse: map }\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column > this._context.column && this._completionModel.getIncompleteProvider().size > 0 && ctx.leadingWord.word.length !== 0) {\n\t\t\t// typed -> moved cursor RIGHT & incomple model & still on a word -> retrigger\n\n\t\t\tconst providerItemsToReuse = new Map<CompletionItemProvider, CompletionItem[]>();\n\t\t\tconst providerFilter = new Set<CompletionItemProvider>();\n\t\t\tfor (const [provider, items] of this._completionModel.getItemsByProvider()) {\n\t\t\t\tif (items.length > 0 && items[0].container.incomplete) {\n\t\t\t\t\tproviderFilter.add(provider);\n\t\t\t\t} else {\n\t\t\t\t\tproviderItemsToReuse.set(provider, items);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.trigger({\n\t\t\t\tauto: this._context.triggerOptions.auto,\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerForIncompleteCompletions,\n\t\t\t\tretrigger: true,\n\t\t\t\tclipboardText: this._completionModel.clipboardText,\n\t\t\t\tcompletionOptions: { providerFilter, providerItemsToReuse }\n\t\t\t});\n\n\t\t} else {\n\t\t\t// typed -> moved cursor RIGHT -> update UI\n\t\t\tconst oldLineContext = this._completionModel.lineContext;\n\t\t\tlet isFrozen = false;\n\n\t\t\tthis._completionModel.lineContext = {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context.column\n\t\t\t};\n\n\t\t\tif (this._completionModel.items.length === 0) {\n\n\t\t\t\tconst shouldAutoTrigger = LineContext.shouldAutoTrigger(this._editor);\n\t\t\t\tif (!this._context) {\n\t\t\t\t\t// shouldAutoTrigger forces tokenization, which can cause pending cursor change events to be emitted, which can cause\n\t\t\t\t\t// suggestions to be cancelled, which causes `this._context` to be undefined\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (shouldAutoTrigger && this._context.leadingWord.endColumn < ctx.leadingWord.startColumn) {\n\t\t\t\t\t// retrigger when heading into a new word\n\t\t\t\t\tthis.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!this._context.triggerOptions.auto) {\n\t\t\t\t\t// freeze when IntelliSense was manually requested\n\t\t\t\t\tthis._completionModel.lineContext = oldLineContext;\n\t\t\t\t\tisFrozen = this._completionModel.items.length > 0;\n\n\t\t\t\t\tif (isFrozen && ctx.leadingWord.word.length === 0) {\n\t\t\t\t\t\t// there were results before but now there aren't\n\t\t\t\t\t\t// and also we are not on a word anymore -> cancel\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t// nothing left\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidSuggest.fire({\n\t\t\t\tcompletionModel: this._completionModel,\n\t\t\t\ttriggerOptions: ctx.triggerOptions,\n\t\t\t\tisFrozen,\n\t\t\t});\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { disposableTimeout, TimeoutTimer } from '../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { FuzzyScoreOptions } from '../../../../base/common/filters.js';\nimport { DisposableStore, dispose, IDisposable } from '../../../../base/common/lifecycle.js';\nimport { registerAutorunSelfDisposable } from '../../../../base/common/observable.js';\nimport { getLeadingWhitespace, isHighSurrogate, isLowSurrogate } from '../../../../base/common/strings.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IEnvironmentService } from '../../../../platform/environment/common/environment.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { IWordAtPosition } from '../../../common/core/wordHelper.js';\nimport { CursorChangeReason, ICursorSelectionChangedEvent } from '../../../common/cursorEvents.js';\nimport { CompletionContext, CompletionItemKind, CompletionItemProvider, CompletionTriggerKind } from '../../../common/languages.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { IEditorWorkerService } from '../../../common/services/editorWorker.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getInlineCompletionsController } from '../../inlineCompletions/browser/controller/common.js';\nimport { InlineCompletionContextKeys } from '../../inlineCompletions/browser/controller/inlineCompletionContextKeys.js';\nimport { SnippetController2 } from '../../snippet/browser/snippetController2.js';\nimport { CompletionModel } from './completionModel.js';\nimport { CompletionDurations, CompletionItem, CompletionOptions, getSnippetSuggestSupport, provideSuggestionItems, QuickSuggestionsOptions, SnippetSortOrder } from './suggest.js';\nimport { WordDistance } from './wordDistance.js';\n\nexport interface ICancelEvent {\n\treadonly retrigger: boolean;\n}\n\nexport interface ITriggerEvent {\n\treadonly auto: boolean;\n\treadonly shy: boolean;\n\treadonly position: IPosition;\n}\n\nexport interface ISuggestEvent {\n\treadonly completionModel: CompletionModel;\n\treadonly isFrozen: boolean;\n\treadonly triggerOptions: SuggestTriggerOptions;\n}\n\nexport interface SuggestTriggerOptions {\n\treadonly auto: boolean;\n\treadonly shy?: boolean;\n\treadonly refilter?: boolean;\n\treadonly retrigger?: boolean;\n\treadonly triggerKind?: CompletionTriggerKind;\n\treadonly triggerCharacter?: string;\n\treadonly clipboardText?: string;\n\tcompletionOptions?: Partial<CompletionOptions>;\n}\n\nexport class LineContext {\n\n\tstatic shouldAutoTrigger(editor: ICodeEditor): boolean {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tconst pos = editor.getPosition();\n\t\tmodel.tokenization.tokenizeIfCheap(pos.lineNumber);\n\n\t\tconst word = model.getWordAtPosition(pos);\n\t\tif (!word) {\n\t\t\treturn false;\n\t\t}\n\t\tif (word.endColumn !== pos.column &&\n\t\t\tword.startColumn + 1 !== pos.column /* after typing a single character before a word */) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!isNaN(Number(word.word))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\treadonly lineNumber: number;\n\treadonly column: number;\n\treadonly leadingLineContent: string;\n\treadonly leadingWord: IWordAtPosition;\n\treadonly triggerOptions: SuggestTriggerOptions;\n\n\tconstructor(model: ITextModel, position: Position, triggerOptions: SuggestTriggerOptions) {\n\t\tthis.leadingLineContent = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\tthis.leadingWord = model.getWordUntilPosition(position);\n\t\tthis.lineNumber = position.lineNumber;\n\t\tthis.column = position.column;\n\t\tthis.triggerOptions = triggerOptions;\n\t}\n}\n\nexport const enum State {\n\tIdle = 0,\n\tManual = 1,\n\tAuto = 2\n}\n\nfunction canShowQuickSuggest(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue(InlineCompletionContextKeys.inlineSuggestionVisible.key))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\tconst suppressSuggestions = contextKeyService.getContextKeyValue<boolean | undefined>(InlineCompletionContextKeys.suppressSuggestions.key);\n\tif (suppressSuggestions !== undefined) {\n\t\treturn !suppressSuggestions;\n\t}\n\treturn !editor.getOption(EditorOption.inlineSuggest).suppressSuggestions;\n}\n\nfunction canShowSuggestOnTriggerCharacters(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue('inlineSuggestionVisible'))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\tconst suppressSuggestions = contextKeyService.getContextKeyValue<boolean | undefined>(InlineCompletionContextKeys.suppressSuggestions.key);\n\tif (suppressSuggestions !== undefined) {\n\t\treturn !suppressSuggestions;\n\t}\n\treturn !editor.getOption(EditorOption.inlineSuggest).suppressSuggestions;\n}\n\nexport class SuggestModel implements IDisposable {\n\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _triggerCharacterListener = new DisposableStore();\n\tprivate readonly _triggerQuickSuggest = new TimeoutTimer();\n\tprivate _waitForInlineCompletions: DisposableStore | undefined;\n\n\tprivate _triggerState: SuggestTriggerOptions | undefined = undefined;\n\tprivate _requestToken?: CancellationTokenSource;\n\tprivate _context?: LineContext;\n\tprivate _currentSelection: Selection;\n\n\tprivate _completionModel: CompletionModel | undefined;\n\tprivate readonly _completionDisposables = new DisposableStore();\n\tprivate readonly _onDidCancel = new Emitter<ICancelEvent>();\n\tprivate readonly _onDidTrigger = new Emitter<ITriggerEvent>();\n\tprivate readonly _onDidSuggest = new Emitter<ISuggestEvent>();\n\n\treadonly onDidCancel: Event<ICancelEvent> = this._onDidCancel.event;\n\treadonly onDidTrigger: Event<ITriggerEvent> = this._onDidTrigger.event;\n\treadonly onDidSuggest: Event<ISuggestEvent> = this._onDidSuggest.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@ITelemetryService private readonly _telemetryService: ITelemetryService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEnvironmentService private readonly _envService: IEnvironmentService,\n\t) {\n\t\tthis._currentSelection = this._editor.getSelection() || new Selection(1, 1, 1, 1);\n\n\t\t// wire up various listeners\n\t\tthis._toDispose.add(this._editor.onDidChangeModel(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelLanguage(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeConfiguration(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t}));\n\t\tthis._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis._updateActiveSuggestSession();\n\t\t}));\n\n\t\tlet editorIsComposing = false;\n\t\tthis._toDispose.add(this._editor.onDidCompositionStart(() => {\n\t\t\teditorIsComposing = true;\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidCompositionEnd(() => {\n\t\t\teditorIsComposing = false;\n\t\t\tthis._onCompositionEnd();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorSelection(e => {\n\t\t\t// only trigger suggest when the editor isn't composing a character\n\t\t\tif (!editorIsComposing) {\n\t\t\t\tthis._onCursorChange(e);\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\t// only filter completions when the editor isn't composing a character\n\t\t\t// allow-any-unicode-next-line\n\t\t\t// e.g. ¨ + u makes ü but just ¨ cannot be used for filtering\n\t\t\tif (!editorIsComposing && this._triggerState !== undefined) {\n\t\t\t\tthis._refilterCompletionItems();\n\t\t\t}\n\t\t}));\n\n\t\tthis._updateTriggerCharacters();\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._triggerCharacterListener);\n\t\tdispose([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]);\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._toDispose.dispose();\n\t\tthis._completionDisposables.dispose();\n\t\tthis.cancel();\n\t}\n\n\tprivate _updateTriggerCharacters(): void {\n\t\tthis._triggerCharacterListener.clear();\n\n\t\tif (this._editor.getOption(EditorOption.readOnly)\n\t\t\t|| !this._editor.hasModel()\n\t\t\t|| !this._editor.getOption(EditorOption.suggestOnTriggerCharacters)) {\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst supportsByTriggerCharacter = new Map<string, Set<CompletionItemProvider>>();\n\t\tfor (const support of this._languageFeaturesService.completionProvider.all(this._editor.getModel())) {\n\t\t\tfor (const ch of support.triggerCharacters || []) {\n\t\t\t\tlet set = supportsByTriggerCharacter.get(ch);\n\t\t\t\tif (!set) {\n\t\t\t\t\tset = new Set();\n\t\t\t\t\tconst suggestSupport = getSnippetSuggestSupport();\n\t\t\t\t\tif (suggestSupport) {\n\t\t\t\t\t\tset.add(suggestSupport);\n\t\t\t\t\t}\n\t\t\t\t\tsupportsByTriggerCharacter.set(ch, set);\n\t\t\t\t}\n\t\t\t\tset.add(support);\n\t\t\t}\n\t\t}\n\n\n\t\tconst checkTriggerCharacter = (text?: string) => {\n\n\t\t\tif (!canShowSuggestOnTriggerCharacters(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\t// don't trigger by trigger characters when this is a case for quick suggest\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!text) {\n\t\t\t\t// came here from the compositionEnd-event\n\t\t\t\tconst position = this._editor.getPosition()!;\n\t\t\t\tconst model = this._editor.getModel()!;\n\t\t\t\ttext = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\t\t}\n\n\t\t\tlet lastChar = '';\n\t\t\tif (isLowSurrogate(text.charCodeAt(text.length - 1))) {\n\t\t\t\tif (isHighSurrogate(text.charCodeAt(text.length - 2))) {\n\t\t\t\t\tlastChar = text.substr(text.length - 2);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlastChar = text.charAt(text.length - 1);\n\t\t\t}\n\n\t\t\tconst supports = supportsByTriggerCharacter.get(lastChar);\n\t\t\tif (supports) {\n\n\t\t\t\t// keep existing items that where not computed by the\n\t\t\t\t// supports/providers that want to trigger now\n\t\t\t\tconst providerItemsToReuse = new Map<CompletionItemProvider, CompletionItem[]>();\n\t\t\t\tif (this._completionModel) {\n\t\t\t\t\tfor (const [provider, items] of this._completionModel.getItemsByProvider()) {\n\t\t\t\t\t\tif (!supports.has(provider)) {\n\t\t\t\t\t\t\tproviderItemsToReuse.set(provider, items);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.trigger({\n\t\t\t\t\tauto: true,\n\t\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\t\ttriggerCharacter: lastChar,\n\t\t\t\t\tretrigger: Boolean(this._completionModel),\n\t\t\t\t\tclipboardText: this._completionModel?.clipboardText,\n\t\t\t\t\tcompletionOptions: { providerFilter: supports, providerItemsToReuse }\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tthis._triggerCharacterListener.add(this._editor.onDidType(checkTriggerCharacter));\n\t\tthis._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => checkTriggerCharacter()));\n\t}\n\n\t// --- trigger/retrigger/cancel suggest\n\n\tget state(): State {\n\t\tif (!this._triggerState) {\n\t\t\treturn State.Idle;\n\t\t} else if (!this._triggerState.auto) {\n\t\t\treturn State.Manual;\n\t\t} else {\n\t\t\treturn State.Auto;\n\t\t}\n\t}\n\n\tcancel(retrigger: boolean = false): void {\n\t\tthis._triggerQuickSuggest.cancel();\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._waitForInlineCompletions = undefined;\n\n\t\tif (this._triggerState !== undefined) {\n\t\t\tthis._requestToken?.cancel();\n\t\t\tthis._requestToken = undefined;\n\t\t\tthis._triggerState = undefined;\n\t\t\tthis._completionModel = undefined;\n\t\t\tthis._context = undefined;\n\t\t\tthis._onDidCancel.fire({ retrigger });\n\t\t}\n\t}\n\n\tclear() {\n\t\tthis._completionDisposables.clear();\n\t}\n\n\tprivate _updateActiveSuggestSession(): void {\n\t\tif (this._triggerState !== undefined) {\n\t\t\tif (!this._editor.hasModel() || !this._languageFeaturesService.completionProvider.has(this._editor.getModel())) {\n\t\t\t\tthis.cancel();\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: this._triggerState.auto, retrigger: true });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _onCursorChange(e: ICursorSelectionChangedEvent): void {\n\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevSelection = this._currentSelection;\n\t\tthis._currentSelection = this._editor.getSelection();\n\n\t\tif (!e.selection.isEmpty()\n\t\t\t|| (e.reason !== CursorChangeReason.NotSet && e.reason !== CursorChangeReason.Explicit)\n\t\t\t|| (e.source !== 'keyboard' && e.source !== 'deleteLeft')\n\t\t) {\n\t\t\t// Early exit if nothing needs to be done!\n\t\t\t// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (this._triggerState === undefined && e.reason === CursorChangeReason.NotSet) {\n\t\t\tif (prevSelection.containsRange(this._currentSelection) || prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) {\n\t\t\t\t// cursor did move RIGHT due to typing -> trigger quick suggest\n\t\t\t\tthis._doTriggerQuickSuggest();\n\t\t\t}\n\n\t\t} else if (this._triggerState !== undefined && e.reason === CursorChangeReason.Explicit) {\n\t\t\t// suggest is active and something like cursor keys are used to move\n\t\t\t// the cursor. this means we can refilter at the new position\n\t\t\tthis._refilterCompletionItems();\n\t\t}\n\t}\n\n\tprivate _onCompositionEnd(): void {\n\t\t// trigger or refilter when composition ends\n\t\tif (this._triggerState === undefined) {\n\t\t\tthis._doTriggerQuickSuggest();\n\t\t} else {\n\t\t\tthis._refilterCompletionItems();\n\t\t}\n\t}\n\n\tprivate _doTriggerQuickSuggest(): void {\n\n\t\tif (QuickSuggestionsOptions.isAllOff(this._editor.getOption(EditorOption.quickSuggestions))) {\n\t\t\t// not enabled\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._editor.getOption(EditorOption.suggest).snippetsPreventQuickSuggestions && SnippetController2.get(this._editor)?.isInSnippet()) {\n\t\t\t// no quick suggestion when in snippet mode\n\t\t\treturn;\n\t\t}\n\n\t\tthis.cancel();\n\n\t\t// Cancel any in-flight wait for inline completions from a previous cycle\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._waitForInlineCompletions = undefined;\n\n\t\tthis._triggerQuickSuggest.cancelAndSet(() => {\n\t\t\tif (this._triggerState !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = this._editor.getModel();\n\t\t\tconst pos = this._editor.getPosition();\n\t\t\t// validate enabled now\n\t\t\tconst config = this._editor.getOption(EditorOption.quickSuggestions);\n\t\t\tif (QuickSuggestionsOptions.isAllOff(config)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet waitForInlineCompletions = false;\n\t\t\tif (!QuickSuggestionsOptions.isAllOn(config)) {\n\t\t\t\t// Check the type of the token that triggered this\n\t\t\t\tmodel.tokenization.tokenizeIfCheap(pos.lineNumber);\n\t\t\t\tconst lineTokens = model.tokenization.getLineTokens(pos.lineNumber);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(pos.column - 1 - 1, 0)));\n\t\t\t\tconst value = QuickSuggestionsOptions.valueFor(config, tokenType);\n\t\t\t\tif (value === 'off' || value === 'inline') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (value === 'offWhenInlineCompletions') {\n\t\t\t\t\twaitForInlineCompletions = this._languageFeaturesService.inlineCompletionsProvider.has(model)\n\t\t\t\t\t\t&& this._editor.getOption(EditorOption.inlineSuggest).enabled;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!canShowQuickSuggest(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\t// do not trigger quick suggestions if inline suggestions are shown\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this._languageFeaturesService.completionProvider.has(model)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (waitForInlineCompletions) {\n\t\t\t\t// Wait for inline completions to resolve before deciding\n\t\t\t\tthis._waitForInlineCompletionsAndTrigger(model, pos);\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: true });\n\t\t\t}\n\n\t\t}, this._editor.getOption(EditorOption.quickSuggestionsDelay));\n\t}\n\n\tprivate _waitForInlineCompletionsAndTrigger(initialModel: ITextModel, initialPosition: Position): void {\n\t\tconst initialModelVersion = initialModel.getVersionId();\n\t\tconst inlineController = getInlineCompletionsController(this._editor);\n\t\tconst inlineModel = inlineController?.model.get();\n\t\tif (!inlineController || !inlineModel) {\n\t\t\tthis.trigger({ auto: true });\n\t\t\treturn;\n\t\t}\n\n\t\tconst state = inlineModel.state.get();\n\t\tif (state?.inlineSuggestion) {\n\t\t\t// Inline completions are already showing - suppress\n\t\t\treturn;\n\t\t}\n\n\t\tconst store = new DisposableStore();\n\t\tthis._waitForInlineCompletions = store;\n\n\t\tconst triggerAndCleanUp = (doTrigger: boolean) => {\n\t\t\tstore.dispose();\n\t\t\tif (this._waitForInlineCompletions === store) {\n\t\t\t\tthis._waitForInlineCompletions = undefined;\n\t\t\t}\n\t\t\tif (this._triggerState !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!doTrigger) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst currentModel = this._editor.getModel();\n\t\t\tconst currentPosition = this._editor.getPosition();\n\t\t\tif (currentModel === initialModel\n\t\t\t\t&& currentModel.getVersionId() === initialModelVersion\n\t\t\t\t&& currentPosition?.equals(initialPosition)\n\t\t\t\t&& this._editor.hasWidgetFocus()\n\t\t\t) {\n\t\t\t\tthis.trigger({ auto: true });\n\t\t\t}\n\t\t};\n\n\t\t// Reading `inlineController.model` first in a single autorun binds the\n\t\t// wait to the model's lifetime: nested autoruns would have no defined\n\t\t// run order, so an inner state-watcher could fire on a disposed model\n\t\t// before the outer model-watcher cleaned it up.\n\t\tdisposableTimeout(() => {\n\t\t\ttriggerAndCleanUp(true);\n\t\t\tinlineModel.stop('automatic');\n\t\t}, 750, store);\n\n\t\tregisterAutorunSelfDisposable(store, reader => {\n\t\t\tconst currentInlineModel = inlineController.model.read(reader);\n\t\t\tif (currentInlineModel !== inlineModel) {\n\t\t\t\treader.dispose();\n\t\t\t\ttriggerAndCleanUp(false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst status = inlineModel.status.read(reader);\n\t\t\tconst currentState = inlineModel.state.read(reader);\n\t\t\tif (!currentState && status === 'loading') {\n\t\t\t\t// Still loading\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treader.dispose();\n\t\t\ttriggerAndCleanUp(!currentState);\n\t\t});\n\t}\n\n\tprivate _refilterCompletionItems(): void {\n\t\tassertType(this._editor.hasModel());\n\t\tassertType(this._triggerState !== undefined);\n\n\t\tconst model = this._editor.getModel();\n\t\tconst position = this._editor.getPosition();\n\t\tconst ctx = new LineContext(model, position, { ...this._triggerState, refilter: true });\n\t\tthis._onNewContext(ctx);\n\t}\n\n\ttrigger(options: SuggestTriggerOptions): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst ctx = new LineContext(model, this._editor.getPosition(), options);\n\n\t\t// Cancel previous requests, change state & update UI\n\t\tthis.cancel(options.retrigger);\n\t\tthis._triggerState = options;\n\t\tthis._onDidTrigger.fire({ auto: options.auto, shy: options.shy ?? false, position: this._editor.getPosition() });\n\n\t\t// Capture context when request was sent\n\t\tthis._context = ctx;\n\n\t\t// Build context for request\n\t\tlet suggestCtx: CompletionContext = { triggerKind: options.triggerKind ?? CompletionTriggerKind.Invoke };\n\t\tif (options.triggerCharacter) {\n\t\t\tsuggestCtx = {\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\ttriggerCharacter: options.triggerCharacter\n\t\t\t};\n\t\t}\n\n\t\tthis._requestToken = new CancellationTokenSource();\n\n\t\t// kind filter and snippet sort rules\n\t\tconst snippetSuggestions = this._editor.getOption(EditorOption.snippetSuggestions);\n\t\tlet snippetSortOrder = SnippetSortOrder.Inline;\n\t\tswitch (snippetSuggestions) {\n\t\t\tcase 'top':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Top;\n\t\t\t\tbreak;\n\t\t\t// \t↓ that's the default anyways...\n\t\t\t// case 'inline':\n\t\t\t// \tsnippetSortOrder = SnippetSortOrder.Inline;\n\t\t\t// \tbreak;\n\t\t\tcase 'bottom':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Bottom;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst { itemKind: itemKindFilter, showDeprecated } = SuggestModel.createSuggestFilter(this._editor);\n\t\tconst completionOptions = new CompletionOptions(snippetSortOrder, options.completionOptions?.kindFilter ?? itemKindFilter, options.completionOptions?.providerFilter, options.completionOptions?.providerItemsToReuse, showDeprecated);\n\t\tconst wordDistance = WordDistance.create(this._editorWorkerService, this._editor);\n\n\t\tconst completions = provideSuggestionItems(\n\t\t\tthis._languageFeaturesService.completionProvider,\n\t\t\tmodel,\n\t\t\tthis._editor.getPosition(),\n\t\t\tcompletionOptions,\n\t\t\tsuggestCtx,\n\t\t\tthis._requestToken.token\n\t\t);\n\n\t\tPromise.all([completions, wordDistance]).then(async ([completions, wordDistance]) => {\n\n\t\t\tthis._requestToken?.dispose();\n\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\tcompletions.disposable.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet clipboardText = options?.clipboardText;\n\t\t\tif (!clipboardText && completions.needsClipboard) {\n\t\t\t\tclipboardText = await this._clipboardService.readText();\n\t\t\t}\n\n\t\t\tif (this._triggerState === undefined) {\n\t\t\t\tcompletions.disposable.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst model = this._editor.getModel();\n\t\t\t// const items = completions.items;\n\n\t\t\t// if (existing) {\n\t\t\t// \tconst cmpFn = getSuggestionComparator(snippetSortOrder);\n\t\t\t// \titems = items.concat(existing.items).sort(cmpFn);\n\t\t\t// }\n\n\t\t\tconst ctx = new LineContext(model, this._editor.getPosition(), options);\n\t\t\tconst fuzzySearchOptions = {\n\t\t\t\t...FuzzyScoreOptions.default,\n\t\t\t\tfirstMatchCanBeWeak: !this._editor.getOption(EditorOption.suggest).matchOnWordStartOnly\n\t\t\t};\n\t\t\tthis._completionModel = new CompletionModel(completions.items, this._context!.column, {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context!.column\n\t\t\t},\n\t\t\t\twordDistance,\n\t\t\t\tthis._editor.getOption(EditorOption.suggest),\n\t\t\t\tthis._editor.getOption(EditorOption.snippetSuggestions),\n\t\t\t\tfuzzySearchOptions,\n\t\t\t\tclipboardText\n\t\t\t);\n\n\t\t\t// store containers so that they can be disposed later\n\t\t\tthis._completionDisposables.add(completions.disposable);\n\n\t\t\tthis._onNewContext(ctx);\n\n\t\t\t// finally report telemetry about durations\n\t\t\tthis._reportDurationsTelemetry(completions.durations);\n\n\t\t\t// report invalid completions by source\n\t\t\tif (!this._envService.isBuilt || this._envService.isExtensionDevelopment) {\n\t\t\t\tfor (const item of completions.items) {\n\t\t\t\t\tif (item.isInvalid) {\n\t\t\t\t\t\tthis._logService.warn(`[suggest] did IGNORE invalid completion item from ${item.provider._debugDisplayName}`, item.completion);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}).catch(onUnexpectedError);\n\t}\n\n\t/**\n\t * Report durations telemetry with a 1% sampling rate.\n\t * The telemetry is reported only if a random number between 0 and 100 is less than or equal to 1.\n\t */\n\tprivate _reportDurationsTelemetry(durations: CompletionDurations): void {\n\t\tif (Math.random() > 0.0001) { // 0.01%\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\ttype Durations = { data: string };\n\t\t\ttype DurationsClassification = {\n\t\t\t\towner: 'jrieken';\n\t\t\t\tcomment: 'Completions performance numbers';\n\t\t\t\tdata: { comment: 'Durations per source and overall'; classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth' };\n\t\t\t};\n\t\t\tthis._telemetryService.publicLog2<Durations, DurationsClassification>('suggest.durations.json', { data: JSON.stringify(durations) });\n\t\t\tthis._logService.debug('suggest.durations.json', durations);\n\t\t});\n\t}\n\n\tstatic createSuggestFilter(editor: ICodeEditor): { itemKind: Set<CompletionItemKind>; showDeprecated: boolean } {\n\t\t// kind filter and snippet sort rules\n\t\tconst result = new Set<CompletionItemKind>();\n\n\t\t// snippet setting\n\t\tconst snippetSuggestions = editor.getOption(EditorOption.snippetSuggestions);\n\t\tif (snippetSuggestions === 'none') {\n\t\t\tresult.add(CompletionItemKind.Snippet);\n\t\t}\n\n\t\t// type setting\n\t\tconst suggestOptions = editor.getOption(EditorOption.suggest);\n\t\tif (!suggestOptions.showMethods) { result.add(CompletionItemKind.Method); }\n\t\tif (!suggestOptions.showFunctions) { result.add(CompletionItemKind.Function); }\n\t\tif (!suggestOptions.showConstructors) { result.add(CompletionItemKind.Constructor); }\n\t\tif (!suggestOptions.showFields) { result.add(CompletionItemKind.Field); }\n\t\tif (!suggestOptions.showVariables) { result.add(CompletionItemKind.Variable); }\n\t\tif (!suggestOptions.showClasses) { result.add(CompletionItemKind.Class); }\n\t\tif (!suggestOptions.showStructs) { result.add(CompletionItemKind.Struct); }\n\t\tif (!suggestOptions.showInterfaces) { result.add(CompletionItemKind.Interface); }\n\t\tif (!suggestOptions.showModules) { result.add(CompletionItemKind.Module); }\n\t\tif (!suggestOptions.showProperties) { result.add(CompletionItemKind.Property); }\n\t\tif (!suggestOptions.showEvents) { result.add(CompletionItemKind.Event); }\n\t\tif (!suggestOptions.showOperators) { result.add(CompletionItemKind.Operator); }\n\t\tif (!suggestOptions.showUnits) { result.add(CompletionItemKind.Unit); }\n\t\tif (!suggestOptions.showValues) { result.add(CompletionItemKind.Value); }\n\t\tif (!suggestOptions.showConstants) { result.add(CompletionItemKind.Constant); }\n\t\tif (!suggestOptions.showEnums) { result.add(CompletionItemKind.Enum); }\n\t\tif (!suggestOptions.showEnumMembers) { result.add(CompletionItemKind.EnumMember); }\n\t\tif (!suggestOptions.showKeywords) { result.add(CompletionItemKind.Keyword); }\n\t\tif (!suggestOptions.showWords) { result.add(CompletionItemKind.Text); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Color); }\n\t\tif (!suggestOptions.showFiles) { result.add(CompletionItemKind.File); }\n\t\tif (!suggestOptions.showReferences) { result.add(CompletionItemKind.Reference); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Customcolor); }\n\t\tif (!suggestOptions.showFolders) { result.add(CompletionItemKind.Folder); }\n\t\tif (!suggestOptions.showTypeParameters) { result.add(CompletionItemKind.TypeParameter); }\n\t\tif (!suggestOptions.showSnippets) { result.add(CompletionItemKind.Snippet); }\n\t\tif (!suggestOptions.showUsers) { result.add(CompletionItemKind.User); }\n\t\tif (!suggestOptions.showIssues) { result.add(CompletionItemKind.Issue); }\n\n\t\treturn { itemKind: result, showDeprecated: suggestOptions.showDeprecated };\n\t}\n\n\tprivate _onNewContext(ctx: LineContext): void {\n\n\t\tif (!this._context) {\n\t\t\t// happens when 24x7 IntelliSense is enabled and still in its delay\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.lineNumber !== this._context.lineNumber) {\n\t\t\t// e.g. happens when pressing Enter while IntelliSense is computed\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (getLeadingWhitespace(ctx.leadingLineContent) !== getLeadingWhitespace(this._context.leadingLineContent)) {\n\t\t\t// cancel IntelliSense when line start changes\n\t\t\t// happens when the current word gets outdented\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column < this._context.column) {\n\t\t\t// typed -> moved cursor LEFT -> retrigger if still on a word\n\t\t\tif (ctx.leadingWord.word) {\n\t\t\t\tthis.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });\n\t\t\t} else {\n\t\t\t\tthis.cancel();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._completionModel) {\n\t\t\t// happens when IntelliSense is not yet computed\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.leadingWord.word.length !== 0 && ctx.leadingWord.startColumn > this._context.leadingWord.startColumn) {\n\t\t\t// started a new word while IntelliSense shows -> retrigger but reuse all items that we currently have\n\t\t\tconst shouldAutoTrigger = LineContext.shouldAutoTrigger(this._editor);\n\t\t\tif (shouldAutoTrigger && this._context) {\n\t\t\t\t// shouldAutoTrigger forces tokenization, which can cause pending cursor change events to be emitted, which can cause\n\t\t\t\t// suggestions to be cancelled, which causes `this._context` to be undefined\n\t\t\t\tconst map = this._completionModel.getItemsByProvider();\n\t\t\t\tthis.trigger({\n\t\t\t\t\tauto: this._context.triggerOptions.auto,\n\t\t\t\t\tretrigger: true,\n\t\t\t\t\tclipboardText: this._completionModel.clipboardText,\n\t\t\t\t\tcompletionOptions: { providerItemsToReuse: map }\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column > this._context.column && this._completionModel.getIncompleteProvider().size > 0 && ctx.leadingWord.word.length !== 0) {\n\t\t\t// typed -> moved cursor RIGHT & incomple model & still on a word -> retrigger\n\n\t\t\tconst providerItemsToReuse = new Map<CompletionItemProvider, CompletionItem[]>();\n\t\t\tconst providerFilter = new Set<CompletionItemProvider>();\n\t\t\tfor (const [provider, items] of this._completionModel.getItemsByProvider()) {\n\t\t\t\tif (items.length > 0 && items[0].container.incomplete) {\n\t\t\t\t\tproviderFilter.add(provider);\n\t\t\t\t} else {\n\t\t\t\t\tproviderItemsToReuse.set(provider, items);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.trigger({\n\t\t\t\tauto: this._context.triggerOptions.auto,\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerForIncompleteCompletions,\n\t\t\t\tretrigger: true,\n\t\t\t\tclipboardText: this._completionModel.clipboardText,\n\t\t\t\tcompletionOptions: { providerFilter, providerItemsToReuse }\n\t\t\t});\n\n\t\t} else {\n\t\t\t// typed -> moved cursor RIGHT -> update UI\n\t\t\tconst oldLineContext = this._completionModel.lineContext;\n\t\t\tlet isFrozen = false;\n\n\t\t\tthis._completionModel.lineContext = {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context.column\n\t\t\t};\n\n\t\t\tif (this._completionModel.items.length === 0) {\n\n\t\t\t\tconst shouldAutoTrigger = LineContext.shouldAutoTrigger(this._editor);\n\t\t\t\tif (!this._context) {\n\t\t\t\t\t// shouldAutoTrigger forces tokenization, which can cause pending cursor change events to be emitted, which can cause\n\t\t\t\t\t// suggestions to be cancelled, which causes `this._context` to be undefined\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (shouldAutoTrigger && this._context.leadingWord.endColumn < ctx.leadingWord.startColumn) {\n\t\t\t\t\t// retrigger when heading into a new word\n\t\t\t\t\tthis.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!this._context.triggerOptions.auto) {\n\t\t\t\t\t// freeze when IntelliSense was manually requested\n\t\t\t\t\tthis._completionModel.lineContext = oldLineContext;\n\t\t\t\t\tisFrozen = this._completionModel.items.length > 0;\n\n\t\t\t\t\tif (isFrozen && ctx.leadingWord.word.length === 0) {\n\t\t\t\t\t\t// there were results before but now there aren't\n\t\t\t\t\t\t// and also we are not on a word anymore -> cancel\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t// nothing left\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidSuggest.fire({\n\t\t\t\tcompletionModel: this._completionModel,\n\t\t\t\ttriggerOptions: ctx.triggerOptions,\n\t\t\t\tisFrozen,\n\t\t\t});\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/suggest/browser/suggestModel.ts","vs/editor/contrib/suggest/browser/suggestModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAS,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAe,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;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ceRoot":"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 { disposableTimeout, TimeoutTimer } from '../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { FuzzyScoreOptions } from '../../../../base/common/filters.js';\nimport { DisposableStore, dispose, IDisposable } from '../../../../base/common/lifecycle.js';\nimport { registerAutorunSelfDisposable } from '../../../../base/common/observable.js';\nimport { getLeadingWhitespace, isHighSurrogate, isLowSurrogate } from '../../../../base/common/strings.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IEnvironmentService } from '../../../../platform/environment/common/environment.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { IWordAtPosition } from '../../../common/core/wordHelper.js';\nimport { CursorChangeReason, ICursorSelectionChangedEvent } from '../../../common/cursorEvents.js';\nimport { CompletionContext, CompletionItemKind, CompletionItemProvider, CompletionTriggerKind } from '../../../common/languages.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { IEditorWorkerService } from '../../../common/services/editorWorker.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getInlineCompletionsController } from '../../inlineCompletions/browser/controller/common.js';\nimport { InlineCompletionContextKeys } from '../../inlineCompletions/browser/controller/inlineCompletionContextKeys.js';\nimport { SnippetController2 } from '../../snippet/browser/snippetController2.js';\nimport { CompletionModel } from './completionModel.js';\nimport { CompletionDurations, CompletionItem, CompletionOptions, getSnippetSuggestSupport, provideSuggestionItems, QuickSuggestionsOptions, SnippetSortOrder } from './suggest.js';\nimport { WordDistance } from './wordDistance.js';\n\nexport interface ICancelEvent {\n\treadonly retrigger: boolean;\n}\n\nexport interface ITriggerEvent {\n\treadonly auto: boolean;\n\treadonly shy: boolean;\n\treadonly position: IPosition;\n}\n\nexport interface ISuggestEvent {\n\treadonly completionModel: CompletionModel;\n\treadonly isFrozen: boolean;\n\treadonly triggerOptions: SuggestTriggerOptions;\n}\n\nexport interface SuggestTriggerOptions {\n\treadonly auto: boolean;\n\treadonly shy?: boolean;\n\treadonly refilter?: boolean;\n\treadonly retrigger?: boolean;\n\treadonly triggerKind?: CompletionTriggerKind;\n\treadonly triggerCharacter?: string;\n\treadonly clipboardText?: string;\n\tcompletionOptions?: Partial<CompletionOptions>;\n}\n\nexport class LineContext {\n\n\tstatic shouldAutoTrigger(editor: ICodeEditor): boolean {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tconst pos = editor.getPosition();\n\t\tmodel.tokenization.tokenizeIfCheap(pos.lineNumber);\n\n\t\tconst word = model.getWordAtPosition(pos);\n\t\tif (!word) {\n\t\t\treturn false;\n\t\t}\n\t\tif (word.endColumn !== pos.column &&\n\t\t\tword.startColumn + 1 !== pos.column /* after typing a single character before a word */) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!isNaN(Number(word.word))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\treadonly lineNumber: number;\n\treadonly column: number;\n\treadonly leadingLineContent: string;\n\treadonly leadingWord: IWordAtPosition;\n\treadonly triggerOptions: SuggestTriggerOptions;\n\n\tconstructor(model: ITextModel, position: Position, triggerOptions: SuggestTriggerOptions) {\n\t\tthis.leadingLineContent = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\tthis.leadingWord = model.getWordUntilPosition(position);\n\t\tthis.lineNumber = position.lineNumber;\n\t\tthis.column = position.column;\n\t\tthis.triggerOptions = triggerOptions;\n\t}\n}\n\nexport const enum State {\n\tIdle = 0,\n\tManual = 1,\n\tAuto = 2\n}\n\nfunction canShowQuickSuggest(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue(InlineCompletionContextKeys.inlineSuggestionVisible.key))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\tconst suppressSuggestions = contextKeyService.getContextKeyValue<boolean | undefined>(InlineCompletionContextKeys.suppressSuggestions.key);\n\tif (suppressSuggestions !== undefined) {\n\t\treturn !suppressSuggestions;\n\t}\n\treturn !editor.getOption(EditorOption.inlineSuggest).suppressSuggestions;\n}\n\nfunction canShowSuggestOnTriggerCharacters(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue('inlineSuggestionVisible'))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\tconst suppressSuggestions = contextKeyService.getContextKeyValue<boolean | undefined>(InlineCompletionContextKeys.suppressSuggestions.key);\n\tif (suppressSuggestions !== undefined) {\n\t\treturn !suppressSuggestions;\n\t}\n\treturn !editor.getOption(EditorOption.inlineSuggest).suppressSuggestions;\n}\n\nexport class SuggestModel implements IDisposable {\n\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _triggerCharacterListener = new DisposableStore();\n\tprivate readonly _supportsByTriggerCharacter = new Map<string, Set<CompletionItemProvider>>();\n\tprivate readonly _triggerQuickSuggest = new TimeoutTimer();\n\tprivate _waitForInlineCompletions: DisposableStore | undefined;\n\n\tprivate _triggerState: SuggestTriggerOptions | undefined = undefined;\n\tprivate _requestToken?: CancellationTokenSource;\n\tprivate _context?: LineContext;\n\tprivate _currentSelection: Selection;\n\n\t/**\n\t * Where automatic suggestions last closed because nothing matched what was typed: the line,\n\t * and the line content before that text. With `editor.suggest.reopenOnDelete`, Backspace\n\t * brings them back while the cursor stays in that text.\n\t */\n\tprivate _closedWithoutMatch: { readonly lineNumber: number; readonly prefix: string } | undefined;\n\n\tprivate _completionModel: CompletionModel | undefined;\n\tprivate readonly _completionDisposables = new DisposableStore();\n\tprivate readonly _onDidCancel = new Emitter<ICancelEvent>();\n\tprivate readonly _onDidTrigger = new Emitter<ITriggerEvent>();\n\tprivate readonly _onDidSuggest = new Emitter<ISuggestEvent>();\n\n\treadonly onDidCancel: Event<ICancelEvent> = this._onDidCancel.event;\n\treadonly onDidTrigger: Event<ITriggerEvent> = this._onDidTrigger.event;\n\treadonly onDidSuggest: Event<ISuggestEvent> = this._onDidSuggest.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@ITelemetryService private readonly _telemetryService: ITelemetryService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEnvironmentService private readonly _envService: IEnvironmentService,\n\t) {\n\t\tthis._currentSelection = this._editor.getSelection() || new Selection(1, 1, 1, 1);\n\n\t\t// wire up various listeners\n\t\tthis._toDispose.add(this._editor.onDidChangeModel(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelLanguage(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeConfiguration(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t}));\n\t\tthis._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis._updateActiveSuggestSession();\n\t\t}));\n\n\t\tlet editorIsComposing = false;\n\t\tthis._toDispose.add(this._editor.onDidCompositionStart(() => {\n\t\t\teditorIsComposing = true;\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidCompositionEnd(() => {\n\t\t\teditorIsComposing = false;\n\t\t\tthis._onCompositionEnd();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorSelection(e => {\n\t\t\t// only trigger suggest when the editor isn't composing a character\n\t\t\tif (!editorIsComposing) {\n\t\t\t\tthis._onCursorChange(e);\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\t// only filter completions when the editor isn't composing a character\n\t\t\t// allow-any-unicode-next-line\n\t\t\t// e.g. ¨ + u makes ü but just ¨ cannot be used for filtering\n\t\t\tif (!editorIsComposing && this._triggerState !== undefined) {\n\t\t\t\tthis._refilterCompletionItems(true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._updateTriggerCharacters();\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._triggerCharacterListener);\n\t\tdispose([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]);\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._toDispose.dispose();\n\t\tthis._completionDisposables.dispose();\n\t\tthis.cancel();\n\t}\n\n\tprivate _updateTriggerCharacters(): void {\n\t\tthis._triggerCharacterListener.clear();\n\t\tthis._supportsByTriggerCharacter.clear();\n\n\t\tif (this._editor.getOption(EditorOption.readOnly)\n\t\t\t|| !this._editor.hasModel()\n\t\t\t|| !this._editor.getOption(EditorOption.suggestOnTriggerCharacters)) {\n\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const support of this._languageFeaturesService.completionProvider.all(this._editor.getModel())) {\n\t\t\tfor (const ch of support.triggerCharacters || []) {\n\t\t\t\tlet set = this._supportsByTriggerCharacter.get(ch);\n\t\t\t\tif (!set) {\n\t\t\t\t\tset = new Set();\n\t\t\t\t\tconst suggestSupport = getSnippetSuggestSupport();\n\t\t\t\t\tif (suggestSupport) {\n\t\t\t\t\t\tset.add(suggestSupport);\n\t\t\t\t\t}\n\t\t\t\t\tthis._supportsByTriggerCharacter.set(ch, set);\n\t\t\t\t}\n\t\t\t\tset.add(support);\n\t\t\t}\n\t\t}\n\n\n\t\tconst checkTriggerCharacter = (text?: string) => {\n\n\t\t\tif (!canShowSuggestOnTriggerCharacters(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\t// don't trigger by trigger characters when this is a case for quick suggest\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!text) {\n\t\t\t\t// came here from the compositionEnd-event\n\t\t\t\tconst position = this._editor.getPosition()!;\n\t\t\t\tconst model = this._editor.getModel()!;\n\t\t\t\ttext = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\t\t}\n\n\t\t\tthis._triggerOnLastCharacter(text);\n\t\t};\n\n\t\tthis._triggerCharacterListener.add(this._editor.onDidType(checkTriggerCharacter));\n\t\tthis._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => checkTriggerCharacter()));\n\t}\n\n\t/**\n\t * Triggers the providers of the last character of the given text, as typing that character\n\t * does. Returns `false` when it isn't a trigger character.\n\t */\n\tprivate _triggerOnLastCharacter(text: string): boolean {\n\t\tlet lastChar = '';\n\t\tif (isLowSurrogate(text.charCodeAt(text.length - 1))) {\n\t\t\tif (isHighSurrogate(text.charCodeAt(text.length - 2))) {\n\t\t\t\tlastChar = text.substr(text.length - 2);\n\t\t\t}\n\t\t} else {\n\t\t\tlastChar = text.charAt(text.length - 1);\n\t\t}\n\n\t\tconst supports = this._supportsByTriggerCharacter.get(lastChar);\n\t\tif (supports) {\n\n\t\t\t// keep existing items that where not computed by the\n\t\t\t// supports/providers that want to trigger now\n\t\t\tconst providerItemsToReuse = new Map<CompletionItemProvider, CompletionItem[]>();\n\t\t\tif (this._completionModel) {\n\t\t\t\tfor (const [provider, items] of this._completionModel.getItemsByProvider()) {\n\t\t\t\t\tif (!supports.has(provider)) {\n\t\t\t\t\t\tproviderItemsToReuse.set(provider, items);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.trigger({\n\t\t\t\tauto: true,\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\ttriggerCharacter: lastChar,\n\t\t\t\tretrigger: Boolean(this._completionModel),\n\t\t\t\tclipboardText: this._completionModel?.clipboardText,\n\t\t\t\tcompletionOptions: { providerFilter: supports, providerItemsToReuse }\n\t\t\t});\n\t\t}\n\t\treturn Boolean(supports);\n\t}\n\n\t// --- trigger/retrigger/cancel suggest\n\n\tget state(): State {\n\t\tif (!this._triggerState) {\n\t\t\treturn State.Idle;\n\t\t} else if (!this._triggerState.auto) {\n\t\t\treturn State.Manual;\n\t\t} else {\n\t\t\treturn State.Auto;\n\t\t}\n\t}\n\n\tcancel(retrigger: boolean = false): void {\n\t\tthis._triggerQuickSuggest.cancel();\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._waitForInlineCompletions = undefined;\n\t\tthis._closedWithoutMatch = undefined;\n\n\t\tif (this._triggerState !== undefined) {\n\t\t\tthis._requestToken?.cancel();\n\t\t\tthis._requestToken = undefined;\n\t\t\tthis._triggerState = undefined;\n\t\t\tthis._completionModel = undefined;\n\t\t\tthis._context = undefined;\n\t\t\tthis._onDidCancel.fire({ retrigger });\n\t\t}\n\t}\n\n\tclear() {\n\t\tthis._completionDisposables.clear();\n\t}\n\n\tprivate _updateActiveSuggestSession(): void {\n\t\tif (this._triggerState !== undefined) {\n\t\t\tif (!this._editor.hasModel() || !this._languageFeaturesService.completionProvider.has(this._editor.getModel())) {\n\t\t\t\tthis.cancel();\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: this._triggerState.auto, retrigger: true });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _onCursorChange(e: ICursorSelectionChangedEvent): void {\n\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevSelection = this._currentSelection;\n\t\tthis._currentSelection = this._editor.getSelection();\n\n\t\tif (!e.selection.isEmpty()\n\t\t\t|| (e.reason !== CursorChangeReason.NotSet && e.reason !== CursorChangeReason.Explicit)\n\t\t\t|| (e.source !== 'keyboard' && e.source !== 'deleteLeft')\n\t\t) {\n\t\t\t// Early exit if nothing needs to be done!\n\t\t\t// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (this._triggerState === undefined && e.reason === CursorChangeReason.NotSet) {\n\t\t\tif (prevSelection.containsRange(this._currentSelection) || prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) {\n\t\t\t\t// cursor did move RIGHT due to typing -> trigger quick suggest\n\t\t\t\tthis._doTriggerQuickSuggest();\n\t\t\t} else if (e.source === 'deleteLeft') {\n\t\t\t\t// cursor did move LEFT due to Backspace -> bring back suggestions that closed because nothing matched\n\t\t\t\tthis._reopenAfterDelete();\n\t\t\t}\n\n\t\t} else if (this._triggerState !== undefined && e.reason === CursorChangeReason.Explicit) {\n\t\t\t// suggest is active and something like cursor keys are used to move\n\t\t\t// the cursor. this means we can refilter at the new position\n\t\t\tthis._refilterCompletionItems();\n\n\t\t} else if (e.reason === CursorChangeReason.Explicit) {\n\t\t\t// suggest is inactive and the cursor moved away from where it closed\n\t\t\tthis._closedWithoutMatch = undefined;\n\t\t}\n\t}\n\n\tprivate _onCompositionEnd(): void {\n\t\t// trigger or refilter when composition ends\n\t\tif (this._triggerState === undefined) {\n\t\t\tthis._doTriggerQuickSuggest();\n\t\t} else {\n\t\t\tthis._refilterCompletionItems();\n\t\t}\n\t}\n\n\t/**\n\t * Brings back automatic suggestions that closed because nothing matched what was typed,\n\t * when Backspace keeps the cursor in that text. It does what Backspace does while they show.\n\t */\n\tprivate _reopenAfterDelete(): void {\n\t\tconst closed = this._closedWithoutMatch;\n\t\tthis._closedWithoutMatch = undefined;\n\t\tif (!closed || !this._editor.hasModel() || !this._editor.getOption(EditorOption.suggest).reopenOnDelete) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst ctx = new LineContext(this._editor.getModel(), this._editor.getPosition(), { auto: true });\n\t\tconst text = ctx.leadingLineContent.slice(closed.prefix.length);\n\t\tif (ctx.lineNumber !== closed.lineNumber || !ctx.leadingLineContent.startsWith(closed.prefix) || !text || /\\s/.test(text)) {\n\t\t\t// deleted all of that text, or typed past it\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ctx.leadingWord.word) {\n\t\t\tthis._reopenOnTriggerCharacter(ctx);\n\t\t} else if (canShowQuickSuggest(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\tthis.trigger({ auto: true });\n\t\t}\n\t}\n\n\t/**\n\t * With `editor.suggest.reopenOnDelete`, triggers the providers of the trigger character\n\t * before the cursor, as typing it does. Returns `false` when it doesn't.\n\t */\n\tprivate _reopenOnTriggerCharacter(ctx: LineContext): boolean {\n\t\treturn this._editor.getOption(EditorOption.suggest).reopenOnDelete\n\t\t\t&& canShowSuggestOnTriggerCharacters(this._editor, this._contextKeyService, this._configurationService)\n\t\t\t&& this._triggerOnLastCharacter(ctx.leadingLineContent);\n\t}\n\n\tprivate _doTriggerQuickSuggest(): void {\n\n\t\tif (QuickSuggestionsOptions.isAllOff(this._editor.getOption(EditorOption.quickSuggestions))) {\n\t\t\t// not enabled\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._editor.getOption(EditorOption.suggest).snippetsPreventQuickSuggestions && SnippetController2.get(this._editor)?.isInSnippet()) {\n\t\t\t// no quick suggestion when in snippet mode\n\t\t\treturn;\n\t\t}\n\n\t\tthis.cancel();\n\n\t\t// Cancel any in-flight wait for inline completions from a previous cycle\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._waitForInlineCompletions = undefined;\n\n\t\tthis._triggerQuickSuggest.cancelAndSet(() => {\n\t\t\tif (this._triggerState !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = this._editor.getModel();\n\t\t\tconst pos = this._editor.getPosition();\n\t\t\t// validate enabled now\n\t\t\tconst config = this._editor.getOption(EditorOption.quickSuggestions);\n\t\t\tif (QuickSuggestionsOptions.isAllOff(config)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet waitForInlineCompletions = false;\n\t\t\tif (!QuickSuggestionsOptions.isAllOn(config)) {\n\t\t\t\t// Check the type of the token that triggered this\n\t\t\t\tmodel.tokenization.tokenizeIfCheap(pos.lineNumber);\n\t\t\t\tconst lineTokens = model.tokenization.getLineTokens(pos.lineNumber);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(pos.column - 1 - 1, 0)));\n\t\t\t\tconst value = QuickSuggestionsOptions.valueFor(config, tokenType);\n\t\t\t\tif (value === 'off' || value === 'inline') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (value === 'offWhenInlineCompletions') {\n\t\t\t\t\twaitForInlineCompletions = this._languageFeaturesService.inlineCompletionsProvider.has(model)\n\t\t\t\t\t\t&& this._editor.getOption(EditorOption.inlineSuggest).enabled;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!canShowQuickSuggest(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\t// do not trigger quick suggestions if inline suggestions are shown\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this._languageFeaturesService.completionProvider.has(model)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (waitForInlineCompletions) {\n\t\t\t\t// Wait for inline completions to resolve before deciding\n\t\t\t\tthis._waitForInlineCompletionsAndTrigger(model, pos);\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: true });\n\t\t\t}\n\n\t\t}, this._editor.getOption(EditorOption.quickSuggestionsDelay));\n\t}\n\n\tprivate _waitForInlineCompletionsAndTrigger(initialModel: ITextModel, initialPosition: Position): void {\n\t\tconst initialModelVersion = initialModel.getVersionId();\n\t\tconst inlineController = getInlineCompletionsController(this._editor);\n\t\tconst inlineModel = inlineController?.model.get();\n\t\tif (!inlineController || !inlineModel) {\n\t\t\tthis.trigger({ auto: true });\n\t\t\treturn;\n\t\t}\n\n\t\tconst state = inlineModel.state.get();\n\t\tif (state?.inlineSuggestion) {\n\t\t\t// Inline completions are already showing - suppress\n\t\t\treturn;\n\t\t}\n\n\t\tconst store = new DisposableStore();\n\t\tthis._waitForInlineCompletions = store;\n\n\t\tconst triggerAndCleanUp = (doTrigger: boolean) => {\n\t\t\tstore.dispose();\n\t\t\tif (this._waitForInlineCompletions === store) {\n\t\t\t\tthis._waitForInlineCompletions = undefined;\n\t\t\t}\n\t\t\tif (this._triggerState !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!doTrigger) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst currentModel = this._editor.getModel();\n\t\t\tconst currentPosition = this._editor.getPosition();\n\t\t\tif (currentModel === initialModel\n\t\t\t\t&& currentModel.getVersionId() === initialModelVersion\n\t\t\t\t&& currentPosition?.equals(initialPosition)\n\t\t\t\t&& this._editor.hasWidgetFocus()\n\t\t\t) {\n\t\t\t\tthis.trigger({ auto: true });\n\t\t\t}\n\t\t};\n\n\t\t// Reading `inlineController.model` first in a single autorun binds the\n\t\t// wait to the model's lifetime: nested autoruns would have no defined\n\t\t// run order, so an inner state-watcher could fire on a disposed model\n\t\t// before the outer model-watcher cleaned it up.\n\t\tdisposableTimeout(() => {\n\t\t\ttriggerAndCleanUp(true);\n\t\t\tinlineModel.stop('automatic');\n\t\t}, 750, store);\n\n\t\tregisterAutorunSelfDisposable(store, reader => {\n\t\t\tconst currentInlineModel = inlineController.model.read(reader);\n\t\t\tif (currentInlineModel !== inlineModel) {\n\t\t\t\treader.dispose();\n\t\t\t\ttriggerAndCleanUp(false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst status = inlineModel.status.read(reader);\n\t\t\tconst currentState = inlineModel.state.read(reader);\n\t\t\tif (!currentState && status === 'loading') {\n\t\t\t\t// Still loading\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treader.dispose();\n\t\t\ttriggerAndCleanUp(!currentState);\n\t\t});\n\t}\n\n\tprivate _refilterCompletionItems(contentChanged = false): void {\n\t\tassertType(this._editor.hasModel());\n\t\tassertType(this._triggerState !== undefined);\n\n\t\tconst model = this._editor.getModel();\n\t\tconst position = this._editor.getPosition();\n\t\tconst ctx = new LineContext(model, position, { ...this._triggerState, refilter: true });\n\t\tthis._onNewContext(ctx, contentChanged);\n\t}\n\n\ttrigger(options: SuggestTriggerOptions): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst ctx = new LineContext(model, this._editor.getPosition(), options);\n\n\t\t// Cancel previous requests, change state & update UI\n\t\tthis.cancel(options.retrigger);\n\t\tthis._triggerState = options;\n\t\tthis._onDidTrigger.fire({ auto: options.auto, shy: options.shy ?? false, position: this._editor.getPosition() });\n\n\t\t// Capture context when request was sent\n\t\tthis._context = ctx;\n\n\t\t// Build context for request\n\t\tlet suggestCtx: CompletionContext = { triggerKind: options.triggerKind ?? CompletionTriggerKind.Invoke };\n\t\tif (options.triggerCharacter) {\n\t\t\tsuggestCtx = {\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\ttriggerCharacter: options.triggerCharacter\n\t\t\t};\n\t\t}\n\n\t\tthis._requestToken = new CancellationTokenSource();\n\n\t\t// kind filter and snippet sort rules\n\t\tconst snippetSuggestions = this._editor.getOption(EditorOption.snippetSuggestions);\n\t\tlet snippetSortOrder = SnippetSortOrder.Inline;\n\t\tswitch (snippetSuggestions) {\n\t\t\tcase 'top':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Top;\n\t\t\t\tbreak;\n\t\t\t// \t↓ that's the default anyways...\n\t\t\t// case 'inline':\n\t\t\t// \tsnippetSortOrder = SnippetSortOrder.Inline;\n\t\t\t// \tbreak;\n\t\t\tcase 'bottom':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Bottom;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst { itemKind: itemKindFilter, showDeprecated } = SuggestModel.createSuggestFilter(this._editor);\n\t\tconst completionOptions = new CompletionOptions(snippetSortOrder, options.completionOptions?.kindFilter ?? itemKindFilter, options.completionOptions?.providerFilter, options.completionOptions?.providerItemsToReuse, showDeprecated);\n\t\tconst wordDistance = WordDistance.create(this._editorWorkerService, this._editor);\n\n\t\tconst completions = provideSuggestionItems(\n\t\t\tthis._languageFeaturesService.completionProvider,\n\t\t\tmodel,\n\t\t\tthis._editor.getPosition(),\n\t\t\tcompletionOptions,\n\t\t\tsuggestCtx,\n\t\t\tthis._requestToken.token\n\t\t);\n\n\t\tPromise.all([completions, wordDistance]).then(async ([completions, wordDistance]) => {\n\n\t\t\tthis._requestToken?.dispose();\n\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\tcompletions.disposable.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet clipboardText = options?.clipboardText;\n\t\t\tif (!clipboardText && completions.needsClipboard) {\n\t\t\t\tclipboardText = await this._clipboardService.readText();\n\t\t\t}\n\n\t\t\tif (this._triggerState === undefined) {\n\t\t\t\tcompletions.disposable.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst model = this._editor.getModel();\n\t\t\t// const items = completions.items;\n\n\t\t\t// if (existing) {\n\t\t\t// \tconst cmpFn = getSuggestionComparator(snippetSortOrder);\n\t\t\t// \titems = items.concat(existing.items).sort(cmpFn);\n\t\t\t// }\n\n\t\t\tconst ctx = new LineContext(model, this._editor.getPosition(), options);\n\t\t\tconst fuzzySearchOptions = {\n\t\t\t\t...FuzzyScoreOptions.default,\n\t\t\t\tfirstMatchCanBeWeak: !this._editor.getOption(EditorOption.suggest).matchOnWordStartOnly\n\t\t\t};\n\t\t\tthis._completionModel = new CompletionModel(completions.items, this._context!.column, {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context!.column\n\t\t\t},\n\t\t\t\twordDistance,\n\t\t\t\tthis._editor.getOption(EditorOption.suggest),\n\t\t\t\tthis._editor.getOption(EditorOption.snippetSuggestions),\n\t\t\t\tfuzzySearchOptions,\n\t\t\t\tclipboardText\n\t\t\t);\n\n\t\t\t// store containers so that they can be disposed later\n\t\t\tthis._completionDisposables.add(completions.disposable);\n\n\t\t\tthis._onNewContext(ctx);\n\n\t\t\t// finally report telemetry about durations\n\t\t\tthis._reportDurationsTelemetry(completions.durations);\n\n\t\t\t// report invalid completions by source\n\t\t\tif (!this._envService.isBuilt || this._envService.isExtensionDevelopment) {\n\t\t\t\tfor (const item of completions.items) {\n\t\t\t\t\tif (item.isInvalid) {\n\t\t\t\t\t\tthis._logService.warn(`[suggest] did IGNORE invalid completion item from ${item.provider._debugDisplayName}`, item.completion);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}).catch(onUnexpectedError);\n\t}\n\n\t/**\n\t * Report durations telemetry with a 1% sampling rate.\n\t * The telemetry is reported only if a random number between 0 and 100 is less than or equal to 1.\n\t */\n\tprivate _reportDurationsTelemetry(durations: CompletionDurations): void {\n\t\tif (Math.random() > 0.0001) { // 0.01%\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\ttype Durations = { data: string };\n\t\t\ttype DurationsClassification = {\n\t\t\t\towner: 'jrieken';\n\t\t\t\tcomment: 'Completions performance numbers';\n\t\t\t\tdata: { comment: 'Durations per source and overall'; classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth' };\n\t\t\t};\n\t\t\tthis._telemetryService.publicLog2<Durations, DurationsClassification>('suggest.durations.json', { data: JSON.stringify(durations) });\n\t\t\tthis._logService.debug('suggest.durations.json', durations);\n\t\t});\n\t}\n\n\tstatic createSuggestFilter(editor: ICodeEditor): { itemKind: Set<CompletionItemKind>; showDeprecated: boolean } {\n\t\t// kind filter and snippet sort rules\n\t\tconst result = new Set<CompletionItemKind>();\n\n\t\t// snippet setting\n\t\tconst snippetSuggestions = editor.getOption(EditorOption.snippetSuggestions);\n\t\tif (snippetSuggestions === 'none') {\n\t\t\tresult.add(CompletionItemKind.Snippet);\n\t\t}\n\n\t\t// type setting\n\t\tconst suggestOptions = editor.getOption(EditorOption.suggest);\n\t\tif (!suggestOptions.showMethods) { result.add(CompletionItemKind.Method); }\n\t\tif (!suggestOptions.showFunctions) { result.add(CompletionItemKind.Function); }\n\t\tif (!suggestOptions.showConstructors) { result.add(CompletionItemKind.Constructor); }\n\t\tif (!suggestOptions.showFields) { result.add(CompletionItemKind.Field); }\n\t\tif (!suggestOptions.showVariables) { result.add(CompletionItemKind.Variable); }\n\t\tif (!suggestOptions.showClasses) { result.add(CompletionItemKind.Class); }\n\t\tif (!suggestOptions.showStructs) { result.add(CompletionItemKind.Struct); }\n\t\tif (!suggestOptions.showInterfaces) { result.add(CompletionItemKind.Interface); }\n\t\tif (!suggestOptions.showModules) { result.add(CompletionItemKind.Module); }\n\t\tif (!suggestOptions.showProperties) { result.add(CompletionItemKind.Property); }\n\t\tif (!suggestOptions.showEvents) { result.add(CompletionItemKind.Event); }\n\t\tif (!suggestOptions.showOperators) { result.add(CompletionItemKind.Operator); }\n\t\tif (!suggestOptions.showUnits) { result.add(CompletionItemKind.Unit); }\n\t\tif (!suggestOptions.showValues) { result.add(CompletionItemKind.Value); }\n\t\tif (!suggestOptions.showConstants) { result.add(CompletionItemKind.Constant); }\n\t\tif (!suggestOptions.showEnums) { result.add(CompletionItemKind.Enum); }\n\t\tif (!suggestOptions.showEnumMembers) { result.add(CompletionItemKind.EnumMember); }\n\t\tif (!suggestOptions.showKeywords) { result.add(CompletionItemKind.Keyword); }\n\t\tif (!suggestOptions.showWords) { result.add(CompletionItemKind.Text); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Color); }\n\t\tif (!suggestOptions.showFiles) { result.add(CompletionItemKind.File); }\n\t\tif (!suggestOptions.showReferences) { result.add(CompletionItemKind.Reference); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Customcolor); }\n\t\tif (!suggestOptions.showFolders) { result.add(CompletionItemKind.Folder); }\n\t\tif (!suggestOptions.showTypeParameters) { result.add(CompletionItemKind.TypeParameter); }\n\t\tif (!suggestOptions.showSnippets) { result.add(CompletionItemKind.Snippet); }\n\t\tif (!suggestOptions.showUsers) { result.add(CompletionItemKind.User); }\n\t\tif (!suggestOptions.showIssues) { result.add(CompletionItemKind.Issue); }\n\n\t\treturn { itemKind: result, showDeprecated: suggestOptions.showDeprecated };\n\t}\n\n\tprivate _onNewContext(ctx: LineContext, contentChanged = false): void {\n\n\t\tif (!this._context) {\n\t\t\t// happens when 24x7 IntelliSense is enabled and still in its delay\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.lineNumber !== this._context.lineNumber) {\n\t\t\t// e.g. happens when pressing Enter while IntelliSense is computed\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (getLeadingWhitespace(ctx.leadingLineContent) !== getLeadingWhitespace(this._context.leadingLineContent)) {\n\t\t\t// cancel IntelliSense when line start changes\n\t\t\t// happens when the current word gets outdented\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column < this._context.column) {\n\t\t\t// typed -> moved cursor LEFT -> retrigger if still on a word,\n\t\t\t// or if deleted back to a trigger character, as typing it does\n\t\t\tif (ctx.leadingWord.word) {\n\t\t\t\tthis.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });\n\t\t\t} else if (!contentChanged || !this._reopenOnTriggerCharacter(ctx)) {\n\t\t\t\tthis.cancel();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._completionModel) {\n\t\t\t// happens when IntelliSense is not yet computed\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.leadingWord.word.length !== 0 && ctx.leadingWord.startColumn > this._context.leadingWord.startColumn) {\n\t\t\t// started a new word while IntelliSense shows -> retrigger but reuse all items that we currently have\n\t\t\tconst shouldAutoTrigger = LineContext.shouldAutoTrigger(this._editor);\n\t\t\tif (shouldAutoTrigger && this._context) {\n\t\t\t\t// shouldAutoTrigger forces tokenization, which can cause pending cursor change events to be emitted, which can cause\n\t\t\t\t// suggestions to be cancelled, which causes `this._context` to be undefined\n\t\t\t\tconst map = this._completionModel.getItemsByProvider();\n\t\t\t\tthis.trigger({\n\t\t\t\t\tauto: this._context.triggerOptions.auto,\n\t\t\t\t\tretrigger: true,\n\t\t\t\t\tclipboardText: this._completionModel.clipboardText,\n\t\t\t\t\tcompletionOptions: { providerItemsToReuse: map }\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column > this._context.column && this._completionModel.getIncompleteProvider().size > 0 && ctx.leadingWord.word.length !== 0) {\n\t\t\t// typed -> moved cursor RIGHT & incomple model & still on a word -> retrigger\n\n\t\t\tconst providerItemsToReuse = new Map<CompletionItemProvider, CompletionItem[]>();\n\t\t\tconst providerFilter = new Set<CompletionItemProvider>();\n\t\t\tfor (const [provider, items] of this._completionModel.getItemsByProvider()) {\n\t\t\t\tif (items.length > 0 && items[0].container.incomplete) {\n\t\t\t\t\tproviderFilter.add(provider);\n\t\t\t\t} else {\n\t\t\t\t\tproviderItemsToReuse.set(provider, items);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.trigger({\n\t\t\t\tauto: this._context.triggerOptions.auto,\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerForIncompleteCompletions,\n\t\t\t\tretrigger: true,\n\t\t\t\tclipboardText: this._completionModel.clipboardText,\n\t\t\t\tcompletionOptions: { providerFilter, providerItemsToReuse }\n\t\t\t});\n\n\t\t} else {\n\t\t\t// typed -> moved cursor RIGHT -> update UI\n\t\t\tconst oldLineContext = this._completionModel.lineContext;\n\t\t\tlet isFrozen = false;\n\n\t\t\tthis._completionModel.lineContext = {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context.column\n\t\t\t};\n\n\t\t\tif (this._completionModel.items.length === 0) {\n\n\t\t\t\tconst shouldAutoTrigger = LineContext.shouldAutoTrigger(this._editor);\n\t\t\t\tif (!this._context) {\n\t\t\t\t\t// shouldAutoTrigger forces tokenization, which can cause pending cursor change events to be emitted, which can cause\n\t\t\t\t\t// suggestions to be cancelled, which causes `this._context` to be undefined\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (shouldAutoTrigger && this._context.leadingWord.endColumn < ctx.leadingWord.startColumn) {\n\t\t\t\t\t// retrigger when heading into a new word\n\t\t\t\t\tthis.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!this._context.triggerOptions.auto) {\n\t\t\t\t\t// freeze when IntelliSense was manually requested\n\t\t\t\t\tthis._completionModel.lineContext = oldLineContext;\n\t\t\t\t\tisFrozen = this._completionModel.items.length > 0;\n\n\t\t\t\t\tif (isFrozen && ctx.leadingWord.word.length === 0) {\n\t\t\t\t\t\t// there were results before but now there aren't\n\t\t\t\t\t\t// and also we are not on a word anymore -> cancel\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t// nothing left\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\tif (this._editor.getOption(EditorOption.suggest).reopenOnDelete) {\n\t\t\t\t\t\t// remember the text that nothing matched, and whitespace typed after it, for Backspace\n\t\t\t\t\t\tthis._closedWithoutMatch = { lineNumber: ctx.lineNumber, prefix: ctx.leadingLineContent.slice(0, ctx.leadingLineContent.search(/\\S*\\s*$/)) };\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidSuggest.fire({\n\t\t\t\tcompletionModel: this._completionModel,\n\t\t\t\ttriggerOptions: ctx.triggerOptions,\n\t\t\t\tisFrozen,\n\t\t\t});\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { disposableTimeout, TimeoutTimer } from '../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { FuzzyScoreOptions } from '../../../../base/common/filters.js';\nimport { DisposableStore, dispose, IDisposable } from '../../../../base/common/lifecycle.js';\nimport { registerAutorunSelfDisposable } from '../../../../base/common/observable.js';\nimport { getLeadingWhitespace, isHighSurrogate, isLowSurrogate } from '../../../../base/common/strings.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IEnvironmentService } from '../../../../platform/environment/common/environment.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { IWordAtPosition } from '../../../common/core/wordHelper.js';\nimport { CursorChangeReason, ICursorSelectionChangedEvent } from '../../../common/cursorEvents.js';\nimport { CompletionContext, CompletionItemKind, CompletionItemProvider, CompletionTriggerKind } from '../../../common/languages.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { IEditorWorkerService } from '../../../common/services/editorWorker.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getInlineCompletionsController } from '../../inlineCompletions/browser/controller/common.js';\nimport { InlineCompletionContextKeys } from '../../inlineCompletions/browser/controller/inlineCompletionContextKeys.js';\nimport { SnippetController2 } from '../../snippet/browser/snippetController2.js';\nimport { CompletionModel } from './completionModel.js';\nimport { CompletionDurations, CompletionItem, CompletionOptions, getSnippetSuggestSupport, provideSuggestionItems, QuickSuggestionsOptions, SnippetSortOrder } from './suggest.js';\nimport { WordDistance } from './wordDistance.js';\n\nexport interface ICancelEvent {\n\treadonly retrigger: boolean;\n}\n\nexport interface ITriggerEvent {\n\treadonly auto: boolean;\n\treadonly shy: boolean;\n\treadonly position: IPosition;\n}\n\nexport interface ISuggestEvent {\n\treadonly completionModel: CompletionModel;\n\treadonly isFrozen: boolean;\n\treadonly triggerOptions: SuggestTriggerOptions;\n}\n\nexport interface SuggestTriggerOptions {\n\treadonly auto: boolean;\n\treadonly shy?: boolean;\n\treadonly refilter?: boolean;\n\treadonly retrigger?: boolean;\n\treadonly triggerKind?: CompletionTriggerKind;\n\treadonly triggerCharacter?: string;\n\treadonly clipboardText?: string;\n\tcompletionOptions?: Partial<CompletionOptions>;\n}\n\nexport class LineContext {\n\n\tstatic shouldAutoTrigger(editor: ICodeEditor): boolean {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst model = editor.getModel();\n\t\tconst pos = editor.getPosition();\n\t\tmodel.tokenization.tokenizeIfCheap(pos.lineNumber);\n\n\t\tconst word = model.getWordAtPosition(pos);\n\t\tif (!word) {\n\t\t\treturn false;\n\t\t}\n\t\tif (word.endColumn !== pos.column &&\n\t\t\tword.startColumn + 1 !== pos.column /* after typing a single character before a word */) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!isNaN(Number(word.word))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\treadonly lineNumber: number;\n\treadonly column: number;\n\treadonly leadingLineContent: string;\n\treadonly leadingWord: IWordAtPosition;\n\treadonly triggerOptions: SuggestTriggerOptions;\n\n\tconstructor(model: ITextModel, position: Position, triggerOptions: SuggestTriggerOptions) {\n\t\tthis.leadingLineContent = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\tthis.leadingWord = model.getWordUntilPosition(position);\n\t\tthis.lineNumber = position.lineNumber;\n\t\tthis.column = position.column;\n\t\tthis.triggerOptions = triggerOptions;\n\t}\n}\n\nexport const enum State {\n\tIdle = 0,\n\tManual = 1,\n\tAuto = 2\n}\n\nfunction canShowQuickSuggest(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue(InlineCompletionContextKeys.inlineSuggestionVisible.key))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\tconst suppressSuggestions = contextKeyService.getContextKeyValue<boolean | undefined>(InlineCompletionContextKeys.suppressSuggestions.key);\n\tif (suppressSuggestions !== undefined) {\n\t\treturn !suppressSuggestions;\n\t}\n\treturn !editor.getOption(EditorOption.inlineSuggest).suppressSuggestions;\n}\n\nfunction canShowSuggestOnTriggerCharacters(editor: ICodeEditor, contextKeyService: IContextKeyService, configurationService: IConfigurationService): boolean {\n\tif (!Boolean(contextKeyService.getContextKeyValue('inlineSuggestionVisible'))) {\n\t\t// Allow if there is no inline suggestion.\n\t\treturn true;\n\t}\n\tconst suppressSuggestions = contextKeyService.getContextKeyValue<boolean | undefined>(InlineCompletionContextKeys.suppressSuggestions.key);\n\tif (suppressSuggestions !== undefined) {\n\t\treturn !suppressSuggestions;\n\t}\n\treturn !editor.getOption(EditorOption.inlineSuggest).suppressSuggestions;\n}\n\nexport class SuggestModel implements IDisposable {\n\n\tprivate readonly _toDispose = new DisposableStore();\n\tprivate readonly _triggerCharacterListener = new DisposableStore();\n\tprivate readonly _supportsByTriggerCharacter = new Map<string, Set<CompletionItemProvider>>();\n\tprivate readonly _triggerQuickSuggest = new TimeoutTimer();\n\tprivate _waitForInlineCompletions: DisposableStore | undefined;\n\n\tprivate _triggerState: SuggestTriggerOptions | undefined = undefined;\n\tprivate _requestToken?: CancellationTokenSource;\n\tprivate _context?: LineContext;\n\tprivate _currentSelection: Selection;\n\n\t/**\n\t * Where automatic suggestions last closed because nothing matched what was typed: the line,\n\t * and the line content before that text. With `editor.suggest.reopenOnDelete`, Backspace\n\t * brings them back while the cursor stays in that text.\n\t */\n\tprivate _closedWithoutMatch: { readonly lineNumber: number; readonly prefix: string } | undefined;\n\n\tprivate _completionModel: CompletionModel | undefined;\n\tprivate readonly _completionDisposables = new DisposableStore();\n\tprivate readonly _onDidCancel = new Emitter<ICancelEvent>();\n\tprivate readonly _onDidTrigger = new Emitter<ITriggerEvent>();\n\tprivate readonly _onDidSuggest = new Emitter<ISuggestEvent>();\n\n\treadonly onDidCancel: Event<ICancelEvent> = this._onDidCancel.event;\n\treadonly onDidTrigger: Event<ITriggerEvent> = this._onDidTrigger.event;\n\treadonly onDidSuggest: Event<ISuggestEvent> = this._onDidSuggest.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@ITelemetryService private readonly _telemetryService: ITelemetryService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEnvironmentService private readonly _envService: IEnvironmentService,\n\t) {\n\t\tthis._currentSelection = this._editor.getSelection() || new Selection(1, 1, 1, 1);\n\n\t\t// wire up various listeners\n\t\tthis._toDispose.add(this._editor.onDidChangeModel(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelLanguage(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeConfiguration(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t}));\n\t\tthis._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis._updateActiveSuggestSession();\n\t\t}));\n\n\t\tlet editorIsComposing = false;\n\t\tthis._toDispose.add(this._editor.onDidCompositionStart(() => {\n\t\t\teditorIsComposing = true;\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidCompositionEnd(() => {\n\t\t\teditorIsComposing = false;\n\t\t\tthis._onCompositionEnd();\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeCursorSelection(e => {\n\t\t\t// only trigger suggest when the editor isn't composing a character\n\t\t\tif (!editorIsComposing) {\n\t\t\t\tthis._onCursorChange(e);\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\t// only filter completions when the editor isn't composing a character\n\t\t\t// allow-any-unicode-next-line\n\t\t\t// e.g. ¨ + u makes ü but just ¨ cannot be used for filtering\n\t\t\tif (!editorIsComposing && this._triggerState !== undefined) {\n\t\t\t\tthis._refilterCompletionItems(true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._updateTriggerCharacters();\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._triggerCharacterListener);\n\t\tdispose([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]);\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._toDispose.dispose();\n\t\tthis._completionDisposables.dispose();\n\t\tthis.cancel();\n\t}\n\n\tprivate _updateTriggerCharacters(): void {\n\t\tthis._triggerCharacterListener.clear();\n\t\tthis._supportsByTriggerCharacter.clear();\n\n\t\tif (this._editor.getOption(EditorOption.readOnly)\n\t\t\t|| !this._editor.hasModel()\n\t\t\t|| !this._editor.getOption(EditorOption.suggestOnTriggerCharacters)) {\n\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const support of this._languageFeaturesService.completionProvider.all(this._editor.getModel())) {\n\t\t\tfor (const ch of support.triggerCharacters || []) {\n\t\t\t\tlet set = this._supportsByTriggerCharacter.get(ch);\n\t\t\t\tif (!set) {\n\t\t\t\t\tset = new Set();\n\t\t\t\t\tconst suggestSupport = getSnippetSuggestSupport();\n\t\t\t\t\tif (suggestSupport) {\n\t\t\t\t\t\tset.add(suggestSupport);\n\t\t\t\t\t}\n\t\t\t\t\tthis._supportsByTriggerCharacter.set(ch, set);\n\t\t\t\t}\n\t\t\t\tset.add(support);\n\t\t\t}\n\t\t}\n\n\n\t\tconst checkTriggerCharacter = (text?: string) => {\n\n\t\t\tif (!canShowSuggestOnTriggerCharacters(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\t// don't trigger by trigger characters when this is a case for quick suggest\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!text) {\n\t\t\t\t// came here from the compositionEnd-event\n\t\t\t\tconst position = this._editor.getPosition()!;\n\t\t\t\tconst model = this._editor.getModel()!;\n\t\t\t\ttext = model.getLineContent(position.lineNumber).substr(0, position.column - 1);\n\t\t\t}\n\n\t\t\tthis._triggerOnLastCharacter(text);\n\t\t};\n\n\t\tthis._triggerCharacterListener.add(this._editor.onDidType(checkTriggerCharacter));\n\t\tthis._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => checkTriggerCharacter()));\n\t}\n\n\t/**\n\t * Triggers the providers of the last character of the given text, as typing that character\n\t * does. Returns `false` when it isn't a trigger character.\n\t */\n\tprivate _triggerOnLastCharacter(text: string): boolean {\n\t\tlet lastChar = '';\n\t\tif (isLowSurrogate(text.charCodeAt(text.length - 1))) {\n\t\t\tif (isHighSurrogate(text.charCodeAt(text.length - 2))) {\n\t\t\t\tlastChar = text.substr(text.length - 2);\n\t\t\t}\n\t\t} else {\n\t\t\tlastChar = text.charAt(text.length - 1);\n\t\t}\n\n\t\tconst supports = this._supportsByTriggerCharacter.get(lastChar);\n\t\tif (supports) {\n\n\t\t\t// keep existing items that where not computed by the\n\t\t\t// supports/providers that want to trigger now\n\t\t\tconst providerItemsToReuse = new Map<CompletionItemProvider, CompletionItem[]>();\n\t\t\tif (this._completionModel) {\n\t\t\t\tfor (const [provider, items] of this._completionModel.getItemsByProvider()) {\n\t\t\t\t\tif (!supports.has(provider)) {\n\t\t\t\t\t\tproviderItemsToReuse.set(provider, items);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.trigger({\n\t\t\t\tauto: true,\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\ttriggerCharacter: lastChar,\n\t\t\t\tretrigger: Boolean(this._completionModel),\n\t\t\t\tclipboardText: this._completionModel?.clipboardText,\n\t\t\t\tcompletionOptions: { providerFilter: supports, providerItemsToReuse }\n\t\t\t});\n\t\t}\n\t\treturn Boolean(supports);\n\t}\n\n\t// --- trigger/retrigger/cancel suggest\n\n\tget state(): State {\n\t\tif (!this._triggerState) {\n\t\t\treturn State.Idle;\n\t\t} else if (!this._triggerState.auto) {\n\t\t\treturn State.Manual;\n\t\t} else {\n\t\t\treturn State.Auto;\n\t\t}\n\t}\n\n\tcancel(retrigger: boolean = false): void {\n\t\tthis._triggerQuickSuggest.cancel();\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._waitForInlineCompletions = undefined;\n\t\tthis._closedWithoutMatch = undefined;\n\n\t\tif (this._triggerState !== undefined) {\n\t\t\tthis._requestToken?.cancel();\n\t\t\tthis._requestToken = undefined;\n\t\t\tthis._triggerState = undefined;\n\t\t\tthis._completionModel = undefined;\n\t\t\tthis._context = undefined;\n\t\t\tthis._onDidCancel.fire({ retrigger });\n\t\t}\n\t}\n\n\tclear() {\n\t\tthis._completionDisposables.clear();\n\t}\n\n\tprivate _updateActiveSuggestSession(): void {\n\t\tif (this._triggerState !== undefined) {\n\t\t\tif (!this._editor.hasModel() || !this._languageFeaturesService.completionProvider.has(this._editor.getModel())) {\n\t\t\t\tthis.cancel();\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: this._triggerState.auto, retrigger: true });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _onCursorChange(e: ICursorSelectionChangedEvent): void {\n\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevSelection = this._currentSelection;\n\t\tthis._currentSelection = this._editor.getSelection();\n\n\t\tif (!e.selection.isEmpty()\n\t\t\t|| (e.reason !== CursorChangeReason.NotSet && e.reason !== CursorChangeReason.Explicit)\n\t\t\t|| (e.source !== 'keyboard' && e.source !== 'deleteLeft')\n\t\t) {\n\t\t\t// Early exit if nothing needs to be done!\n\t\t\t// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (this._triggerState === undefined && e.reason === CursorChangeReason.NotSet) {\n\t\t\tif (prevSelection.containsRange(this._currentSelection) || prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) {\n\t\t\t\t// cursor did move RIGHT due to typing -> trigger quick suggest\n\t\t\t\tthis._doTriggerQuickSuggest();\n\t\t\t} else if (e.source === 'deleteLeft') {\n\t\t\t\t// cursor did move LEFT due to Backspace -> bring back suggestions that closed because nothing matched\n\t\t\t\tthis._reopenAfterDelete();\n\t\t\t}\n\n\t\t} else if (this._triggerState !== undefined && e.reason === CursorChangeReason.Explicit) {\n\t\t\t// suggest is active and something like cursor keys are used to move\n\t\t\t// the cursor. this means we can refilter at the new position\n\t\t\tthis._refilterCompletionItems();\n\n\t\t} else if (e.reason === CursorChangeReason.Explicit) {\n\t\t\t// suggest is inactive and the cursor moved away from where it closed\n\t\t\tthis._closedWithoutMatch = undefined;\n\t\t}\n\t}\n\n\tprivate _onCompositionEnd(): void {\n\t\t// trigger or refilter when composition ends\n\t\tif (this._triggerState === undefined) {\n\t\t\tthis._doTriggerQuickSuggest();\n\t\t} else {\n\t\t\tthis._refilterCompletionItems();\n\t\t}\n\t}\n\n\t/**\n\t * Brings back automatic suggestions that closed because nothing matched what was typed,\n\t * when Backspace keeps the cursor in that text. It does what Backspace does while they show.\n\t */\n\tprivate _reopenAfterDelete(): void {\n\t\tconst closed = this._closedWithoutMatch;\n\t\tthis._closedWithoutMatch = undefined;\n\t\tif (!closed || !this._editor.hasModel() || !this._editor.getOption(EditorOption.suggest).reopenOnDelete) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst ctx = new LineContext(this._editor.getModel(), this._editor.getPosition(), { auto: true });\n\t\tconst text = ctx.leadingLineContent.slice(closed.prefix.length);\n\t\tif (ctx.lineNumber !== closed.lineNumber || !ctx.leadingLineContent.startsWith(closed.prefix) || !text || /\\s/.test(text)) {\n\t\t\t// deleted all of that text, or typed past it\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ctx.leadingWord.word) {\n\t\t\tthis._reopenOnTriggerCharacter(ctx);\n\t\t} else if (canShowQuickSuggest(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\tthis.trigger({ auto: true });\n\t\t}\n\t}\n\n\t/**\n\t * With `editor.suggest.reopenOnDelete`, triggers the providers of the trigger character\n\t * before the cursor, as typing it does. Returns `false` when it doesn't.\n\t */\n\tprivate _reopenOnTriggerCharacter(ctx: LineContext): boolean {\n\t\treturn this._editor.getOption(EditorOption.suggest).reopenOnDelete\n\t\t\t&& canShowSuggestOnTriggerCharacters(this._editor, this._contextKeyService, this._configurationService)\n\t\t\t&& this._triggerOnLastCharacter(ctx.leadingLineContent);\n\t}\n\n\tprivate _doTriggerQuickSuggest(): void {\n\n\t\tif (QuickSuggestionsOptions.isAllOff(this._editor.getOption(EditorOption.quickSuggestions))) {\n\t\t\t// not enabled\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._editor.getOption(EditorOption.suggest).snippetsPreventQuickSuggestions && SnippetController2.get(this._editor)?.isInSnippet()) {\n\t\t\t// no quick suggestion when in snippet mode\n\t\t\treturn;\n\t\t}\n\n\t\tthis.cancel();\n\n\t\t// Cancel any in-flight wait for inline completions from a previous cycle\n\t\tthis._waitForInlineCompletions?.dispose();\n\t\tthis._waitForInlineCompletions = undefined;\n\n\t\tthis._triggerQuickSuggest.cancelAndSet(() => {\n\t\t\tif (this._triggerState !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = this._editor.getModel();\n\t\t\tconst pos = this._editor.getPosition();\n\t\t\t// validate enabled now\n\t\t\tconst config = this._editor.getOption(EditorOption.quickSuggestions);\n\t\t\tif (QuickSuggestionsOptions.isAllOff(config)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet waitForInlineCompletions = false;\n\t\t\tif (!QuickSuggestionsOptions.isAllOn(config)) {\n\t\t\t\t// Check the type of the token that triggered this\n\t\t\t\tmodel.tokenization.tokenizeIfCheap(pos.lineNumber);\n\t\t\t\tconst lineTokens = model.tokenization.getLineTokens(pos.lineNumber);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(pos.column - 1 - 1, 0)));\n\t\t\t\tconst value = QuickSuggestionsOptions.valueFor(config, tokenType);\n\t\t\t\tif (value === 'off' || value === 'inline') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (value === 'offWhenInlineCompletions') {\n\t\t\t\t\twaitForInlineCompletions = this._languageFeaturesService.inlineCompletionsProvider.has(model)\n\t\t\t\t\t\t&& this._editor.getOption(EditorOption.inlineSuggest).enabled;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!canShowQuickSuggest(this._editor, this._contextKeyService, this._configurationService)) {\n\t\t\t\t// do not trigger quick suggestions if inline suggestions are shown\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this._languageFeaturesService.completionProvider.has(model)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (waitForInlineCompletions) {\n\t\t\t\t// Wait for inline completions to resolve before deciding\n\t\t\t\tthis._waitForInlineCompletionsAndTrigger(model, pos);\n\t\t\t} else {\n\t\t\t\tthis.trigger({ auto: true });\n\t\t\t}\n\n\t\t}, this._editor.getOption(EditorOption.quickSuggestionsDelay));\n\t}\n\n\tprivate _waitForInlineCompletionsAndTrigger(initialModel: ITextModel, initialPosition: Position): void {\n\t\tconst initialModelVersion = initialModel.getVersionId();\n\t\tconst inlineController = getInlineCompletionsController(this._editor);\n\t\tconst inlineModel = inlineController?.model.get();\n\t\tif (!inlineController || !inlineModel) {\n\t\t\tthis.trigger({ auto: true });\n\t\t\treturn;\n\t\t}\n\n\t\tconst state = inlineModel.state.get();\n\t\tif (state?.inlineSuggestion) {\n\t\t\t// Inline completions are already showing - suppress\n\t\t\treturn;\n\t\t}\n\n\t\tconst store = new DisposableStore();\n\t\tthis._waitForInlineCompletions = store;\n\n\t\tconst triggerAndCleanUp = (doTrigger: boolean) => {\n\t\t\tstore.dispose();\n\t\t\tif (this._waitForInlineCompletions === store) {\n\t\t\t\tthis._waitForInlineCompletions = undefined;\n\t\t\t}\n\t\t\tif (this._triggerState !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!doTrigger) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst currentModel = this._editor.getModel();\n\t\t\tconst currentPosition = this._editor.getPosition();\n\t\t\tif (currentModel === initialModel\n\t\t\t\t&& currentModel.getVersionId() === initialModelVersion\n\t\t\t\t&& currentPosition?.equals(initialPosition)\n\t\t\t\t&& this._editor.hasWidgetFocus()\n\t\t\t) {\n\t\t\t\tthis.trigger({ auto: true });\n\t\t\t}\n\t\t};\n\n\t\t// Reading `inlineController.model` first in a single autorun binds the\n\t\t// wait to the model's lifetime: nested autoruns would have no defined\n\t\t// run order, so an inner state-watcher could fire on a disposed model\n\t\t// before the outer model-watcher cleaned it up.\n\t\tdisposableTimeout(() => {\n\t\t\ttriggerAndCleanUp(true);\n\t\t\tinlineModel.stop('automatic');\n\t\t}, 750, store);\n\n\t\tregisterAutorunSelfDisposable(store, reader => {\n\t\t\tconst currentInlineModel = inlineController.model.read(reader);\n\t\t\tif (currentInlineModel !== inlineModel) {\n\t\t\t\treader.dispose();\n\t\t\t\ttriggerAndCleanUp(false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst status = inlineModel.status.read(reader);\n\t\t\tconst currentState = inlineModel.state.read(reader);\n\t\t\tif (!currentState && status === 'loading') {\n\t\t\t\t// Still loading\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treader.dispose();\n\t\t\ttriggerAndCleanUp(!currentState);\n\t\t});\n\t}\n\n\tprivate _refilterCompletionItems(contentChanged = false): void {\n\t\tassertType(this._editor.hasModel());\n\t\tassertType(this._triggerState !== undefined);\n\n\t\tconst model = this._editor.getModel();\n\t\tconst position = this._editor.getPosition();\n\t\tconst ctx = new LineContext(model, position, { ...this._triggerState, refilter: true });\n\t\tthis._onNewContext(ctx, contentChanged);\n\t}\n\n\ttrigger(options: SuggestTriggerOptions): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst ctx = new LineContext(model, this._editor.getPosition(), options);\n\n\t\t// Cancel previous requests, change state & update UI\n\t\tthis.cancel(options.retrigger);\n\t\tthis._triggerState = options;\n\t\tthis._onDidTrigger.fire({ auto: options.auto, shy: options.shy ?? false, position: this._editor.getPosition() });\n\n\t\t// Capture context when request was sent\n\t\tthis._context = ctx;\n\n\t\t// Build context for request\n\t\tlet suggestCtx: CompletionContext = { triggerKind: options.triggerKind ?? CompletionTriggerKind.Invoke };\n\t\tif (options.triggerCharacter) {\n\t\t\tsuggestCtx = {\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerCharacter,\n\t\t\t\ttriggerCharacter: options.triggerCharacter\n\t\t\t};\n\t\t}\n\n\t\tthis._requestToken = new CancellationTokenSource();\n\n\t\t// kind filter and snippet sort rules\n\t\tconst snippetSuggestions = this._editor.getOption(EditorOption.snippetSuggestions);\n\t\tlet snippetSortOrder = SnippetSortOrder.Inline;\n\t\tswitch (snippetSuggestions) {\n\t\t\tcase 'top':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Top;\n\t\t\t\tbreak;\n\t\t\t// \t↓ that's the default anyways...\n\t\t\t// case 'inline':\n\t\t\t// \tsnippetSortOrder = SnippetSortOrder.Inline;\n\t\t\t// \tbreak;\n\t\t\tcase 'bottom':\n\t\t\t\tsnippetSortOrder = SnippetSortOrder.Bottom;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst { itemKind: itemKindFilter, showDeprecated } = SuggestModel.createSuggestFilter(this._editor);\n\t\tconst completionOptions = new CompletionOptions(snippetSortOrder, options.completionOptions?.kindFilter ?? itemKindFilter, options.completionOptions?.providerFilter, options.completionOptions?.providerItemsToReuse, showDeprecated);\n\t\tconst wordDistance = WordDistance.create(this._editorWorkerService, this._editor);\n\n\t\tconst completions = provideSuggestionItems(\n\t\t\tthis._languageFeaturesService.completionProvider,\n\t\t\tmodel,\n\t\t\tthis._editor.getPosition(),\n\t\t\tcompletionOptions,\n\t\t\tsuggestCtx,\n\t\t\tthis._requestToken.token\n\t\t);\n\n\t\tPromise.all([completions, wordDistance]).then(async ([completions, wordDistance]) => {\n\n\t\t\tthis._requestToken?.dispose();\n\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\tcompletions.disposable.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet clipboardText = options?.clipboardText;\n\t\t\tif (!clipboardText && completions.needsClipboard) {\n\t\t\t\tclipboardText = await this._clipboardService.readText();\n\t\t\t}\n\n\t\t\tif (this._triggerState === undefined) {\n\t\t\t\tcompletions.disposable.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst model = this._editor.getModel();\n\t\t\t// const items = completions.items;\n\n\t\t\t// if (existing) {\n\t\t\t// \tconst cmpFn = getSuggestionComparator(snippetSortOrder);\n\t\t\t// \titems = items.concat(existing.items).sort(cmpFn);\n\t\t\t// }\n\n\t\t\tconst ctx = new LineContext(model, this._editor.getPosition(), options);\n\t\t\tconst fuzzySearchOptions = {\n\t\t\t\t...FuzzyScoreOptions.default,\n\t\t\t\tfirstMatchCanBeWeak: !this._editor.getOption(EditorOption.suggest).matchOnWordStartOnly\n\t\t\t};\n\t\t\tthis._completionModel = new CompletionModel(completions.items, this._context!.column, {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context!.column\n\t\t\t},\n\t\t\t\twordDistance,\n\t\t\t\tthis._editor.getOption(EditorOption.suggest),\n\t\t\t\tthis._editor.getOption(EditorOption.snippetSuggestions),\n\t\t\t\tfuzzySearchOptions,\n\t\t\t\tclipboardText\n\t\t\t);\n\n\t\t\t// store containers so that they can be disposed later\n\t\t\tthis._completionDisposables.add(completions.disposable);\n\n\t\t\tthis._onNewContext(ctx);\n\n\t\t\t// finally report telemetry about durations\n\t\t\tthis._reportDurationsTelemetry(completions.durations);\n\n\t\t\t// report invalid completions by source\n\t\t\tif (!this._envService.isBuilt || this._envService.isExtensionDevelopment) {\n\t\t\t\tfor (const item of completions.items) {\n\t\t\t\t\tif (item.isInvalid) {\n\t\t\t\t\t\tthis._logService.warn(`[suggest] did IGNORE invalid completion item from ${item.provider._debugDisplayName}`, item.completion);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}).catch(onUnexpectedError);\n\t}\n\n\t/**\n\t * Report durations telemetry with a 1% sampling rate.\n\t * The telemetry is reported only if a random number between 0 and 100 is less than or equal to 1.\n\t */\n\tprivate _reportDurationsTelemetry(durations: CompletionDurations): void {\n\t\tif (Math.random() > 0.0001) { // 0.01%\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\ttype Durations = { data: string };\n\t\t\ttype DurationsClassification = {\n\t\t\t\towner: 'jrieken';\n\t\t\t\tcomment: 'Completions performance numbers';\n\t\t\t\tdata: { comment: 'Durations per source and overall'; classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth' };\n\t\t\t};\n\t\t\tthis._telemetryService.publicLog2<Durations, DurationsClassification>('suggest.durations.json', { data: JSON.stringify(durations) });\n\t\t\tthis._logService.debug('suggest.durations.json', durations);\n\t\t});\n\t}\n\n\tstatic createSuggestFilter(editor: ICodeEditor): { itemKind: Set<CompletionItemKind>; showDeprecated: boolean } {\n\t\t// kind filter and snippet sort rules\n\t\tconst result = new Set<CompletionItemKind>();\n\n\t\t// snippet setting\n\t\tconst snippetSuggestions = editor.getOption(EditorOption.snippetSuggestions);\n\t\tif (snippetSuggestions === 'none') {\n\t\t\tresult.add(CompletionItemKind.Snippet);\n\t\t}\n\n\t\t// type setting\n\t\tconst suggestOptions = editor.getOption(EditorOption.suggest);\n\t\tif (!suggestOptions.showMethods) { result.add(CompletionItemKind.Method); }\n\t\tif (!suggestOptions.showFunctions) { result.add(CompletionItemKind.Function); }\n\t\tif (!suggestOptions.showConstructors) { result.add(CompletionItemKind.Constructor); }\n\t\tif (!suggestOptions.showFields) { result.add(CompletionItemKind.Field); }\n\t\tif (!suggestOptions.showVariables) { result.add(CompletionItemKind.Variable); }\n\t\tif (!suggestOptions.showClasses) { result.add(CompletionItemKind.Class); }\n\t\tif (!suggestOptions.showStructs) { result.add(CompletionItemKind.Struct); }\n\t\tif (!suggestOptions.showInterfaces) { result.add(CompletionItemKind.Interface); }\n\t\tif (!suggestOptions.showModules) { result.add(CompletionItemKind.Module); }\n\t\tif (!suggestOptions.showProperties) { result.add(CompletionItemKind.Property); }\n\t\tif (!suggestOptions.showEvents) { result.add(CompletionItemKind.Event); }\n\t\tif (!suggestOptions.showOperators) { result.add(CompletionItemKind.Operator); }\n\t\tif (!suggestOptions.showUnits) { result.add(CompletionItemKind.Unit); }\n\t\tif (!suggestOptions.showValues) { result.add(CompletionItemKind.Value); }\n\t\tif (!suggestOptions.showConstants) { result.add(CompletionItemKind.Constant); }\n\t\tif (!suggestOptions.showEnums) { result.add(CompletionItemKind.Enum); }\n\t\tif (!suggestOptions.showEnumMembers) { result.add(CompletionItemKind.EnumMember); }\n\t\tif (!suggestOptions.showKeywords) { result.add(CompletionItemKind.Keyword); }\n\t\tif (!suggestOptions.showWords) { result.add(CompletionItemKind.Text); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Color); }\n\t\tif (!suggestOptions.showFiles) { result.add(CompletionItemKind.File); }\n\t\tif (!suggestOptions.showReferences) { result.add(CompletionItemKind.Reference); }\n\t\tif (!suggestOptions.showColors) { result.add(CompletionItemKind.Customcolor); }\n\t\tif (!suggestOptions.showFolders) { result.add(CompletionItemKind.Folder); }\n\t\tif (!suggestOptions.showTypeParameters) { result.add(CompletionItemKind.TypeParameter); }\n\t\tif (!suggestOptions.showSnippets) { result.add(CompletionItemKind.Snippet); }\n\t\tif (!suggestOptions.showUsers) { result.add(CompletionItemKind.User); }\n\t\tif (!suggestOptions.showIssues) { result.add(CompletionItemKind.Issue); }\n\n\t\treturn { itemKind: result, showDeprecated: suggestOptions.showDeprecated };\n\t}\n\n\tprivate _onNewContext(ctx: LineContext, contentChanged = false): void {\n\n\t\tif (!this._context) {\n\t\t\t// happens when 24x7 IntelliSense is enabled and still in its delay\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.lineNumber !== this._context.lineNumber) {\n\t\t\t// e.g. happens when pressing Enter while IntelliSense is computed\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (getLeadingWhitespace(ctx.leadingLineContent) !== getLeadingWhitespace(this._context.leadingLineContent)) {\n\t\t\t// cancel IntelliSense when line start changes\n\t\t\t// happens when the current word gets outdented\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column < this._context.column) {\n\t\t\t// typed -> moved cursor LEFT -> retrigger if still on a word,\n\t\t\t// or if deleted back to a trigger character, as typing it does\n\t\t\tif (ctx.leadingWord.word) {\n\t\t\t\tthis.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });\n\t\t\t} else if (!contentChanged || !this._reopenOnTriggerCharacter(ctx)) {\n\t\t\t\tthis.cancel();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._completionModel) {\n\t\t\t// happens when IntelliSense is not yet computed\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.leadingWord.word.length !== 0 && ctx.leadingWord.startColumn > this._context.leadingWord.startColumn) {\n\t\t\t// started a new word while IntelliSense shows -> retrigger but reuse all items that we currently have\n\t\t\tconst shouldAutoTrigger = LineContext.shouldAutoTrigger(this._editor);\n\t\t\tif (shouldAutoTrigger && this._context) {\n\t\t\t\t// shouldAutoTrigger forces tokenization, which can cause pending cursor change events to be emitted, which can cause\n\t\t\t\t// suggestions to be cancelled, which causes `this._context` to be undefined\n\t\t\t\tconst map = this._completionModel.getItemsByProvider();\n\t\t\t\tthis.trigger({\n\t\t\t\t\tauto: this._context.triggerOptions.auto,\n\t\t\t\t\tretrigger: true,\n\t\t\t\t\tclipboardText: this._completionModel.clipboardText,\n\t\t\t\t\tcompletionOptions: { providerItemsToReuse: map }\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (ctx.column > this._context.column && this._completionModel.getIncompleteProvider().size > 0 && ctx.leadingWord.word.length !== 0) {\n\t\t\t// typed -> moved cursor RIGHT & incomple model & still on a word -> retrigger\n\n\t\t\tconst providerItemsToReuse = new Map<CompletionItemProvider, CompletionItem[]>();\n\t\t\tconst providerFilter = new Set<CompletionItemProvider>();\n\t\t\tfor (const [provider, items] of this._completionModel.getItemsByProvider()) {\n\t\t\t\tif (items.length > 0 && items[0].container.incomplete) {\n\t\t\t\t\tproviderFilter.add(provider);\n\t\t\t\t} else {\n\t\t\t\t\tproviderItemsToReuse.set(provider, items);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.trigger({\n\t\t\t\tauto: this._context.triggerOptions.auto,\n\t\t\t\ttriggerKind: CompletionTriggerKind.TriggerForIncompleteCompletions,\n\t\t\t\tretrigger: true,\n\t\t\t\tclipboardText: this._completionModel.clipboardText,\n\t\t\t\tcompletionOptions: { providerFilter, providerItemsToReuse }\n\t\t\t});\n\n\t\t} else {\n\t\t\t// typed -> moved cursor RIGHT -> update UI\n\t\t\tconst oldLineContext = this._completionModel.lineContext;\n\t\t\tlet isFrozen = false;\n\n\t\t\tthis._completionModel.lineContext = {\n\t\t\t\tleadingLineContent: ctx.leadingLineContent,\n\t\t\t\tcharacterCountDelta: ctx.column - this._context.column\n\t\t\t};\n\n\t\t\tif (this._completionModel.items.length === 0) {\n\n\t\t\t\tconst shouldAutoTrigger = LineContext.shouldAutoTrigger(this._editor);\n\t\t\t\tif (!this._context) {\n\t\t\t\t\t// shouldAutoTrigger forces tokenization, which can cause pending cursor change events to be emitted, which can cause\n\t\t\t\t\t// suggestions to be cancelled, which causes `this._context` to be undefined\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (shouldAutoTrigger && this._context.leadingWord.endColumn < ctx.leadingWord.startColumn) {\n\t\t\t\t\t// retrigger when heading into a new word\n\t\t\t\t\tthis.trigger({ auto: this._context.triggerOptions.auto, retrigger: true });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!this._context.triggerOptions.auto) {\n\t\t\t\t\t// freeze when IntelliSense was manually requested\n\t\t\t\t\tthis._completionModel.lineContext = oldLineContext;\n\t\t\t\t\tisFrozen = this._completionModel.items.length > 0;\n\n\t\t\t\t\tif (isFrozen && ctx.leadingWord.word.length === 0) {\n\t\t\t\t\t\t// there were results before but now there aren't\n\t\t\t\t\t\t// and also we are not on a word anymore -> cancel\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t// nothing left\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\tif (this._editor.getOption(EditorOption.suggest).reopenOnDelete) {\n\t\t\t\t\t\t// remember the text that nothing matched, and whitespace typed after it, for Backspace\n\t\t\t\t\t\tthis._closedWithoutMatch = { lineNumber: ctx.lineNumber, prefix: ctx.leadingLineContent.slice(0, ctx.leadingLineContent.search(/\\S*\\s*$/)) };\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidSuggest.fire({\n\t\t\t\tcompletionModel: this._completionModel,\n\t\t\t\ttriggerOptions: ctx.triggerOptions,\n\t\t\t\tisFrozen,\n\t\t\t});\n\t\t}\n\t}\n}\n"]}
@@ -42,18 +42,18 @@ import { isWindows } from '../../../../base/common/platform.js';
42
42
  /**
43
43
  * Suggest widget colors
44
44
  */
45
- const editorSuggestWidgetBackground = registerColor('editorSuggestWidget.background', editorWidgetBackground, nls.localize(1554, 'Background color of the suggest widget.'));
46
- registerColor('editorSuggestWidget.border', editorWidgetBorder, nls.localize(1555, 'Border color of the suggest widget.'));
47
- export const editorSuggestWidgetForeground = registerColor('editorSuggestWidget.foreground', editorForeground, nls.localize(1556, 'Foreground color of the suggest widget.'));
48
- const editorSuggestWidgetSelectedForeground = registerColor('editorSuggestWidget.selectedForeground', { dark: quickInputListFocusForeground, light: quickInputListFocusForeground, hcDark: editorSuggestWidgetBackground, hcLight: editorSuggestWidgetBackground }, nls.localize(1557, 'Foreground color of the selected entry in the suggest widget.'));
49
- registerColor('editorSuggestWidget.selectedIconForeground', { dark: quickInputListFocusIconForeground, light: quickInputListFocusIconForeground, hcDark: editorSuggestWidgetBackground, hcLight: editorSuggestWidgetBackground }, nls.localize(1558, 'Icon foreground color of the selected entry in the suggest widget.'));
50
- export const editorSuggestWidgetSelectedBackground = registerColor('editorSuggestWidget.selectedBackground', { dark: quickInputListFocusBackground, light: quickInputListFocusBackground, hcDark: editorSuggestWidgetForeground, hcLight: editorSuggestWidgetForeground }, nls.localize(1559, 'Background color of the selected entry in the suggest widget.'));
51
- export const editorSuggestWidgetFocusOutline = registerColor('editorSuggestWidget.focusOutline', activeContrastBorder, nls.localize(1560, 'Outline color of the focused (keyboard-navigated) entry in the suggest widget.'));
52
- registerColor('editorSuggestWidget.highlightForeground', listHighlightForeground, nls.localize(1561, 'Color of the match highlights in the suggest widget.'));
45
+ const editorSuggestWidgetBackground = registerColor('editorSuggestWidget.background', editorWidgetBackground, nls.localize(1555, 'Background color of the suggest widget.'));
46
+ registerColor('editorSuggestWidget.border', editorWidgetBorder, nls.localize(1556, 'Border color of the suggest widget.'));
47
+ export const editorSuggestWidgetForeground = registerColor('editorSuggestWidget.foreground', editorForeground, nls.localize(1557, 'Foreground color of the suggest widget.'));
48
+ const editorSuggestWidgetSelectedForeground = registerColor('editorSuggestWidget.selectedForeground', { dark: quickInputListFocusForeground, light: quickInputListFocusForeground, hcDark: editorSuggestWidgetBackground, hcLight: editorSuggestWidgetBackground }, nls.localize(1558, 'Foreground color of the selected entry in the suggest widget.'));
49
+ registerColor('editorSuggestWidget.selectedIconForeground', { dark: quickInputListFocusIconForeground, light: quickInputListFocusIconForeground, hcDark: editorSuggestWidgetBackground, hcLight: editorSuggestWidgetBackground }, nls.localize(1559, 'Icon foreground color of the selected entry in the suggest widget.'));
50
+ export const editorSuggestWidgetSelectedBackground = registerColor('editorSuggestWidget.selectedBackground', { dark: quickInputListFocusBackground, light: quickInputListFocusBackground, hcDark: editorSuggestWidgetForeground, hcLight: editorSuggestWidgetForeground }, nls.localize(1560, 'Background color of the selected entry in the suggest widget.'));
51
+ export const editorSuggestWidgetFocusOutline = registerColor('editorSuggestWidget.focusOutline', activeContrastBorder, nls.localize(1561, 'Outline color of the focused (keyboard-navigated) entry in the suggest widget.'));
52
+ registerColor('editorSuggestWidget.highlightForeground', listHighlightForeground, nls.localize(1562, 'Color of the match highlights in the suggest widget.'));
53
53
  // The focused row inherits its background from Quick Input unless the theme overrides it, so match highlights must follow the same source.
54
54
  const editorSuggestWidgetFocusHighlightForegroundDefault = ifDefinedThenElse(editorSuggestWidgetSelectedBackground, listFocusHighlightForeground, quickInputListFocusHighlightForeground);
55
- registerColor('editorSuggestWidget.focusHighlightForeground', { dark: editorSuggestWidgetFocusHighlightForegroundDefault, light: editorSuggestWidgetFocusHighlightForegroundDefault, hcDark: editorSuggestWidgetSelectedForeground, hcLight: editorSuggestWidgetSelectedForeground }, nls.localize(1562, 'Color of the match highlights in the suggest widget when an item is focused.'));
56
- registerColor('editorSuggestWidgetStatus.foreground', transparent(editorSuggestWidgetForeground, .5), nls.localize(1563, 'Foreground color of the suggest widget status.'));
55
+ registerColor('editorSuggestWidget.focusHighlightForeground', { dark: editorSuggestWidgetFocusHighlightForegroundDefault, light: editorSuggestWidgetFocusHighlightForegroundDefault, hcDark: editorSuggestWidgetSelectedForeground, hcLight: editorSuggestWidgetSelectedForeground }, nls.localize(1563, 'Color of the match highlights in the suggest widget when an item is focused.'));
56
+ registerColor('editorSuggestWidgetStatus.foreground', transparent(editorSuggestWidgetForeground, .5), nls.localize(1564, 'Foreground color of the suggest widget status.'));
57
57
  class PersistedWidgetSize {
58
58
  constructor(_service, editor) {
59
59
  this._service = _service;
@@ -81,8 +81,8 @@ class PersistedWidgetSize {
81
81
  }
82
82
  let SuggestWidget = class SuggestWidget {
83
83
  static { SuggestWidget_1 = this; }
84
- static { this.LOADING_MESSAGE = nls.localize(1564, "Loading..."); }
85
- static { this.NO_SUGGESTIONS_MESSAGE = nls.localize(1565, "No suggestions."); }
84
+ static { this.LOADING_MESSAGE = nls.localize(1565, "Loading..."); }
85
+ static { this.NO_SUGGESTIONS_MESSAGE = nls.localize(1566, "No suggestions."); }
86
86
  constructor(editor, _storageService, _contextKeyService, _themeService, instantiationService) {
87
87
  this.editor = editor;
88
88
  this._storageService = _storageService;
@@ -171,7 +171,7 @@ let SuggestWidget = class SuggestWidget {
171
171
  multipleSelectionSupport: false,
172
172
  accessibilityProvider: {
173
173
  getRole: () => isWindows ? 'listitem' : 'option',
174
- getWidgetAriaLabel: () => nls.localize(1566, "Suggest"),
174
+ getWidgetAriaLabel: () => nls.localize(1567, "Suggest"),
175
175
  getWidgetRole: () => 'listbox',
176
176
  getAriaLabel: (item) => {
177
177
  let label = item.textLabel;
@@ -179,24 +179,24 @@ let SuggestWidget = class SuggestWidget {
179
179
  if (typeof item.completion.label !== 'string') {
180
180
  const { detail, description } = item.completion.label;
181
181
  if (detail && description) {
182
- label = nls.localize(1567, '{0} {1}, {2}, {3}', label, detail, description, kindLabel);
182
+ label = nls.localize(1568, '{0} {1}, {2}, {3}', label, detail, description, kindLabel);
183
183
  }
184
184
  else if (detail) {
185
- label = nls.localize(1568, '{0} {1}, {2}', label, detail, kindLabel);
185
+ label = nls.localize(1569, '{0} {1}, {2}', label, detail, kindLabel);
186
186
  }
187
187
  else if (description) {
188
- label = nls.localize(1569, '{0}, {1}, {2}', label, description, kindLabel);
188
+ label = nls.localize(1570, '{0}, {1}, {2}', label, description, kindLabel);
189
189
  }
190
190
  }
191
191
  else {
192
- label = nls.localize(1570, '{0}, {1}', label, kindLabel);
192
+ label = nls.localize(1571, '{0}, {1}', label, kindLabel);
193
193
  }
194
194
  if (!item.isResolved || !this._isDetailsVisible()) {
195
195
  return label;
196
196
  }
197
197
  const { documentation, detail } = item.completion;
198
198
  const docs = strings.format('{0}{1}', detail || '', documentation ? (typeof documentation === 'string' ? documentation : documentation.value) : '');
199
- return nls.localize(1571, "{0}, docs: {1}", label, docs);
199
+ return nls.localize(1572, "{0}, docs: {1}", label, docs);
200
200
  },
201
201
  }
202
202
  });
@@ -49,8 +49,8 @@ let SuggestDetailsWidget = class SuggestDetailsWidget {
49
49
  this._disposables.add(this._scrollbar);
50
50
  this._header = dom.append(this._body, dom.$('.header'));
51
51
  this._close = dom.append(this._header, dom.$('span' + ThemeIcon.asCSSSelector(Codicon.close)));
52
- this._close.title = nls.localize(1572, "Close");
53
- this._close.ariaLabel = nls.localize(1573, "Close");
52
+ this._close.title = nls.localize(1573, "Close");
53
+ this._close.ariaLabel = nls.localize(1574, "Close");
54
54
  this._close.role = 'button';
55
55
  this._close.tabIndex = -1;
56
56
  this._type = dom.append(this._header, dom.$('p.type'));
@@ -98,7 +98,7 @@ let SuggestDetailsWidget = class SuggestDetailsWidget {
98
98
  };
99
99
  }
100
100
  renderLoading() {
101
- this._type.textContent = nls.localize(1574, "Loading...");
101
+ this._type.textContent = nls.localize(1575, "Loading...");
102
102
  this._docs.textContent = '';
103
103
  this.domNode.classList.remove('no-docs', 'no-type');
104
104
  this.layout(this.size.width, this.getLayoutInfo().lineHeight * 2);