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

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 (121) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +6 -0
  18. package/esm/vs/base/common/async.js +11 -0
  19. package/esm/vs/base/common/async.js.map +1 -1
  20. package/esm/vs/editor/common/core/edits/textEdit.js +3 -0
  21. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  22. package/esm/vs/editor/common/languages.js.map +1 -1
  23. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  24. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +1 -0
  25. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
  26. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +5 -0
  27. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  28. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +10 -2
  29. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  30. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +10 -2
  31. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  32. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +18 -3
  33. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
  34. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +151 -0
  35. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -0
  36. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  37. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  38. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  39. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  40. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  41. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  42. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
  43. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  44. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  45. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  46. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  47. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  48. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  49. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  50. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  51. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +11 -11
  52. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  53. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  54. package/esm/vs/editor/contrib/rename/browser/rename.js +15 -11
  55. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  56. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  57. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  58. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  59. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  60. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  61. package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
  62. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
  63. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
  64. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  65. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  66. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  67. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  68. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  69. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  70. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  71. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  72. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  73. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  74. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  75. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
  76. package/esm/vs/editor/editor.api.d.ts +6 -2
  77. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  78. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  79. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  80. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  81. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  82. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  83. package/esm/vs/platform/actions/common/actions.js +1 -0
  84. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  85. package/esm/vs/platform/actions/common/menuService.js +2 -2
  86. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  87. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  88. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  89. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  90. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  91. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  92. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  93. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  94. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  95. package/esm/vs/platform/list/browser/listService.js +27 -27
  96. package/esm/vs/platform/markers/common/markerService.js +2 -2
  97. package/esm/vs/platform/markers/common/markers.js +6 -6
  98. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  99. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  100. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  101. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  102. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  103. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  104. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  105. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  106. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  107. package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
  108. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  109. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  110. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  111. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  112. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  113. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  114. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  115. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  116. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  117. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  118. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  119. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  120. package/monaco.d.ts +6 -2
  121. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.ts","vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAqB,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAe,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAGlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C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AI,CAAC,WAAW,EAAE,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;QAClF,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,QAAkB,EAAE,KAAiB,EAAE,4BAA2D;IACtI,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAEvG,MAAM,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAChH,MAAM,UAAU,GAAG,kBAAkB,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACtF,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,SAAS,GAAG,iBAAiB,CAAC,UAAU,EAAE,4BAA4B,CAAC,CAAC;IAC9E,OAAO,SAAS,CAAC;AAClB,CAAC","file":"provideInlineCompletions.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 { assertNever } from '../../../../../base/common/assert.js';\nimport { AsyncIterableProducer } from '../../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { onUnexpectedExternalError } from '../../../../../base/common/errors.js';\nimport { Disposable, IDisposable } from '../../../../../base/common/lifecycle.js';\nimport { prefixedUuid } from '../../../../../base/common/uuid.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { ISingleEditOperation } from '../../../../common/core/editOperation.js';\nimport { StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { TextReplacement } from '../../../../common/core/edits/textEdit.js';\nimport { InlineCompletionEndOfLifeReason, InlineCompletionEndOfLifeReasonKind, InlineCompletion, InlineCompletionContext, InlineCompletions, InlineCompletionsProvider, PartialAcceptInfo, InlineCompletionsDisposeReason, LifetimeSummary, ProviderId, InlineCompletionHint } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { fixBracketsInLine } from '../../../../common/model/bracketPairsTextModelPart/fixBrackets.js';\nimport { SnippetParser, Text } from '../../../snippet/browser/snippetParser.js';\nimport { getReadonlyEmptyArray } from '../utils.js';\nimport { groupByMap } from '../../../../../base/common/collections.js';\nimport { DirectedGraph } from './graph.js';\nimport { CachedFunction } from '../../../../../base/common/cache.js';\nimport { InlineCompletionViewData, InlineCompletionViewKind } from '../view/inlineEdits/inlineEditsViewInterface.js';\nimport { isDefined } from '../../../../../base/common/types.js';\nimport { inlineCompletionIsVisible } from './inlineSuggestionItem.js';\nimport { EditDeltaInfo } from '../../../../common/textModelEditSource.js';\nimport { URI } from '../../../../../base/common/uri.js';\n\nexport type InlineCompletionContextWithoutUuid = Omit<InlineCompletionContext, 'requestUuid'>;\n\nexport function provideInlineCompletions(\n\tproviders: InlineCompletionsProvider[],\n\tposition: Position,\n\tmodel: ITextModel,\n\tcontext: InlineCompletionContextWithoutUuid,\n\trequestInfo: InlineSuggestRequestInfo,\n\tlanguageConfigurationService?: ILanguageConfigurationService,\n): IInlineCompletionProviderResult {\n\tconst requestUuid = prefixedUuid('icr');\n\n\tconst cancellationTokenSource = new CancellationTokenSource();\n\tlet cancelReason: InlineCompletionsDisposeReason | undefined = undefined;\n\n\tconst contextWithUuid: InlineCompletionContext = { ...context, requestUuid: requestUuid };\n\n\tconst defaultReplaceRange = getDefaultRange(position, model);\n\n\tconst providersByGroupId = groupByMap(providers, p => p.groupId);\n\tconst yieldsToGraph = DirectedGraph.from(providers, p => {\n\t\treturn p.yieldsToGroupIds?.flatMap(groupId => providersByGroupId.get(groupId) ?? []) ?? [];\n\t});\n\tconst { foundCycles } = yieldsToGraph.removeCycles();\n\tif (foundCycles.length > 0) {\n\t\tonUnexpectedExternalError(new Error(`Inline completions: cyclic yield-to dependency detected.`\n\t\t\t+ ` Path: ${foundCycles.map(s => s.toString ? s.toString() : ('' + s)).join(' -> ')}`));\n\t}\n\n\tlet runningCount = 0;\n\n\tconst queryProvider = new CachedFunction(async (provider: InlineCompletionsProvider<InlineCompletions>): Promise<InlineSuggestionList | undefined> => {\n\t\ttry {\n\t\t\trunningCount++;\n\t\t\tif (cancellationTokenSource.token.isCancellationRequested) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst yieldsTo = yieldsToGraph.getOutgoing(provider);\n\t\t\tfor (const p of yieldsTo) {\n\t\t\t\t// We know there is no cycle, so no recursion here\n\t\t\t\tconst result = await queryProvider.get(p);\n\t\t\t\tif (result) {\n\t\t\t\t\tfor (const item of result.inlineSuggestions.items) {\n\t\t\t\t\t\tif (item.isInlineEdit || typeof item.insertText !== 'string' && item.insertText !== undefined) {\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (item.insertText !== undefined) {\n\t\t\t\t\t\t\tconst t = new TextReplacement(Range.lift(item.range) ?? defaultReplaceRange, item.insertText);\n\t\t\t\t\t\t\tif (inlineCompletionIsVisible(t, undefined, model, position)) {\n\t\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// else: inline completion is not visible, so lets not block\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet result: InlineCompletions | null | undefined;\n\t\t\tconst providerStartTime = Date.now();\n\t\t\ttry {\n\t\t\t\tresult = await provider.provideInlineCompletions(model, position, contextWithUuid, cancellationTokenSource.token);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedExternalError(e);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst providerEndTime = Date.now();\n\n\t\t\tif (!result) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst data: InlineSuggestData[] = [];\n\t\t\tconst list = new InlineSuggestionList(result, data, provider);\n\t\t\tlist.addRef();\n\t\t\trunWhenCancelled(cancellationTokenSource.token, () => {\n\t\t\t\treturn list.removeRef(cancelReason);\n\t\t\t});\n\t\t\tif (cancellationTokenSource.token.isCancellationRequested) {\n\t\t\t\treturn undefined; // The list is disposed now, so we cannot return the items!\n\t\t\t}\n\n\t\t\tfor (const item of result.items) {\n\t\t\t\tdata.push(toInlineSuggestData(item, list, defaultReplaceRange, model, languageConfigurationService, contextWithUuid, requestInfo, { startTime: providerStartTime, endTime: providerEndTime }));\n\t\t\t}\n\n\t\t\treturn list;\n\t\t} finally {\n\t\t\trunningCount--;\n\t\t}\n\t});\n\n\tconst inlineCompletionLists = AsyncIterableProducer.fromPromisesResolveOrder(providers.map(p => queryProvider.get(p))).filter(isDefined);\n\n\treturn {\n\t\tcontextWithUuid,\n\t\tget didAllProvidersReturn() { return runningCount === 0; },\n\t\tlists: inlineCompletionLists,\n\t\tcancelAndDispose: reason => {\n\t\t\tif (cancelReason !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcancelReason = reason;\n\t\t\tcancellationTokenSource.dispose(true);\n\t\t}\n\t};\n}\n\n/** If the token is eventually cancelled, this will not leak either. */\nexport function runWhenCancelled(token: CancellationToken, callback: () => void): IDisposable {\n\tif (token.isCancellationRequested) {\n\t\tcallback();\n\t\treturn Disposable.None;\n\t} else {\n\t\tconst listener = token.onCancellationRequested(() => {\n\t\t\tlistener.dispose();\n\t\t\tcallback();\n\t\t});\n\t\treturn { dispose: () => listener.dispose() };\n\t}\n}\n\nexport interface IInlineCompletionProviderResult {\n\tget didAllProvidersReturn(): boolean;\n\n\tcontextWithUuid: InlineCompletionContext;\n\n\tcancelAndDispose(reason: InlineCompletionsDisposeReason): void;\n\n\tlists: AsyncIterableProducer<InlineSuggestionList>;\n}\n\nfunction toInlineSuggestData(\n\tinlineCompletion: InlineCompletion,\n\tsource: InlineSuggestionList,\n\tdefaultReplaceRange: Range,\n\ttextModel: ITextModel,\n\tlanguageConfigurationService: ILanguageConfigurationService | undefined,\n\tcontext: InlineCompletionContext,\n\trequestInfo: InlineSuggestRequestInfo,\n\tproviderRequestInfo: InlineSuggestProviderRequestInfo,\n): InlineSuggestData {\n\tlet insertText: string;\n\tlet snippetInfo: SnippetInfo | undefined;\n\tlet range = inlineCompletion.range ? Range.lift(inlineCompletion.range) : defaultReplaceRange;\n\n\tif (typeof inlineCompletion.insertText === 'string') {\n\t\tinsertText = inlineCompletion.insertText;\n\n\t\tif (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n\t\t\tinsertText = closeBrackets(\n\t\t\t\tinsertText,\n\t\t\t\trange.getStartPosition(),\n\t\t\t\ttextModel,\n\t\t\t\tlanguageConfigurationService\n\t\t\t);\n\n\t\t\t// Modify range depending on if brackets are added or removed\n\t\t\tconst diff = insertText.length - inlineCompletion.insertText.length;\n\t\t\tif (diff !== 0) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n\t\t\t}\n\t\t}\n\n\t\tsnippetInfo = undefined;\n\t} else if (inlineCompletion.insertText === undefined) {\n\t\tinsertText = ''; // TODO use undefined\n\t\tsnippetInfo = undefined;\n\t\trange = new Range(1, 1, 1, 1);\n\t} else if ('snippet' in inlineCompletion.insertText) {\n\t\tconst preBracketCompletionLength = inlineCompletion.insertText.snippet.length;\n\n\t\tif (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n\t\t\tinlineCompletion.insertText.snippet = closeBrackets(\n\t\t\t\tinlineCompletion.insertText.snippet,\n\t\t\t\trange.getStartPosition(),\n\t\t\t\ttextModel,\n\t\t\t\tlanguageConfigurationService\n\t\t\t);\n\n\t\t\t// Modify range depending on if brackets are added or removed\n\t\t\tconst diff = inlineCompletion.insertText.snippet.length - preBracketCompletionLength;\n\t\t\tif (diff !== 0) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n\t\t\t}\n\t\t}\n\n\t\tconst snippet = new SnippetParser().parse(inlineCompletion.insertText.snippet);\n\n\t\tif (snippet.children.length === 1 && snippet.children[0] instanceof Text) {\n\t\t\tinsertText = snippet.children[0].value;\n\t\t\tsnippetInfo = undefined;\n\t\t} else {\n\t\t\tinsertText = snippet.toString();\n\t\t\tsnippetInfo = {\n\t\t\t\tsnippet: inlineCompletion.insertText.snippet,\n\t\t\t\trange: range\n\t\t\t};\n\t\t}\n\t} else {\n\t\tassertNever(inlineCompletion.insertText);\n\t}\n\n\treturn new InlineSuggestData(\n\t\trange,\n\t\tinsertText,\n\t\tsnippetInfo,\n\t\tURI.revive(inlineCompletion.uri),\n\t\tinlineCompletion.hint,\n\t\tinlineCompletion.additionalTextEdits || getReadonlyEmptyArray(),\n\t\tinlineCompletion,\n\t\tsource,\n\t\tcontext,\n\t\tinlineCompletion.isInlineEdit ?? false,\n\t\trequestInfo,\n\t\tproviderRequestInfo,\n\t\tinlineCompletion.correlationId,\n\t);\n}\n\nexport type InlineSuggestRequestInfo = {\n\tstartTime: number;\n\teditorType: InlineCompletionEditorType;\n\tlanguageId: string;\n\treason: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tavailableProviders: ProviderId[];\n};\n\nexport type InlineSuggestProviderRequestInfo = {\n\tstartTime: number;\n\tendTime: number;\n};\n\nexport type PartialAcceptance = {\n\tcharacters: number;\n\tcount: number;\n\tratio: number;\n};\n\nexport type InlineSuggestViewData = {\n\teditorType: InlineCompletionEditorType;\n\trenderData?: InlineCompletionViewData;\n\tviewKind?: InlineCompletionViewKind;\n};\n\nexport class InlineSuggestData {\n\tprivate _didShow = false;\n\tprivate _timeUntilShown: number | undefined = undefined;\n\tprivate _showStartTime: number | undefined = undefined;\n\tprivate _shownDuration: number = 0;\n\tprivate _showUncollapsedStartTime: number | undefined = undefined;\n\tprivate _showUncollapsedDuration: number = 0;\n\tprivate _notShownReason: string | undefined = undefined;\n\n\tprivate _viewData: InlineSuggestViewData;\n\tprivate _didReportEndOfLife = false;\n\tprivate _lastSetEndOfLifeReason: InlineCompletionEndOfLifeReason | undefined = undefined;\n\tprivate _isPreceeded = false;\n\tprivate _partiallyAcceptedCount = 0;\n\tprivate _partiallyAcceptedSinceOriginal: PartialAcceptance = { characters: 0, ratio: 0, count: 0 };\n\n\tconstructor(\n\t\tpublic readonly range: Range,\n\t\tpublic readonly insertText: string,\n\t\tpublic readonly snippetInfo: SnippetInfo | undefined,\n\t\tpublic readonly uri: URI | undefined,\n\t\tpublic readonly hint: InlineCompletionHint | undefined,\n\t\tpublic readonly additionalTextEdits: readonly ISingleEditOperation[],\n\n\t\tpublic readonly sourceInlineCompletion: InlineCompletion,\n\t\tpublic readonly source: InlineSuggestionList,\n\t\tpublic readonly context: InlineCompletionContext,\n\t\tpublic readonly isInlineEdit: boolean,\n\n\t\tprivate readonly _requestInfo: InlineSuggestRequestInfo,\n\t\tprivate readonly _providerRequestInfo: InlineSuggestProviderRequestInfo,\n\t\tprivate readonly _correlationId: string | undefined,\n\t) {\n\t\tthis._viewData = { editorType: _requestInfo.editorType };\n\t}\n\n\tpublic get showInlineEditMenu() { return this.sourceInlineCompletion.showInlineEditMenu ?? false; }\n\n\tpublic get partialAccepts(): PartialAcceptance { return this._partiallyAcceptedSinceOriginal; }\n\n\tpublic async reportInlineEditShown(commandService: ICommandService, updatedInsertText: string, viewKind: InlineCompletionViewKind, viewData: InlineCompletionViewData): Promise<void> {\n\t\tthis.updateShownDuration(viewKind);\n\n\t\tif (this._didShow) {\n\t\t\treturn;\n\t\t}\n\t\tthis._didShow = true;\n\t\tthis._viewData.viewKind = viewKind;\n\t\tthis._viewData.renderData = viewData;\n\t\tthis._timeUntilShown = Date.now() - this._requestInfo.startTime;\n\n\t\tconst editDeltaInfo = new EditDeltaInfo(viewData.lineCountModified, viewData.lineCountOriginal, viewData.characterCountModified, viewData.characterCountOriginal);\n\t\tthis.source.provider.handleItemDidShow?.(this.source.inlineSuggestions, this.sourceInlineCompletion, updatedInsertText, editDeltaInfo);\n\n\t\tif (this.sourceInlineCompletion.shownCommand) {\n\t\t\tawait commandService.executeCommand(this.sourceInlineCompletion.shownCommand.id, ...(this.sourceInlineCompletion.shownCommand.arguments || []));\n\t\t}\n\t}\n\n\tpublic reportPartialAccept(acceptedCharacters: number, info: PartialAcceptInfo, partialAcceptance: PartialAcceptance) {\n\t\tthis._partiallyAcceptedCount++;\n\t\tthis._partiallyAcceptedSinceOriginal.characters += partialAcceptance.characters;\n\t\tthis._partiallyAcceptedSinceOriginal.ratio = Math.min(this._partiallyAcceptedSinceOriginal.ratio + (1 - this._partiallyAcceptedSinceOriginal.ratio) * partialAcceptance.ratio, 1);\n\t\tthis._partiallyAcceptedSinceOriginal.count += partialAcceptance.count;\n\n\t\tthis.source.provider.handlePartialAccept?.(\n\t\t\tthis.source.inlineSuggestions,\n\t\t\tthis.sourceInlineCompletion,\n\t\t\tacceptedCharacters,\n\t\t\tinfo\n\t\t);\n\t}\n\n\t/**\n\t * Sends the end of life event to the provider.\n\t * If no reason is provided, the last set reason is used.\n\t * If no reason was set, the default reason is used.\n\t*/\n\tpublic reportEndOfLife(reason?: InlineCompletionEndOfLifeReason): void {\n\t\tif (this._didReportEndOfLife) {\n\t\t\treturn;\n\t\t}\n\t\tthis._didReportEndOfLife = true;\n\t\tthis.reportInlineEditHidden();\n\n\t\tif (!reason) {\n\t\t\treason = this._lastSetEndOfLifeReason ?? { kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: undefined };\n\t\t}\n\n\t\tif (reason.kind === InlineCompletionEndOfLifeReasonKind.Rejected && this.source.provider.handleRejection) {\n\t\t\tthis.source.provider.handleRejection(this.source.inlineSuggestions, this.sourceInlineCompletion);\n\t\t}\n\n\t\tif (this.source.provider.handleEndOfLifetime) {\n\t\t\tconst summary: LifetimeSummary = {\n\t\t\t\trequestUuid: this.context.requestUuid,\n\t\t\t\tcorrelationId: this._correlationId,\n\t\t\t\tselectedSuggestionInfo: !!this.context.selectedSuggestionInfo,\n\t\t\t\tpartiallyAccepted: this._partiallyAcceptedCount,\n\t\t\t\tpartiallyAcceptedCountSinceOriginal: this._partiallyAcceptedSinceOriginal.count,\n\t\t\t\tpartiallyAcceptedRatioSinceOriginal: this._partiallyAcceptedSinceOriginal.ratio,\n\t\t\t\tpartiallyAcceptedCharactersSinceOriginal: this._partiallyAcceptedSinceOriginal.characters,\n\t\t\t\tshown: this._didShow,\n\t\t\t\tshownDuration: this._shownDuration,\n\t\t\t\tshownDurationUncollapsed: this._showUncollapsedDuration,\n\t\t\t\tpreceeded: this._isPreceeded,\n\t\t\t\ttimeUntilShown: this._timeUntilShown,\n\t\t\t\ttimeUntilProviderRequest: this._providerRequestInfo.startTime - this._requestInfo.startTime,\n\t\t\t\ttimeUntilProviderResponse: this._providerRequestInfo.endTime - this._requestInfo.startTime,\n\t\t\t\teditorType: this._viewData.editorType,\n\t\t\t\tlanguageId: this._requestInfo.languageId,\n\t\t\t\trequestReason: this._requestInfo.reason,\n\t\t\t\tviewKind: this._viewData.viewKind,\n\t\t\t\tnotShownReason: this._notShownReason,\n\t\t\t\ttypingInterval: this._requestInfo.typingInterval,\n\t\t\t\ttypingIntervalCharacterCount: this._requestInfo.typingIntervalCharacterCount,\n\t\t\t\tavailableProviders: this._requestInfo.availableProviders.map(p => p.toString()).join(','),\n\t\t\t\t...this._viewData.renderData,\n\t\t\t};\n\t\t\tthis.source.provider.handleEndOfLifetime(this.source.inlineSuggestions, this.sourceInlineCompletion, reason, summary);\n\t\t}\n\t}\n\n\tpublic setIsPreceeded(partialAccepts: PartialAcceptance): void {\n\t\tthis._isPreceeded = true;\n\n\t\tif (this._partiallyAcceptedSinceOriginal.characters !== 0 || this._partiallyAcceptedSinceOriginal.ratio !== 0 || this._partiallyAcceptedSinceOriginal.count !== 0) {\n\t\t\tconsole.warn('Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded.');\n\t\t}\n\t\tthis._partiallyAcceptedSinceOriginal = partialAccepts;\n\t}\n\n\tpublic setNotShownReason(reason: string): void {\n\t\tthis._notShownReason ??= reason;\n\t}\n\n\t/**\n\t * Sets the end of life reason, but does not send the event to the provider yet.\n\t*/\n\tpublic setEndOfLifeReason(reason: InlineCompletionEndOfLifeReason): void {\n\t\tthis.reportInlineEditHidden();\n\t\tthis._lastSetEndOfLifeReason = reason;\n\t}\n\n\tprivate updateShownDuration(viewKind: InlineCompletionViewKind) {\n\t\tconst timeNow = Date.now();\n\t\tif (!this._showStartTime) {\n\t\t\tthis._showStartTime = timeNow;\n\t\t}\n\n\t\tconst isCollapsed = viewKind === InlineCompletionViewKind.Collapsed;\n\t\tif (!isCollapsed && this._showUncollapsedStartTime === undefined) {\n\t\t\tthis._showUncollapsedStartTime = timeNow;\n\t\t}\n\n\t\tif (isCollapsed && this._showUncollapsedStartTime !== undefined) {\n\t\t\tthis._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime;\n\t\t}\n\t}\n\n\tprivate reportInlineEditHidden() {\n\t\tif (this._showStartTime === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tconst timeNow = Date.now();\n\t\tthis._shownDuration += timeNow - this._showStartTime;\n\t\tthis._showStartTime = undefined;\n\n\t\tif (this._showUncollapsedStartTime === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tthis._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime;\n\t\tthis._showUncollapsedStartTime = undefined;\n\t}\n}\n\nexport interface SnippetInfo {\n\tsnippet: string;\n\t/* Could be different than the main range */\n\trange: Range;\n}\n\nexport enum InlineCompletionEditorType {\n\tTextEditor = 'textEditor',\n\tDiffEditor = 'diffEditor',\n\tNotebook = 'notebook',\n}\n\n/**\n * A ref counted pointer to the computed `InlineCompletions` and the `InlineCompletionsProvider` that\n * computed them.\n */\nexport class InlineSuggestionList {\n\tprivate refCount = 0;\n\tconstructor(\n\t\tpublic readonly inlineSuggestions: InlineCompletions,\n\t\tpublic readonly inlineSuggestionsData: readonly InlineSuggestData[],\n\t\tpublic readonly provider: InlineCompletionsProvider,\n\t) { }\n\n\taddRef(): void {\n\t\tthis.refCount++;\n\t}\n\n\tremoveRef(reason: InlineCompletionsDisposeReason = { kind: 'other' }): void {\n\t\tthis.refCount--;\n\t\tif (this.refCount === 0) {\n\t\t\tfor (const item of this.inlineSuggestionsData) {\n\t\t\t\t// Fallback if it has not been called before\n\t\t\t\titem.reportEndOfLife();\n\t\t\t}\n\t\t\tthis.provider.disposeInlineCompletions(this.inlineSuggestions, reason);\n\t\t}\n\t}\n}\n\nfunction getDefaultRange(position: Position, model: ITextModel): Range {\n\tconst word = model.getWordAtPosition(position);\n\tconst maxColumn = model.getLineMaxColumn(position.lineNumber);\n\t// By default, always replace up until the end of the current line.\n\t// This default might be subject to change!\n\treturn word\n\t\t? new Range(position.lineNumber, word.startColumn, position.lineNumber, maxColumn)\n\t\t: Range.fromPositions(position, position.with(undefined, maxColumn));\n}\n\nfunction closeBrackets(text: string, position: Position, model: ITextModel, languageConfigurationService: ILanguageConfigurationService): string {\n\tconst currentLine = model.getLineContent(position.lineNumber);\n\tconst edit = StringReplacement.replace(new OffsetRange(position.column - 1, currentLine.length), text);\n\n\tconst proposedLineTokens = model.tokenization.tokenizeLinesAt(position.lineNumber, [edit.replace(currentLine)]);\n\tconst textTokens = proposedLineTokens?.[0].sliceZeroCopy(edit.getRangeAfterReplace());\n\tif (!textTokens) {\n\t\treturn text;\n\t}\n\n\tconst fixedText = fixBracketsInLine(textTokens, languageConfigurationService);\n\treturn fixedText;\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 { assertNever } from '../../../../../base/common/assert.js';\nimport { AsyncIterableProducer } from '../../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { onUnexpectedExternalError } from '../../../../../base/common/errors.js';\nimport { Disposable, IDisposable } from '../../../../../base/common/lifecycle.js';\nimport { prefixedUuid } from '../../../../../base/common/uuid.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { ISingleEditOperation } from '../../../../common/core/editOperation.js';\nimport { StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { TextReplacement } from '../../../../common/core/edits/textEdit.js';\nimport { InlineCompletionEndOfLifeReason, InlineCompletionEndOfLifeReasonKind, InlineCompletion, InlineCompletionContext, InlineCompletions, InlineCompletionsProvider, PartialAcceptInfo, InlineCompletionsDisposeReason, LifetimeSummary, ProviderId, InlineCompletionHint } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { fixBracketsInLine } from '../../../../common/model/bracketPairsTextModelPart/fixBrackets.js';\nimport { SnippetParser, Text } from '../../../snippet/browser/snippetParser.js';\nimport { getReadonlyEmptyArray } from '../utils.js';\nimport { groupByMap } from '../../../../../base/common/collections.js';\nimport { DirectedGraph } from './graph.js';\nimport { CachedFunction } from '../../../../../base/common/cache.js';\nimport { InlineCompletionViewData, InlineCompletionViewKind } from '../view/inlineEdits/inlineEditsViewInterface.js';\nimport { isDefined } from '../../../../../base/common/types.js';\nimport { inlineCompletionIsVisible } from './inlineSuggestionItem.js';\nimport { EditDeltaInfo } from '../../../../common/textModelEditSource.js';\nimport { URI } from '../../../../../base/common/uri.js';\n\nexport type InlineCompletionContextWithoutUuid = Omit<InlineCompletionContext, 'requestUuid'>;\n\nexport function provideInlineCompletions(\n\tproviders: InlineCompletionsProvider[],\n\tposition: Position,\n\tmodel: ITextModel,\n\tcontext: InlineCompletionContextWithoutUuid,\n\trequestInfo: InlineSuggestRequestInfo,\n\tlanguageConfigurationService?: ILanguageConfigurationService,\n): IInlineCompletionProviderResult {\n\tconst requestUuid = prefixedUuid('icr');\n\n\tconst cancellationTokenSource = new CancellationTokenSource();\n\tlet cancelReason: InlineCompletionsDisposeReason | undefined = undefined;\n\n\tconst contextWithUuid: InlineCompletionContext = { ...context, requestUuid: requestUuid };\n\n\tconst defaultReplaceRange = getDefaultRange(position, model);\n\n\tconst providersByGroupId = groupByMap(providers, p => p.groupId);\n\tconst yieldsToGraph = DirectedGraph.from(providers, p => {\n\t\treturn p.yieldsToGroupIds?.flatMap(groupId => providersByGroupId.get(groupId) ?? []) ?? [];\n\t});\n\tconst { foundCycles } = yieldsToGraph.removeCycles();\n\tif (foundCycles.length > 0) {\n\t\tonUnexpectedExternalError(new Error(`Inline completions: cyclic yield-to dependency detected.`\n\t\t\t+ ` Path: ${foundCycles.map(s => s.toString ? s.toString() : ('' + s)).join(' -> ')}`));\n\t}\n\n\tlet runningCount = 0;\n\n\tconst queryProvider = new CachedFunction(async (provider: InlineCompletionsProvider<InlineCompletions>): Promise<InlineSuggestionList | undefined> => {\n\t\ttry {\n\t\t\trunningCount++;\n\t\t\tif (cancellationTokenSource.token.isCancellationRequested) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst yieldsTo = yieldsToGraph.getOutgoing(provider);\n\t\t\tfor (const p of yieldsTo) {\n\t\t\t\t// We know there is no cycle, so no recursion here\n\t\t\t\tconst result = await queryProvider.get(p);\n\t\t\t\tif (result) {\n\t\t\t\t\tfor (const item of result.inlineSuggestions.items) {\n\t\t\t\t\t\tif (item.isInlineEdit || typeof item.insertText !== 'string' && item.insertText !== undefined) {\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (item.insertText !== undefined) {\n\t\t\t\t\t\t\tconst t = new TextReplacement(Range.lift(item.range) ?? defaultReplaceRange, item.insertText);\n\t\t\t\t\t\t\tif (inlineCompletionIsVisible(t, undefined, model, position)) {\n\t\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// else: inline completion is not visible, so lets not block\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet result: InlineCompletions | null | undefined;\n\t\t\tconst providerStartTime = Date.now();\n\t\t\ttry {\n\t\t\t\tresult = await provider.provideInlineCompletions(model, position, contextWithUuid, cancellationTokenSource.token);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedExternalError(e);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst providerEndTime = Date.now();\n\n\t\t\tif (!result) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst data: InlineSuggestData[] = [];\n\t\t\tconst list = new InlineSuggestionList(result, data, provider);\n\t\t\tlist.addRef();\n\t\t\trunWhenCancelled(cancellationTokenSource.token, () => {\n\t\t\t\treturn list.removeRef(cancelReason);\n\t\t\t});\n\t\t\tif (cancellationTokenSource.token.isCancellationRequested) {\n\t\t\t\treturn undefined; // The list is disposed now, so we cannot return the items!\n\t\t\t}\n\n\t\t\tfor (const item of result.items) {\n\t\t\t\tdata.push(toInlineSuggestData(item, list, defaultReplaceRange, model, languageConfigurationService, contextWithUuid, requestInfo, { startTime: providerStartTime, endTime: providerEndTime }));\n\t\t\t}\n\n\t\t\treturn list;\n\t\t} finally {\n\t\t\trunningCount--;\n\t\t}\n\t});\n\n\tconst inlineCompletionLists = AsyncIterableProducer.fromPromisesResolveOrder(providers.map(p => queryProvider.get(p))).filter(isDefined);\n\n\treturn {\n\t\tcontextWithUuid,\n\t\tget didAllProvidersReturn() { return runningCount === 0; },\n\t\tlists: inlineCompletionLists,\n\t\tcancelAndDispose: reason => {\n\t\t\tif (cancelReason !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcancelReason = reason;\n\t\t\tcancellationTokenSource.dispose(true);\n\t\t}\n\t};\n}\n\n/** If the token is eventually cancelled, this will not leak either. */\nexport function runWhenCancelled(token: CancellationToken, callback: () => void): IDisposable {\n\tif (token.isCancellationRequested) {\n\t\tcallback();\n\t\treturn Disposable.None;\n\t} else {\n\t\tconst listener = token.onCancellationRequested(() => {\n\t\t\tlistener.dispose();\n\t\t\tcallback();\n\t\t});\n\t\treturn { dispose: () => listener.dispose() };\n\t}\n}\n\nexport interface IInlineCompletionProviderResult {\n\tget didAllProvidersReturn(): boolean;\n\n\tcontextWithUuid: InlineCompletionContext;\n\n\tcancelAndDispose(reason: InlineCompletionsDisposeReason): void;\n\n\tlists: AsyncIterableProducer<InlineSuggestionList>;\n}\n\nfunction toInlineSuggestData(\n\tinlineCompletion: InlineCompletion,\n\tsource: InlineSuggestionList,\n\tdefaultReplaceRange: Range,\n\ttextModel: ITextModel,\n\tlanguageConfigurationService: ILanguageConfigurationService | undefined,\n\tcontext: InlineCompletionContext,\n\trequestInfo: InlineSuggestRequestInfo,\n\tproviderRequestInfo: InlineSuggestProviderRequestInfo,\n): InlineSuggestData {\n\tlet insertText: string;\n\tlet snippetInfo: SnippetInfo | undefined;\n\tlet range = inlineCompletion.range ? Range.lift(inlineCompletion.range) : defaultReplaceRange;\n\n\tif (typeof inlineCompletion.insertText === 'string') {\n\t\tinsertText = inlineCompletion.insertText;\n\n\t\tif (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n\t\t\tinsertText = closeBrackets(\n\t\t\t\tinsertText,\n\t\t\t\trange.getStartPosition(),\n\t\t\t\ttextModel,\n\t\t\t\tlanguageConfigurationService\n\t\t\t);\n\n\t\t\t// Modify range depending on if brackets are added or removed\n\t\t\tconst diff = insertText.length - inlineCompletion.insertText.length;\n\t\t\tif (diff !== 0) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n\t\t\t}\n\t\t}\n\n\t\tsnippetInfo = undefined;\n\t} else if (inlineCompletion.insertText === undefined) {\n\t\tinsertText = ''; // TODO use undefined\n\t\tsnippetInfo = undefined;\n\t\trange = new Range(1, 1, 1, 1);\n\t} else if ('snippet' in inlineCompletion.insertText) {\n\t\tconst preBracketCompletionLength = inlineCompletion.insertText.snippet.length;\n\n\t\tif (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n\t\t\tinlineCompletion.insertText.snippet = closeBrackets(\n\t\t\t\tinlineCompletion.insertText.snippet,\n\t\t\t\trange.getStartPosition(),\n\t\t\t\ttextModel,\n\t\t\t\tlanguageConfigurationService\n\t\t\t);\n\n\t\t\t// Modify range depending on if brackets are added or removed\n\t\t\tconst diff = inlineCompletion.insertText.snippet.length - preBracketCompletionLength;\n\t\t\tif (diff !== 0) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n\t\t\t}\n\t\t}\n\n\t\tconst snippet = new SnippetParser().parse(inlineCompletion.insertText.snippet);\n\n\t\tif (snippet.children.length === 1 && snippet.children[0] instanceof Text) {\n\t\t\tinsertText = snippet.children[0].value;\n\t\t\tsnippetInfo = undefined;\n\t\t} else {\n\t\t\tinsertText = snippet.toString();\n\t\t\tsnippetInfo = {\n\t\t\t\tsnippet: inlineCompletion.insertText.snippet,\n\t\t\t\trange: range\n\t\t\t};\n\t\t}\n\t} else {\n\t\tassertNever(inlineCompletion.insertText);\n\t}\n\n\treturn new InlineSuggestData(\n\t\trange,\n\t\tinsertText,\n\t\tsnippetInfo,\n\t\tURI.revive(inlineCompletion.uri),\n\t\tinlineCompletion.hint,\n\t\tinlineCompletion.additionalTextEdits || getReadonlyEmptyArray(),\n\t\tinlineCompletion,\n\t\tsource,\n\t\tcontext,\n\t\tinlineCompletion.isInlineEdit ?? false,\n\t\trequestInfo,\n\t\tproviderRequestInfo,\n\t\tinlineCompletion.correlationId,\n\t);\n}\n\nexport type InlineSuggestRequestInfo = {\n\tstartTime: number;\n\teditorType: InlineCompletionEditorType;\n\tlanguageId: string;\n\treason: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tavailableProviders: ProviderId[];\n};\n\nexport type InlineSuggestProviderRequestInfo = {\n\tstartTime: number;\n\tendTime: number;\n};\n\nexport type PartialAcceptance = {\n\tcharacters: number;\n\tcount: number;\n\tratio: number;\n};\n\nexport type InlineSuggestViewData = {\n\teditorType: InlineCompletionEditorType;\n\trenderData?: InlineCompletionViewData;\n\tviewKind?: InlineCompletionViewKind;\n};\n\nexport class InlineSuggestData {\n\tprivate _didShow = false;\n\tprivate _timeUntilShown: number | undefined = undefined;\n\tprivate _showStartTime: number | undefined = undefined;\n\tprivate _shownDuration: number = 0;\n\tprivate _showUncollapsedStartTime: number | undefined = undefined;\n\tprivate _showUncollapsedDuration: number = 0;\n\tprivate _notShownReason: string | undefined = undefined;\n\n\tprivate _viewData: InlineSuggestViewData;\n\tprivate _didReportEndOfLife = false;\n\tprivate _lastSetEndOfLifeReason: InlineCompletionEndOfLifeReason | undefined = undefined;\n\tprivate _isPreceeded = false;\n\tprivate _partiallyAcceptedCount = 0;\n\tprivate _partiallyAcceptedSinceOriginal: PartialAcceptance = { characters: 0, ratio: 0, count: 0 };\n\n\tconstructor(\n\t\tpublic readonly range: Range,\n\t\tpublic readonly insertText: string,\n\t\tpublic readonly snippetInfo: SnippetInfo | undefined,\n\t\tpublic readonly uri: URI | undefined,\n\t\tpublic readonly hint: InlineCompletionHint | undefined,\n\t\tpublic readonly additionalTextEdits: readonly ISingleEditOperation[],\n\n\t\tpublic readonly sourceInlineCompletion: InlineCompletion,\n\t\tpublic readonly source: InlineSuggestionList,\n\t\tpublic readonly context: InlineCompletionContext,\n\t\tpublic readonly isInlineEdit: boolean,\n\n\t\tprivate readonly _requestInfo: InlineSuggestRequestInfo,\n\t\tprivate readonly _providerRequestInfo: InlineSuggestProviderRequestInfo,\n\t\tprivate readonly _correlationId: string | undefined,\n\t) {\n\t\tthis._viewData = { editorType: _requestInfo.editorType };\n\t}\n\n\tpublic get showInlineEditMenu() { return this.sourceInlineCompletion.showInlineEditMenu ?? false; }\n\n\tpublic get partialAccepts(): PartialAcceptance { return this._partiallyAcceptedSinceOriginal; }\n\n\tpublic async reportInlineEditShown(commandService: ICommandService, updatedInsertText: string, viewKind: InlineCompletionViewKind, viewData: InlineCompletionViewData): Promise<void> {\n\t\tthis.updateShownDuration(viewKind);\n\n\t\tif (this._didShow) {\n\t\t\treturn;\n\t\t}\n\t\tthis._didShow = true;\n\t\tthis._viewData.viewKind = viewKind;\n\t\tthis._viewData.renderData = viewData;\n\t\tthis._timeUntilShown = Date.now() - this._requestInfo.startTime;\n\n\t\tconst editDeltaInfo = new EditDeltaInfo(viewData.lineCountModified, viewData.lineCountOriginal, viewData.characterCountModified, viewData.characterCountOriginal);\n\t\tthis.source.provider.handleItemDidShow?.(this.source.inlineSuggestions, this.sourceInlineCompletion, updatedInsertText, editDeltaInfo);\n\n\t\tif (this.sourceInlineCompletion.shownCommand) {\n\t\t\tawait commandService.executeCommand(this.sourceInlineCompletion.shownCommand.id, ...(this.sourceInlineCompletion.shownCommand.arguments || []));\n\t\t}\n\t}\n\n\tpublic reportPartialAccept(acceptedCharacters: number, info: PartialAcceptInfo, partialAcceptance: PartialAcceptance) {\n\t\tthis._partiallyAcceptedCount++;\n\t\tthis._partiallyAcceptedSinceOriginal.characters += partialAcceptance.characters;\n\t\tthis._partiallyAcceptedSinceOriginal.ratio = Math.min(this._partiallyAcceptedSinceOriginal.ratio + (1 - this._partiallyAcceptedSinceOriginal.ratio) * partialAcceptance.ratio, 1);\n\t\tthis._partiallyAcceptedSinceOriginal.count += partialAcceptance.count;\n\n\t\tthis.source.provider.handlePartialAccept?.(\n\t\t\tthis.source.inlineSuggestions,\n\t\t\tthis.sourceInlineCompletion,\n\t\t\tacceptedCharacters,\n\t\t\tinfo\n\t\t);\n\t}\n\n\t/**\n\t * Sends the end of life event to the provider.\n\t * If no reason is provided, the last set reason is used.\n\t * If no reason was set, the default reason is used.\n\t*/\n\tpublic reportEndOfLife(reason?: InlineCompletionEndOfLifeReason): void {\n\t\tif (this._didReportEndOfLife) {\n\t\t\treturn;\n\t\t}\n\t\tthis._didReportEndOfLife = true;\n\t\tthis.reportInlineEditHidden();\n\n\t\tif (!reason) {\n\t\t\treason = this._lastSetEndOfLifeReason ?? { kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: undefined };\n\t\t}\n\n\t\tif (reason.kind === InlineCompletionEndOfLifeReasonKind.Rejected && this.source.provider.handleRejection) {\n\t\t\tthis.source.provider.handleRejection(this.source.inlineSuggestions, this.sourceInlineCompletion);\n\t\t}\n\n\t\tif (this.source.provider.handleEndOfLifetime) {\n\t\t\tconst summary: LifetimeSummary = {\n\t\t\t\trequestUuid: this.context.requestUuid,\n\t\t\t\tcorrelationId: this._correlationId,\n\t\t\t\tselectedSuggestionInfo: !!this.context.selectedSuggestionInfo,\n\t\t\t\tpartiallyAccepted: this._partiallyAcceptedCount,\n\t\t\t\tpartiallyAcceptedCountSinceOriginal: this._partiallyAcceptedSinceOriginal.count,\n\t\t\t\tpartiallyAcceptedRatioSinceOriginal: this._partiallyAcceptedSinceOriginal.ratio,\n\t\t\t\tpartiallyAcceptedCharactersSinceOriginal: this._partiallyAcceptedSinceOriginal.characters,\n\t\t\t\tshown: this._didShow,\n\t\t\t\tshownDuration: this._shownDuration,\n\t\t\t\tshownDurationUncollapsed: this._showUncollapsedDuration,\n\t\t\t\tpreceeded: this._isPreceeded,\n\t\t\t\ttimeUntilShown: this._timeUntilShown,\n\t\t\t\ttimeUntilProviderRequest: this._providerRequestInfo.startTime - this._requestInfo.startTime,\n\t\t\t\ttimeUntilProviderResponse: this._providerRequestInfo.endTime - this._requestInfo.startTime,\n\t\t\t\teditorType: this._viewData.editorType,\n\t\t\t\tlanguageId: this._requestInfo.languageId,\n\t\t\t\trequestReason: this._requestInfo.reason,\n\t\t\t\tviewKind: this._viewData.viewKind,\n\t\t\t\tnotShownReason: this._notShownReason,\n\t\t\t\ttypingInterval: this._requestInfo.typingInterval,\n\t\t\t\ttypingIntervalCharacterCount: this._requestInfo.typingIntervalCharacterCount,\n\t\t\t\tavailableProviders: this._requestInfo.availableProviders.map(p => p.toString()).join(','),\n\t\t\t\t...this._viewData.renderData,\n\t\t\t};\n\t\t\tthis.source.provider.handleEndOfLifetime(this.source.inlineSuggestions, this.sourceInlineCompletion, reason, summary);\n\t\t}\n\t}\n\n\tpublic setIsPreceeded(partialAccepts: PartialAcceptance): void {\n\t\tthis._isPreceeded = true;\n\n\t\tif (this._partiallyAcceptedSinceOriginal.characters !== 0 || this._partiallyAcceptedSinceOriginal.ratio !== 0 || this._partiallyAcceptedSinceOriginal.count !== 0) {\n\t\t\tconsole.warn('Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded.');\n\t\t}\n\t\tthis._partiallyAcceptedSinceOriginal = partialAccepts;\n\t}\n\n\tpublic setNotShownReason(reason: string): void {\n\t\tthis._notShownReason ??= reason;\n\t}\n\n\t/**\n\t * Sets the end of life reason, but does not send the event to the provider yet.\n\t*/\n\tpublic setEndOfLifeReason(reason: InlineCompletionEndOfLifeReason): void {\n\t\tthis.reportInlineEditHidden();\n\t\tthis._lastSetEndOfLifeReason = reason;\n\t}\n\n\tprivate updateShownDuration(viewKind: InlineCompletionViewKind) {\n\t\tconst timeNow = Date.now();\n\t\tif (!this._showStartTime) {\n\t\t\tthis._showStartTime = timeNow;\n\t\t}\n\n\t\tconst isCollapsed = viewKind === InlineCompletionViewKind.Collapsed;\n\t\tif (!isCollapsed && this._showUncollapsedStartTime === undefined) {\n\t\t\tthis._showUncollapsedStartTime = timeNow;\n\t\t}\n\n\t\tif (isCollapsed && this._showUncollapsedStartTime !== undefined) {\n\t\t\tthis._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime;\n\t\t}\n\t}\n\n\tprivate reportInlineEditHidden() {\n\t\tif (this._showStartTime === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tconst timeNow = Date.now();\n\t\tthis._shownDuration += timeNow - this._showStartTime;\n\t\tthis._showStartTime = undefined;\n\n\t\tif (this._showUncollapsedStartTime === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tthis._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime;\n\t\tthis._showUncollapsedStartTime = undefined;\n\t}\n}\n\nexport interface SnippetInfo {\n\tsnippet: string;\n\t/* Could be different than the main range */\n\trange: Range;\n}\n\nexport enum InlineCompletionEditorType {\n\tTextEditor = 'textEditor',\n\tDiffEditor = 'diffEditor',\n\tNotebook = 'notebook',\n}\n\n/**\n * A ref counted pointer to the computed `InlineCompletions` and the `InlineCompletionsProvider` that\n * computed them.\n */\nexport class InlineSuggestionList {\n\tprivate refCount = 0;\n\tconstructor(\n\t\tpublic readonly inlineSuggestions: InlineCompletions,\n\t\tpublic readonly inlineSuggestionsData: readonly InlineSuggestData[],\n\t\tpublic readonly provider: InlineCompletionsProvider,\n\t) { }\n\n\taddRef(): void {\n\t\tthis.refCount++;\n\t}\n\n\tremoveRef(reason: InlineCompletionsDisposeReason = { kind: 'other' }): void {\n\t\tthis.refCount--;\n\t\tif (this.refCount === 0) {\n\t\t\tfor (const item of this.inlineSuggestionsData) {\n\t\t\t\t// Fallback if it has not been called before\n\t\t\t\titem.reportEndOfLife();\n\t\t\t}\n\t\t\tthis.provider.disposeInlineCompletions(this.inlineSuggestions, reason);\n\t\t}\n\t}\n}\n\nfunction getDefaultRange(position: Position, model: ITextModel): Range {\n\tconst word = model.getWordAtPosition(position);\n\tconst maxColumn = model.getLineMaxColumn(position.lineNumber);\n\t// By default, always replace up until the end of the current line.\n\t// This default might be subject to change!\n\treturn word\n\t\t? new Range(position.lineNumber, word.startColumn, position.lineNumber, maxColumn)\n\t\t: Range.fromPositions(position, position.with(undefined, maxColumn));\n}\n\nfunction closeBrackets(text: string, position: Position, model: ITextModel, languageConfigurationService: ILanguageConfigurationService): string {\n\tconst currentLine = model.getLineContent(position.lineNumber);\n\tconst edit = StringReplacement.replace(new OffsetRange(position.column - 1, currentLine.length), text);\n\n\tconst proposedLineTokens = model.tokenization.tokenizeLinesAt(position.lineNumber, [edit.replace(currentLine)]);\n\tconst textTokens = proposedLineTokens?.[0].sliceZeroCopy(edit.getRangeAfterReplace());\n\tif (!textTokens) {\n\t\treturn text;\n\t}\n\n\tconst fixedText = fixBracketsInLine(textTokens, languageConfigurationService);\n\treturn fixedText;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.ts","vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAqB,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACrG,OAAO,EAAE,UAAU,EAAe,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAGlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,WAA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AAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,QAAkB,EAAE,KAAiB,EAAE,4BAA2D;IACtI,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAEvG,MAAM,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAChH,MAAM,UAAU,GAAG,kBAAkB,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACtF,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,SAAS,GAAG,iBAAiB,CAAC,UAAU,EAAE,4BAA4B,CAAC,CAAC;IAC9E,OAAO,SAAS,CAAC;AAClB,CAAC","file":"provideInlineCompletions.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 { assertNever } from '../../../../../base/common/assert.js';\nimport { AsyncIterableProducer } from '../../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { BugIndicatingError, onUnexpectedExternalError } from '../../../../../base/common/errors.js';\nimport { Disposable, IDisposable } from '../../../../../base/common/lifecycle.js';\nimport { prefixedUuid } from '../../../../../base/common/uuid.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { ISingleEditOperation } from '../../../../common/core/editOperation.js';\nimport { StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { TextReplacement } from '../../../../common/core/edits/textEdit.js';\nimport { InlineCompletionEndOfLifeReason, InlineCompletionEndOfLifeReasonKind, InlineCompletion, InlineCompletionContext, InlineCompletions, InlineCompletionsProvider, PartialAcceptInfo, InlineCompletionsDisposeReason, LifetimeSummary, ProviderId, IInlineCompletionHint, Command } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { fixBracketsInLine } from '../../../../common/model/bracketPairsTextModelPart/fixBrackets.js';\nimport { SnippetParser, Text } from '../../../snippet/browser/snippetParser.js';\nimport { getReadonlyEmptyArray } from '../utils.js';\nimport { groupByMap } from '../../../../../base/common/collections.js';\nimport { DirectedGraph } from './graph.js';\nimport { CachedFunction } from '../../../../../base/common/cache.js';\nimport { InlineCompletionViewData, InlineCompletionViewKind } from '../view/inlineEdits/inlineEditsViewInterface.js';\nimport { isDefined } from '../../../../../base/common/types.js';\nimport { inlineCompletionIsVisible } from './inlineSuggestionItem.js';\nimport { EditDeltaInfo } from '../../../../common/textModelEditSource.js';\nimport { URI } from '../../../../../base/common/uri.js';\n\nexport type InlineCompletionContextWithoutUuid = Omit<InlineCompletionContext, 'requestUuid'>;\n\nexport function provideInlineCompletions(\n\tproviders: InlineCompletionsProvider[],\n\tposition: Position,\n\tmodel: ITextModel,\n\tcontext: InlineCompletionContextWithoutUuid,\n\trequestInfo: InlineSuggestRequestInfo,\n\tlanguageConfigurationService?: ILanguageConfigurationService,\n): IInlineCompletionProviderResult {\n\tconst requestUuid = prefixedUuid('icr');\n\n\tconst cancellationTokenSource = new CancellationTokenSource();\n\tlet cancelReason: InlineCompletionsDisposeReason | undefined = undefined;\n\n\tconst contextWithUuid: InlineCompletionContext = { ...context, requestUuid: requestUuid };\n\n\tconst defaultReplaceRange = getDefaultRange(position, model);\n\n\tconst providersByGroupId = groupByMap(providers, p => p.groupId);\n\tconst yieldsToGraph = DirectedGraph.from(providers, p => {\n\t\treturn p.yieldsToGroupIds?.flatMap(groupId => providersByGroupId.get(groupId) ?? []) ?? [];\n\t});\n\tconst { foundCycles } = yieldsToGraph.removeCycles();\n\tif (foundCycles.length > 0) {\n\t\tonUnexpectedExternalError(new Error(`Inline completions: cyclic yield-to dependency detected.`\n\t\t\t+ ` Path: ${foundCycles.map(s => s.toString ? s.toString() : ('' + s)).join(' -> ')}`));\n\t}\n\n\tlet runningCount = 0;\n\n\tconst queryProvider = new CachedFunction(async (provider: InlineCompletionsProvider<InlineCompletions>): Promise<InlineSuggestionList | undefined> => {\n\t\ttry {\n\t\t\trunningCount++;\n\t\t\tif (cancellationTokenSource.token.isCancellationRequested) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst yieldsTo = yieldsToGraph.getOutgoing(provider);\n\t\t\tfor (const p of yieldsTo) {\n\t\t\t\t// We know there is no cycle, so no recursion here\n\t\t\t\tconst result = await queryProvider.get(p);\n\t\t\t\tif (result) {\n\t\t\t\t\tfor (const item of result.inlineSuggestions.items) {\n\t\t\t\t\t\tif (item.isInlineEdit || typeof item.insertText !== 'string' && item.insertText !== undefined) {\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (item.insertText !== undefined) {\n\t\t\t\t\t\t\tconst t = new TextReplacement(Range.lift(item.range) ?? defaultReplaceRange, item.insertText);\n\t\t\t\t\t\t\tif (inlineCompletionIsVisible(t, undefined, model, position)) {\n\t\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// else: inline completion is not visible, so lets not block\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet result: InlineCompletions | null | undefined;\n\t\t\tconst providerStartTime = Date.now();\n\t\t\ttry {\n\t\t\t\tresult = await provider.provideInlineCompletions(model, position, contextWithUuid, cancellationTokenSource.token);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedExternalError(e);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst providerEndTime = Date.now();\n\n\t\t\tif (!result) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst data: InlineSuggestData[] = [];\n\t\t\tconst list = new InlineSuggestionList(result, data, provider);\n\t\t\tlist.addRef();\n\t\t\trunWhenCancelled(cancellationTokenSource.token, () => {\n\t\t\t\treturn list.removeRef(cancelReason);\n\t\t\t});\n\t\t\tif (cancellationTokenSource.token.isCancellationRequested) {\n\t\t\t\treturn undefined; // The list is disposed now, so we cannot return the items!\n\t\t\t}\n\n\t\t\tfor (const item of result.items) {\n\t\t\t\tdata.push(toInlineSuggestData(item, list, defaultReplaceRange, model, languageConfigurationService, contextWithUuid, requestInfo, { startTime: providerStartTime, endTime: providerEndTime }));\n\t\t\t}\n\n\t\t\treturn list;\n\t\t} finally {\n\t\t\trunningCount--;\n\t\t}\n\t});\n\n\tconst inlineCompletionLists = AsyncIterableProducer.fromPromisesResolveOrder(providers.map(p => queryProvider.get(p))).filter(isDefined);\n\n\treturn {\n\t\tcontextWithUuid,\n\t\tget didAllProvidersReturn() { return runningCount === 0; },\n\t\tlists: inlineCompletionLists,\n\t\tcancelAndDispose: reason => {\n\t\t\tif (cancelReason !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcancelReason = reason;\n\t\t\tcancellationTokenSource.dispose(true);\n\t\t}\n\t};\n}\n\n/** If the token is eventually cancelled, this will not leak either. */\nexport function runWhenCancelled(token: CancellationToken, callback: () => void): IDisposable {\n\tif (token.isCancellationRequested) {\n\t\tcallback();\n\t\treturn Disposable.None;\n\t} else {\n\t\tconst listener = token.onCancellationRequested(() => {\n\t\t\tlistener.dispose();\n\t\t\tcallback();\n\t\t});\n\t\treturn { dispose: () => listener.dispose() };\n\t}\n}\n\nexport interface IInlineCompletionProviderResult {\n\tget didAllProvidersReturn(): boolean;\n\n\tcontextWithUuid: InlineCompletionContext;\n\n\tcancelAndDispose(reason: InlineCompletionsDisposeReason): void;\n\n\tlists: AsyncIterableProducer<InlineSuggestionList>;\n}\n\nfunction toInlineSuggestData(\n\tinlineCompletion: InlineCompletion,\n\tsource: InlineSuggestionList,\n\tdefaultReplaceRange: Range,\n\ttextModel: ITextModel,\n\tlanguageConfigurationService: ILanguageConfigurationService | undefined,\n\tcontext: InlineCompletionContext,\n\trequestInfo: InlineSuggestRequestInfo,\n\tproviderRequestInfo: InlineSuggestProviderRequestInfo,\n): InlineSuggestData {\n\tlet insertText: string;\n\tlet snippetInfo: SnippetInfo | undefined;\n\tlet range = inlineCompletion.range ? Range.lift(inlineCompletion.range) : defaultReplaceRange;\n\n\tif (typeof inlineCompletion.insertText === 'string') {\n\t\tinsertText = inlineCompletion.insertText;\n\n\t\tif (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n\t\t\tinsertText = closeBrackets(\n\t\t\t\tinsertText,\n\t\t\t\trange.getStartPosition(),\n\t\t\t\ttextModel,\n\t\t\t\tlanguageConfigurationService\n\t\t\t);\n\n\t\t\t// Modify range depending on if brackets are added or removed\n\t\t\tconst diff = insertText.length - inlineCompletion.insertText.length;\n\t\t\tif (diff !== 0) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n\t\t\t}\n\t\t}\n\n\t\tsnippetInfo = undefined;\n\t} else if (inlineCompletion.insertText === undefined) {\n\t\tinsertText = ''; // TODO use undefined\n\t\tsnippetInfo = undefined;\n\t\trange = new Range(1, 1, 1, 1);\n\t} else if ('snippet' in inlineCompletion.insertText) {\n\t\tconst preBracketCompletionLength = inlineCompletion.insertText.snippet.length;\n\n\t\tif (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n\t\t\tinlineCompletion.insertText.snippet = closeBrackets(\n\t\t\t\tinlineCompletion.insertText.snippet,\n\t\t\t\trange.getStartPosition(),\n\t\t\t\ttextModel,\n\t\t\t\tlanguageConfigurationService\n\t\t\t);\n\n\t\t\t// Modify range depending on if brackets are added or removed\n\t\t\tconst diff = inlineCompletion.insertText.snippet.length - preBracketCompletionLength;\n\t\t\tif (diff !== 0) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n\t\t\t}\n\t\t}\n\n\t\tconst snippet = new SnippetParser().parse(inlineCompletion.insertText.snippet);\n\n\t\tif (snippet.children.length === 1 && snippet.children[0] instanceof Text) {\n\t\t\tinsertText = snippet.children[0].value;\n\t\t\tsnippetInfo = undefined;\n\t\t} else {\n\t\t\tinsertText = snippet.toString();\n\t\t\tsnippetInfo = {\n\t\t\t\tsnippet: inlineCompletion.insertText.snippet,\n\t\t\t\trange: range\n\t\t\t};\n\t\t}\n\t} else {\n\t\tassertNever(inlineCompletion.insertText);\n\t}\n\n\treturn new InlineSuggestData(\n\t\trange,\n\t\tinsertText,\n\t\tsnippetInfo,\n\t\tURI.revive(inlineCompletion.uri),\n\t\tinlineCompletion.hint,\n\t\tinlineCompletion.additionalTextEdits || getReadonlyEmptyArray(),\n\t\tinlineCompletion,\n\t\tsource,\n\t\tcontext,\n\t\tinlineCompletion.isInlineEdit ?? false,\n\t\tinlineCompletion.supportsRename ?? false,\n\t\tundefined,\n\t\trequestInfo,\n\t\tproviderRequestInfo,\n\t\tinlineCompletion.correlationId,\n\t);\n}\n\nexport type InlineSuggestRequestInfo = {\n\tstartTime: number;\n\teditorType: InlineCompletionEditorType;\n\tlanguageId: string;\n\treason: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tavailableProviders: ProviderId[];\n};\n\nexport type InlineSuggestProviderRequestInfo = {\n\tstartTime: number;\n\tendTime: number;\n};\n\nexport type PartialAcceptance = {\n\tcharacters: number;\n\tcount: number;\n\tratio: number;\n};\n\nexport type RenameInfo = {\n\tcreatedRename: boolean;\n\tduration: number;\n\ttimedOut?: boolean;\n};\n\nexport type InlineSuggestViewData = {\n\teditorType: InlineCompletionEditorType;\n\trenderData?: InlineCompletionViewData;\n\tviewKind?: InlineCompletionViewKind;\n};\n\nexport class InlineSuggestData {\n\tprivate _didShow = false;\n\tprivate _timeUntilShown: number | undefined = undefined;\n\tprivate _showStartTime: number | undefined = undefined;\n\tprivate _shownDuration: number = 0;\n\tprivate _showUncollapsedStartTime: number | undefined = undefined;\n\tprivate _showUncollapsedDuration: number = 0;\n\tprivate _notShownReason: string | undefined = undefined;\n\n\tprivate _viewData: InlineSuggestViewData;\n\tprivate _didReportEndOfLife = false;\n\tprivate _lastSetEndOfLifeReason: InlineCompletionEndOfLifeReason | undefined = undefined;\n\tprivate _isPreceeded = false;\n\tprivate _partiallyAcceptedCount = 0;\n\tprivate _partiallyAcceptedSinceOriginal: PartialAcceptance = { characters: 0, ratio: 0, count: 0 };\n\tprivate _renameInfo: RenameInfo | undefined = undefined;\n\n\tconstructor(\n\t\tpublic readonly range: Range,\n\t\tpublic readonly insertText: string,\n\t\tpublic readonly snippetInfo: SnippetInfo | undefined,\n\t\tpublic readonly uri: URI | undefined,\n\t\tpublic readonly hint: IInlineCompletionHint | undefined,\n\t\tpublic readonly additionalTextEdits: readonly ISingleEditOperation[],\n\n\t\tpublic readonly sourceInlineCompletion: InlineCompletion,\n\t\tpublic readonly source: InlineSuggestionList,\n\t\tpublic readonly context: InlineCompletionContext,\n\t\tpublic readonly isInlineEdit: boolean,\n\t\tpublic readonly supportsRename: boolean,\n\t\tpublic readonly renameCommand: Command | undefined,\n\n\t\tprivate readonly _requestInfo: InlineSuggestRequestInfo,\n\t\tprivate readonly _providerRequestInfo: InlineSuggestProviderRequestInfo,\n\t\tprivate readonly _correlationId: string | undefined,\n\t) {\n\t\tthis._viewData = { editorType: _requestInfo.editorType };\n\t}\n\n\tpublic get showInlineEditMenu() { return this.sourceInlineCompletion.showInlineEditMenu ?? false; }\n\n\tpublic get partialAccepts(): PartialAcceptance { return this._partiallyAcceptedSinceOriginal; }\n\n\tpublic async reportInlineEditShown(commandService: ICommandService, updatedInsertText: string, viewKind: InlineCompletionViewKind, viewData: InlineCompletionViewData): Promise<void> {\n\t\tthis.updateShownDuration(viewKind);\n\n\t\tif (this._didShow) {\n\t\t\treturn;\n\t\t}\n\t\tthis._didShow = true;\n\t\tthis._viewData.viewKind = viewKind;\n\t\tthis._viewData.renderData = viewData;\n\t\tthis._timeUntilShown = Date.now() - this._requestInfo.startTime;\n\n\t\tconst editDeltaInfo = new EditDeltaInfo(viewData.lineCountModified, viewData.lineCountOriginal, viewData.characterCountModified, viewData.characterCountOriginal);\n\t\tthis.source.provider.handleItemDidShow?.(this.source.inlineSuggestions, this.sourceInlineCompletion, updatedInsertText, editDeltaInfo);\n\n\t\tif (this.sourceInlineCompletion.shownCommand) {\n\t\t\tawait commandService.executeCommand(this.sourceInlineCompletion.shownCommand.id, ...(this.sourceInlineCompletion.shownCommand.arguments || []));\n\t\t}\n\t}\n\n\tpublic reportPartialAccept(acceptedCharacters: number, info: PartialAcceptInfo, partialAcceptance: PartialAcceptance) {\n\t\tthis._partiallyAcceptedCount++;\n\t\tthis._partiallyAcceptedSinceOriginal.characters += partialAcceptance.characters;\n\t\tthis._partiallyAcceptedSinceOriginal.ratio = Math.min(this._partiallyAcceptedSinceOriginal.ratio + (1 - this._partiallyAcceptedSinceOriginal.ratio) * partialAcceptance.ratio, 1);\n\t\tthis._partiallyAcceptedSinceOriginal.count += partialAcceptance.count;\n\n\t\tthis.source.provider.handlePartialAccept?.(\n\t\t\tthis.source.inlineSuggestions,\n\t\t\tthis.sourceInlineCompletion,\n\t\t\tacceptedCharacters,\n\t\t\tinfo\n\t\t);\n\t}\n\n\t/**\n\t * Sends the end of life event to the provider.\n\t * If no reason is provided, the last set reason is used.\n\t * If no reason was set, the default reason is used.\n\t*/\n\tpublic reportEndOfLife(reason?: InlineCompletionEndOfLifeReason): void {\n\t\tif (this._didReportEndOfLife) {\n\t\t\treturn;\n\t\t}\n\t\tthis._didReportEndOfLife = true;\n\t\tthis.reportInlineEditHidden();\n\n\t\tif (!reason) {\n\t\t\treason = this._lastSetEndOfLifeReason ?? { kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: undefined };\n\t\t}\n\n\t\tif (reason.kind === InlineCompletionEndOfLifeReasonKind.Rejected && this.source.provider.handleRejection) {\n\t\t\tthis.source.provider.handleRejection(this.source.inlineSuggestions, this.sourceInlineCompletion);\n\t\t}\n\n\t\tif (this.source.provider.handleEndOfLifetime) {\n\t\t\tconst summary: LifetimeSummary = {\n\t\t\t\trequestUuid: this.context.requestUuid,\n\t\t\t\tcorrelationId: this._correlationId,\n\t\t\t\tselectedSuggestionInfo: !!this.context.selectedSuggestionInfo,\n\t\t\t\tpartiallyAccepted: this._partiallyAcceptedCount,\n\t\t\t\tpartiallyAcceptedCountSinceOriginal: this._partiallyAcceptedSinceOriginal.count,\n\t\t\t\tpartiallyAcceptedRatioSinceOriginal: this._partiallyAcceptedSinceOriginal.ratio,\n\t\t\t\tpartiallyAcceptedCharactersSinceOriginal: this._partiallyAcceptedSinceOriginal.characters,\n\t\t\t\tshown: this._didShow,\n\t\t\t\tshownDuration: this._shownDuration,\n\t\t\t\tshownDurationUncollapsed: this._showUncollapsedDuration,\n\t\t\t\tpreceeded: this._isPreceeded,\n\t\t\t\ttimeUntilShown: this._timeUntilShown,\n\t\t\t\ttimeUntilProviderRequest: this._providerRequestInfo.startTime - this._requestInfo.startTime,\n\t\t\t\ttimeUntilProviderResponse: this._providerRequestInfo.endTime - this._requestInfo.startTime,\n\t\t\t\teditorType: this._viewData.editorType,\n\t\t\t\tlanguageId: this._requestInfo.languageId,\n\t\t\t\trequestReason: this._requestInfo.reason,\n\t\t\t\tviewKind: this._viewData.viewKind,\n\t\t\t\tnotShownReason: this._notShownReason,\n\t\t\t\trenameCreated: this._renameInfo?.createdRename ?? false,\n\t\t\t\trenameDuration: this._renameInfo?.duration,\n\t\t\t\trenameTimedOut: this._renameInfo?.timedOut ?? false,\n\t\t\t\ttypingInterval: this._requestInfo.typingInterval,\n\t\t\t\ttypingIntervalCharacterCount: this._requestInfo.typingIntervalCharacterCount,\n\t\t\t\tavailableProviders: this._requestInfo.availableProviders.map(p => p.toString()).join(','),\n\t\t\t\t...this._viewData.renderData,\n\t\t\t};\n\t\t\tthis.source.provider.handleEndOfLifetime(this.source.inlineSuggestions, this.sourceInlineCompletion, reason, summary);\n\t\t}\n\t}\n\n\tpublic setIsPreceeded(partialAccepts: PartialAcceptance): void {\n\t\tthis._isPreceeded = true;\n\n\t\tif (this._partiallyAcceptedSinceOriginal.characters !== 0 || this._partiallyAcceptedSinceOriginal.ratio !== 0 || this._partiallyAcceptedSinceOriginal.count !== 0) {\n\t\t\tconsole.warn('Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded.');\n\t\t}\n\t\tthis._partiallyAcceptedSinceOriginal = partialAccepts;\n\t}\n\n\tpublic setNotShownReason(reason: string): void {\n\t\tthis._notShownReason ??= reason;\n\t}\n\n\t/**\n\t * Sets the end of life reason, but does not send the event to the provider yet.\n\t*/\n\tpublic setEndOfLifeReason(reason: InlineCompletionEndOfLifeReason): void {\n\t\tthis.reportInlineEditHidden();\n\t\tthis._lastSetEndOfLifeReason = reason;\n\t}\n\n\tprivate updateShownDuration(viewKind: InlineCompletionViewKind) {\n\t\tconst timeNow = Date.now();\n\t\tif (!this._showStartTime) {\n\t\t\tthis._showStartTime = timeNow;\n\t\t}\n\n\t\tconst isCollapsed = viewKind === InlineCompletionViewKind.Collapsed;\n\t\tif (!isCollapsed && this._showUncollapsedStartTime === undefined) {\n\t\t\tthis._showUncollapsedStartTime = timeNow;\n\t\t}\n\n\t\tif (isCollapsed && this._showUncollapsedStartTime !== undefined) {\n\t\t\tthis._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime;\n\t\t}\n\t}\n\n\tprivate reportInlineEditHidden() {\n\t\tif (this._showStartTime === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tconst timeNow = Date.now();\n\t\tthis._shownDuration += timeNow - this._showStartTime;\n\t\tthis._showStartTime = undefined;\n\n\t\tif (this._showUncollapsedStartTime === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tthis._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime;\n\t\tthis._showUncollapsedStartTime = undefined;\n\t}\n\n\tpublic setRenameProcessingInfo(info: RenameInfo): void {\n\t\tif (this._renameInfo) {\n\t\t\tthrow new BugIndicatingError('Rename info has already been set.');\n\t\t}\n\t\tthis._renameInfo = info;\n\t}\n\n\tpublic withRename(command: Command, hint: IInlineCompletionHint): InlineSuggestData {\n\t\treturn new InlineSuggestData(\n\t\t\tnew Range(1, 1, 1, 1),\n\t\t\t'',\n\t\t\tthis.snippetInfo,\n\t\t\tthis.uri,\n\t\t\thint,\n\t\t\tthis.additionalTextEdits,\n\t\t\tthis.sourceInlineCompletion,\n\t\t\tthis.source,\n\t\t\tthis.context,\n\t\t\tthis.isInlineEdit,\n\t\t\tthis.supportsRename,\n\t\t\tcommand,\n\t\t\tthis._requestInfo,\n\t\t\tthis._providerRequestInfo,\n\t\t\tthis._correlationId,\n\t\t);\n\t}\n}\n\nexport interface SnippetInfo {\n\tsnippet: string;\n\t/* Could be different than the main range */\n\trange: Range;\n}\n\nexport enum InlineCompletionEditorType {\n\tTextEditor = 'textEditor',\n\tDiffEditor = 'diffEditor',\n\tNotebook = 'notebook',\n}\n\n/**\n * A ref counted pointer to the computed `InlineCompletions` and the `InlineCompletionsProvider` that\n * computed them.\n */\nexport class InlineSuggestionList {\n\tprivate refCount = 0;\n\tconstructor(\n\t\tpublic readonly inlineSuggestions: InlineCompletions,\n\t\tpublic readonly inlineSuggestionsData: readonly InlineSuggestData[],\n\t\tpublic readonly provider: InlineCompletionsProvider,\n\t) { }\n\n\taddRef(): void {\n\t\tthis.refCount++;\n\t}\n\n\tremoveRef(reason: InlineCompletionsDisposeReason = { kind: 'other' }): void {\n\t\tthis.refCount--;\n\t\tif (this.refCount === 0) {\n\t\t\tfor (const item of this.inlineSuggestionsData) {\n\t\t\t\t// Fallback if it has not been called before\n\t\t\t\titem.reportEndOfLife();\n\t\t\t}\n\t\t\tthis.provider.disposeInlineCompletions(this.inlineSuggestions, reason);\n\t\t}\n\t}\n}\n\nfunction getDefaultRange(position: Position, model: ITextModel): Range {\n\tconst word = model.getWordAtPosition(position);\n\tconst maxColumn = model.getLineMaxColumn(position.lineNumber);\n\t// By default, always replace up until the end of the current line.\n\t// This default might be subject to change!\n\treturn word\n\t\t? new Range(position.lineNumber, word.startColumn, position.lineNumber, maxColumn)\n\t\t: Range.fromPositions(position, position.with(undefined, maxColumn));\n}\n\nfunction closeBrackets(text: string, position: Position, model: ITextModel, languageConfigurationService: ILanguageConfigurationService): string {\n\tconst currentLine = model.getLineContent(position.lineNumber);\n\tconst edit = StringReplacement.replace(new OffsetRange(position.column - 1, currentLine.length), text);\n\n\tconst proposedLineTokens = model.tokenization.tokenizeLinesAt(position.lineNumber, [edit.replace(currentLine)]);\n\tconst textTokens = proposedLineTokens?.[0].sliceZeroCopy(edit.getRangeAfterReplace());\n\tif (!textTokens) {\n\t\treturn text;\n\t}\n\n\tconst fixedText = fixBracketsInLine(textTokens, languageConfigurationService);\n\treturn fixedText;\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 { assertNever } from '../../../../../base/common/assert.js';\nimport { AsyncIterableProducer } from '../../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { BugIndicatingError, onUnexpectedExternalError } from '../../../../../base/common/errors.js';\nimport { Disposable, IDisposable } from '../../../../../base/common/lifecycle.js';\nimport { prefixedUuid } from '../../../../../base/common/uuid.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { ISingleEditOperation } from '../../../../common/core/editOperation.js';\nimport { StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { TextReplacement } from '../../../../common/core/edits/textEdit.js';\nimport { InlineCompletionEndOfLifeReason, InlineCompletionEndOfLifeReasonKind, InlineCompletion, InlineCompletionContext, InlineCompletions, InlineCompletionsProvider, PartialAcceptInfo, InlineCompletionsDisposeReason, LifetimeSummary, ProviderId, IInlineCompletionHint, Command } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { fixBracketsInLine } from '../../../../common/model/bracketPairsTextModelPart/fixBrackets.js';\nimport { SnippetParser, Text } from '../../../snippet/browser/snippetParser.js';\nimport { getReadonlyEmptyArray } from '../utils.js';\nimport { groupByMap } from '../../../../../base/common/collections.js';\nimport { DirectedGraph } from './graph.js';\nimport { CachedFunction } from '../../../../../base/common/cache.js';\nimport { InlineCompletionViewData, InlineCompletionViewKind } from '../view/inlineEdits/inlineEditsViewInterface.js';\nimport { isDefined } from '../../../../../base/common/types.js';\nimport { inlineCompletionIsVisible } from './inlineSuggestionItem.js';\nimport { EditDeltaInfo } from '../../../../common/textModelEditSource.js';\nimport { URI } from '../../../../../base/common/uri.js';\n\nexport type InlineCompletionContextWithoutUuid = Omit<InlineCompletionContext, 'requestUuid'>;\n\nexport function provideInlineCompletions(\n\tproviders: InlineCompletionsProvider[],\n\tposition: Position,\n\tmodel: ITextModel,\n\tcontext: InlineCompletionContextWithoutUuid,\n\trequestInfo: InlineSuggestRequestInfo,\n\tlanguageConfigurationService?: ILanguageConfigurationService,\n): IInlineCompletionProviderResult {\n\tconst requestUuid = prefixedUuid('icr');\n\n\tconst cancellationTokenSource = new CancellationTokenSource();\n\tlet cancelReason: InlineCompletionsDisposeReason | undefined = undefined;\n\n\tconst contextWithUuid: InlineCompletionContext = { ...context, requestUuid: requestUuid };\n\n\tconst defaultReplaceRange = getDefaultRange(position, model);\n\n\tconst providersByGroupId = groupByMap(providers, p => p.groupId);\n\tconst yieldsToGraph = DirectedGraph.from(providers, p => {\n\t\treturn p.yieldsToGroupIds?.flatMap(groupId => providersByGroupId.get(groupId) ?? []) ?? [];\n\t});\n\tconst { foundCycles } = yieldsToGraph.removeCycles();\n\tif (foundCycles.length > 0) {\n\t\tonUnexpectedExternalError(new Error(`Inline completions: cyclic yield-to dependency detected.`\n\t\t\t+ ` Path: ${foundCycles.map(s => s.toString ? s.toString() : ('' + s)).join(' -> ')}`));\n\t}\n\n\tlet runningCount = 0;\n\n\tconst queryProvider = new CachedFunction(async (provider: InlineCompletionsProvider<InlineCompletions>): Promise<InlineSuggestionList | undefined> => {\n\t\ttry {\n\t\t\trunningCount++;\n\t\t\tif (cancellationTokenSource.token.isCancellationRequested) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst yieldsTo = yieldsToGraph.getOutgoing(provider);\n\t\t\tfor (const p of yieldsTo) {\n\t\t\t\t// We know there is no cycle, so no recursion here\n\t\t\t\tconst result = await queryProvider.get(p);\n\t\t\t\tif (result) {\n\t\t\t\t\tfor (const item of result.inlineSuggestions.items) {\n\t\t\t\t\t\tif (item.isInlineEdit || typeof item.insertText !== 'string' && item.insertText !== undefined) {\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (item.insertText !== undefined) {\n\t\t\t\t\t\t\tconst t = new TextReplacement(Range.lift(item.range) ?? defaultReplaceRange, item.insertText);\n\t\t\t\t\t\t\tif (inlineCompletionIsVisible(t, undefined, model, position)) {\n\t\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// else: inline completion is not visible, so lets not block\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet result: InlineCompletions | null | undefined;\n\t\t\tconst providerStartTime = Date.now();\n\t\t\ttry {\n\t\t\t\tresult = await provider.provideInlineCompletions(model, position, contextWithUuid, cancellationTokenSource.token);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedExternalError(e);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst providerEndTime = Date.now();\n\n\t\t\tif (!result) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst data: InlineSuggestData[] = [];\n\t\t\tconst list = new InlineSuggestionList(result, data, provider);\n\t\t\tlist.addRef();\n\t\t\trunWhenCancelled(cancellationTokenSource.token, () => {\n\t\t\t\treturn list.removeRef(cancelReason);\n\t\t\t});\n\t\t\tif (cancellationTokenSource.token.isCancellationRequested) {\n\t\t\t\treturn undefined; // The list is disposed now, so we cannot return the items!\n\t\t\t}\n\n\t\t\tfor (const item of result.items) {\n\t\t\t\tdata.push(toInlineSuggestData(item, list, defaultReplaceRange, model, languageConfigurationService, contextWithUuid, requestInfo, { startTime: providerStartTime, endTime: providerEndTime }));\n\t\t\t}\n\n\t\t\treturn list;\n\t\t} finally {\n\t\t\trunningCount--;\n\t\t}\n\t});\n\n\tconst inlineCompletionLists = AsyncIterableProducer.fromPromisesResolveOrder(providers.map(p => queryProvider.get(p))).filter(isDefined);\n\n\treturn {\n\t\tcontextWithUuid,\n\t\tget didAllProvidersReturn() { return runningCount === 0; },\n\t\tlists: inlineCompletionLists,\n\t\tcancelAndDispose: reason => {\n\t\t\tif (cancelReason !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcancelReason = reason;\n\t\t\tcancellationTokenSource.dispose(true);\n\t\t}\n\t};\n}\n\n/** If the token is eventually cancelled, this will not leak either. */\nexport function runWhenCancelled(token: CancellationToken, callback: () => void): IDisposable {\n\tif (token.isCancellationRequested) {\n\t\tcallback();\n\t\treturn Disposable.None;\n\t} else {\n\t\tconst listener = token.onCancellationRequested(() => {\n\t\t\tlistener.dispose();\n\t\t\tcallback();\n\t\t});\n\t\treturn { dispose: () => listener.dispose() };\n\t}\n}\n\nexport interface IInlineCompletionProviderResult {\n\tget didAllProvidersReturn(): boolean;\n\n\tcontextWithUuid: InlineCompletionContext;\n\n\tcancelAndDispose(reason: InlineCompletionsDisposeReason): void;\n\n\tlists: AsyncIterableProducer<InlineSuggestionList>;\n}\n\nfunction toInlineSuggestData(\n\tinlineCompletion: InlineCompletion,\n\tsource: InlineSuggestionList,\n\tdefaultReplaceRange: Range,\n\ttextModel: ITextModel,\n\tlanguageConfigurationService: ILanguageConfigurationService | undefined,\n\tcontext: InlineCompletionContext,\n\trequestInfo: InlineSuggestRequestInfo,\n\tproviderRequestInfo: InlineSuggestProviderRequestInfo,\n): InlineSuggestData {\n\tlet insertText: string;\n\tlet snippetInfo: SnippetInfo | undefined;\n\tlet range = inlineCompletion.range ? Range.lift(inlineCompletion.range) : defaultReplaceRange;\n\n\tif (typeof inlineCompletion.insertText === 'string') {\n\t\tinsertText = inlineCompletion.insertText;\n\n\t\tif (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n\t\t\tinsertText = closeBrackets(\n\t\t\t\tinsertText,\n\t\t\t\trange.getStartPosition(),\n\t\t\t\ttextModel,\n\t\t\t\tlanguageConfigurationService\n\t\t\t);\n\n\t\t\t// Modify range depending on if brackets are added or removed\n\t\t\tconst diff = insertText.length - inlineCompletion.insertText.length;\n\t\t\tif (diff !== 0) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n\t\t\t}\n\t\t}\n\n\t\tsnippetInfo = undefined;\n\t} else if (inlineCompletion.insertText === undefined) {\n\t\tinsertText = ''; // TODO use undefined\n\t\tsnippetInfo = undefined;\n\t\trange = new Range(1, 1, 1, 1);\n\t} else if ('snippet' in inlineCompletion.insertText) {\n\t\tconst preBracketCompletionLength = inlineCompletion.insertText.snippet.length;\n\n\t\tif (languageConfigurationService && inlineCompletion.completeBracketPairs) {\n\t\t\tinlineCompletion.insertText.snippet = closeBrackets(\n\t\t\t\tinlineCompletion.insertText.snippet,\n\t\t\t\trange.getStartPosition(),\n\t\t\t\ttextModel,\n\t\t\t\tlanguageConfigurationService\n\t\t\t);\n\n\t\t\t// Modify range depending on if brackets are added or removed\n\t\t\tconst diff = inlineCompletion.insertText.snippet.length - preBracketCompletionLength;\n\t\t\tif (diff !== 0) {\n\t\t\t\trange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn + diff);\n\t\t\t}\n\t\t}\n\n\t\tconst snippet = new SnippetParser().parse(inlineCompletion.insertText.snippet);\n\n\t\tif (snippet.children.length === 1 && snippet.children[0] instanceof Text) {\n\t\t\tinsertText = snippet.children[0].value;\n\t\t\tsnippetInfo = undefined;\n\t\t} else {\n\t\t\tinsertText = snippet.toString();\n\t\t\tsnippetInfo = {\n\t\t\t\tsnippet: inlineCompletion.insertText.snippet,\n\t\t\t\trange: range\n\t\t\t};\n\t\t}\n\t} else {\n\t\tassertNever(inlineCompletion.insertText);\n\t}\n\n\treturn new InlineSuggestData(\n\t\trange,\n\t\tinsertText,\n\t\tsnippetInfo,\n\t\tURI.revive(inlineCompletion.uri),\n\t\tinlineCompletion.hint,\n\t\tinlineCompletion.additionalTextEdits || getReadonlyEmptyArray(),\n\t\tinlineCompletion,\n\t\tsource,\n\t\tcontext,\n\t\tinlineCompletion.isInlineEdit ?? false,\n\t\tinlineCompletion.supportsRename ?? false,\n\t\tundefined,\n\t\trequestInfo,\n\t\tproviderRequestInfo,\n\t\tinlineCompletion.correlationId,\n\t);\n}\n\nexport type InlineSuggestRequestInfo = {\n\tstartTime: number;\n\teditorType: InlineCompletionEditorType;\n\tlanguageId: string;\n\treason: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tavailableProviders: ProviderId[];\n};\n\nexport type InlineSuggestProviderRequestInfo = {\n\tstartTime: number;\n\tendTime: number;\n};\n\nexport type PartialAcceptance = {\n\tcharacters: number;\n\tcount: number;\n\tratio: number;\n};\n\nexport type RenameInfo = {\n\tcreatedRename: boolean;\n\tduration: number;\n\ttimedOut?: boolean;\n};\n\nexport type InlineSuggestViewData = {\n\teditorType: InlineCompletionEditorType;\n\trenderData?: InlineCompletionViewData;\n\tviewKind?: InlineCompletionViewKind;\n};\n\nexport class InlineSuggestData {\n\tprivate _didShow = false;\n\tprivate _timeUntilShown: number | undefined = undefined;\n\tprivate _showStartTime: number | undefined = undefined;\n\tprivate _shownDuration: number = 0;\n\tprivate _showUncollapsedStartTime: number | undefined = undefined;\n\tprivate _showUncollapsedDuration: number = 0;\n\tprivate _notShownReason: string | undefined = undefined;\n\n\tprivate _viewData: InlineSuggestViewData;\n\tprivate _didReportEndOfLife = false;\n\tprivate _lastSetEndOfLifeReason: InlineCompletionEndOfLifeReason | undefined = undefined;\n\tprivate _isPreceeded = false;\n\tprivate _partiallyAcceptedCount = 0;\n\tprivate _partiallyAcceptedSinceOriginal: PartialAcceptance = { characters: 0, ratio: 0, count: 0 };\n\tprivate _renameInfo: RenameInfo | undefined = undefined;\n\n\tconstructor(\n\t\tpublic readonly range: Range,\n\t\tpublic readonly insertText: string,\n\t\tpublic readonly snippetInfo: SnippetInfo | undefined,\n\t\tpublic readonly uri: URI | undefined,\n\t\tpublic readonly hint: IInlineCompletionHint | undefined,\n\t\tpublic readonly additionalTextEdits: readonly ISingleEditOperation[],\n\n\t\tpublic readonly sourceInlineCompletion: InlineCompletion,\n\t\tpublic readonly source: InlineSuggestionList,\n\t\tpublic readonly context: InlineCompletionContext,\n\t\tpublic readonly isInlineEdit: boolean,\n\t\tpublic readonly supportsRename: boolean,\n\t\tpublic readonly renameCommand: Command | undefined,\n\n\t\tprivate readonly _requestInfo: InlineSuggestRequestInfo,\n\t\tprivate readonly _providerRequestInfo: InlineSuggestProviderRequestInfo,\n\t\tprivate readonly _correlationId: string | undefined,\n\t) {\n\t\tthis._viewData = { editorType: _requestInfo.editorType };\n\t}\n\n\tpublic get showInlineEditMenu() { return this.sourceInlineCompletion.showInlineEditMenu ?? false; }\n\n\tpublic get partialAccepts(): PartialAcceptance { return this._partiallyAcceptedSinceOriginal; }\n\n\tpublic async reportInlineEditShown(commandService: ICommandService, updatedInsertText: string, viewKind: InlineCompletionViewKind, viewData: InlineCompletionViewData): Promise<void> {\n\t\tthis.updateShownDuration(viewKind);\n\n\t\tif (this._didShow) {\n\t\t\treturn;\n\t\t}\n\t\tthis._didShow = true;\n\t\tthis._viewData.viewKind = viewKind;\n\t\tthis._viewData.renderData = viewData;\n\t\tthis._timeUntilShown = Date.now() - this._requestInfo.startTime;\n\n\t\tconst editDeltaInfo = new EditDeltaInfo(viewData.lineCountModified, viewData.lineCountOriginal, viewData.characterCountModified, viewData.characterCountOriginal);\n\t\tthis.source.provider.handleItemDidShow?.(this.source.inlineSuggestions, this.sourceInlineCompletion, updatedInsertText, editDeltaInfo);\n\n\t\tif (this.sourceInlineCompletion.shownCommand) {\n\t\t\tawait commandService.executeCommand(this.sourceInlineCompletion.shownCommand.id, ...(this.sourceInlineCompletion.shownCommand.arguments || []));\n\t\t}\n\t}\n\n\tpublic reportPartialAccept(acceptedCharacters: number, info: PartialAcceptInfo, partialAcceptance: PartialAcceptance) {\n\t\tthis._partiallyAcceptedCount++;\n\t\tthis._partiallyAcceptedSinceOriginal.characters += partialAcceptance.characters;\n\t\tthis._partiallyAcceptedSinceOriginal.ratio = Math.min(this._partiallyAcceptedSinceOriginal.ratio + (1 - this._partiallyAcceptedSinceOriginal.ratio) * partialAcceptance.ratio, 1);\n\t\tthis._partiallyAcceptedSinceOriginal.count += partialAcceptance.count;\n\n\t\tthis.source.provider.handlePartialAccept?.(\n\t\t\tthis.source.inlineSuggestions,\n\t\t\tthis.sourceInlineCompletion,\n\t\t\tacceptedCharacters,\n\t\t\tinfo\n\t\t);\n\t}\n\n\t/**\n\t * Sends the end of life event to the provider.\n\t * If no reason is provided, the last set reason is used.\n\t * If no reason was set, the default reason is used.\n\t*/\n\tpublic reportEndOfLife(reason?: InlineCompletionEndOfLifeReason): void {\n\t\tif (this._didReportEndOfLife) {\n\t\t\treturn;\n\t\t}\n\t\tthis._didReportEndOfLife = true;\n\t\tthis.reportInlineEditHidden();\n\n\t\tif (!reason) {\n\t\t\treason = this._lastSetEndOfLifeReason ?? { kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: undefined };\n\t\t}\n\n\t\tif (reason.kind === InlineCompletionEndOfLifeReasonKind.Rejected && this.source.provider.handleRejection) {\n\t\t\tthis.source.provider.handleRejection(this.source.inlineSuggestions, this.sourceInlineCompletion);\n\t\t}\n\n\t\tif (this.source.provider.handleEndOfLifetime) {\n\t\t\tconst summary: LifetimeSummary = {\n\t\t\t\trequestUuid: this.context.requestUuid,\n\t\t\t\tcorrelationId: this._correlationId,\n\t\t\t\tselectedSuggestionInfo: !!this.context.selectedSuggestionInfo,\n\t\t\t\tpartiallyAccepted: this._partiallyAcceptedCount,\n\t\t\t\tpartiallyAcceptedCountSinceOriginal: this._partiallyAcceptedSinceOriginal.count,\n\t\t\t\tpartiallyAcceptedRatioSinceOriginal: this._partiallyAcceptedSinceOriginal.ratio,\n\t\t\t\tpartiallyAcceptedCharactersSinceOriginal: this._partiallyAcceptedSinceOriginal.characters,\n\t\t\t\tshown: this._didShow,\n\t\t\t\tshownDuration: this._shownDuration,\n\t\t\t\tshownDurationUncollapsed: this._showUncollapsedDuration,\n\t\t\t\tpreceeded: this._isPreceeded,\n\t\t\t\ttimeUntilShown: this._timeUntilShown,\n\t\t\t\ttimeUntilProviderRequest: this._providerRequestInfo.startTime - this._requestInfo.startTime,\n\t\t\t\ttimeUntilProviderResponse: this._providerRequestInfo.endTime - this._requestInfo.startTime,\n\t\t\t\teditorType: this._viewData.editorType,\n\t\t\t\tlanguageId: this._requestInfo.languageId,\n\t\t\t\trequestReason: this._requestInfo.reason,\n\t\t\t\tviewKind: this._viewData.viewKind,\n\t\t\t\tnotShownReason: this._notShownReason,\n\t\t\t\trenameCreated: this._renameInfo?.createdRename ?? false,\n\t\t\t\trenameDuration: this._renameInfo?.duration,\n\t\t\t\trenameTimedOut: this._renameInfo?.timedOut ?? false,\n\t\t\t\ttypingInterval: this._requestInfo.typingInterval,\n\t\t\t\ttypingIntervalCharacterCount: this._requestInfo.typingIntervalCharacterCount,\n\t\t\t\tavailableProviders: this._requestInfo.availableProviders.map(p => p.toString()).join(','),\n\t\t\t\t...this._viewData.renderData,\n\t\t\t};\n\t\t\tthis.source.provider.handleEndOfLifetime(this.source.inlineSuggestions, this.sourceInlineCompletion, reason, summary);\n\t\t}\n\t}\n\n\tpublic setIsPreceeded(partialAccepts: PartialAcceptance): void {\n\t\tthis._isPreceeded = true;\n\n\t\tif (this._partiallyAcceptedSinceOriginal.characters !== 0 || this._partiallyAcceptedSinceOriginal.ratio !== 0 || this._partiallyAcceptedSinceOriginal.count !== 0) {\n\t\t\tconsole.warn('Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded.');\n\t\t}\n\t\tthis._partiallyAcceptedSinceOriginal = partialAccepts;\n\t}\n\n\tpublic setNotShownReason(reason: string): void {\n\t\tthis._notShownReason ??= reason;\n\t}\n\n\t/**\n\t * Sets the end of life reason, but does not send the event to the provider yet.\n\t*/\n\tpublic setEndOfLifeReason(reason: InlineCompletionEndOfLifeReason): void {\n\t\tthis.reportInlineEditHidden();\n\t\tthis._lastSetEndOfLifeReason = reason;\n\t}\n\n\tprivate updateShownDuration(viewKind: InlineCompletionViewKind) {\n\t\tconst timeNow = Date.now();\n\t\tif (!this._showStartTime) {\n\t\t\tthis._showStartTime = timeNow;\n\t\t}\n\n\t\tconst isCollapsed = viewKind === InlineCompletionViewKind.Collapsed;\n\t\tif (!isCollapsed && this._showUncollapsedStartTime === undefined) {\n\t\t\tthis._showUncollapsedStartTime = timeNow;\n\t\t}\n\n\t\tif (isCollapsed && this._showUncollapsedStartTime !== undefined) {\n\t\t\tthis._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime;\n\t\t}\n\t}\n\n\tprivate reportInlineEditHidden() {\n\t\tif (this._showStartTime === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tconst timeNow = Date.now();\n\t\tthis._shownDuration += timeNow - this._showStartTime;\n\t\tthis._showStartTime = undefined;\n\n\t\tif (this._showUncollapsedStartTime === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tthis._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime;\n\t\tthis._showUncollapsedStartTime = undefined;\n\t}\n\n\tpublic setRenameProcessingInfo(info: RenameInfo): void {\n\t\tif (this._renameInfo) {\n\t\t\tthrow new BugIndicatingError('Rename info has already been set.');\n\t\t}\n\t\tthis._renameInfo = info;\n\t}\n\n\tpublic withRename(command: Command, hint: IInlineCompletionHint): InlineSuggestData {\n\t\treturn new InlineSuggestData(\n\t\t\tnew Range(1, 1, 1, 1),\n\t\t\t'',\n\t\t\tthis.snippetInfo,\n\t\t\tthis.uri,\n\t\t\thint,\n\t\t\tthis.additionalTextEdits,\n\t\t\tthis.sourceInlineCompletion,\n\t\t\tthis.source,\n\t\t\tthis.context,\n\t\t\tthis.isInlineEdit,\n\t\t\tthis.supportsRename,\n\t\t\tcommand,\n\t\t\tthis._requestInfo,\n\t\t\tthis._providerRequestInfo,\n\t\t\tthis._correlationId,\n\t\t);\n\t}\n}\n\nexport interface SnippetInfo {\n\tsnippet: string;\n\t/* Could be different than the main range */\n\trange: Range;\n}\n\nexport enum InlineCompletionEditorType {\n\tTextEditor = 'textEditor',\n\tDiffEditor = 'diffEditor',\n\tNotebook = 'notebook',\n}\n\n/**\n * A ref counted pointer to the computed `InlineCompletions` and the `InlineCompletionsProvider` that\n * computed them.\n */\nexport class InlineSuggestionList {\n\tprivate refCount = 0;\n\tconstructor(\n\t\tpublic readonly inlineSuggestions: InlineCompletions,\n\t\tpublic readonly inlineSuggestionsData: readonly InlineSuggestData[],\n\t\tpublic readonly provider: InlineCompletionsProvider,\n\t) { }\n\n\taddRef(): void {\n\t\tthis.refCount++;\n\t}\n\n\tremoveRef(reason: InlineCompletionsDisposeReason = { kind: 'other' }): void {\n\t\tthis.refCount--;\n\t\tif (this.refCount === 0) {\n\t\t\tfor (const item of this.inlineSuggestionsData) {\n\t\t\t\t// Fallback if it has not been called before\n\t\t\t\titem.reportEndOfLife();\n\t\t\t}\n\t\t\tthis.provider.disposeInlineCompletions(this.inlineSuggestions, reason);\n\t\t}\n\t}\n}\n\nfunction getDefaultRange(position: Position, model: ITextModel): Range {\n\tconst word = model.getWordAtPosition(position);\n\tconst maxColumn = model.getLineMaxColumn(position.lineNumber);\n\t// By default, always replace up until the end of the current line.\n\t// This default might be subject to change!\n\treturn word\n\t\t? new Range(position.lineNumber, word.startColumn, position.lineNumber, maxColumn)\n\t\t: Range.fromPositions(position, position.with(undefined, maxColumn));\n}\n\nfunction closeBrackets(text: string, position: Position, model: ITextModel, languageConfigurationService: ILanguageConfigurationService): string {\n\tconst currentLine = model.getLineContent(position.lineNumber);\n\tconst edit = StringReplacement.replace(new OffsetRange(position.column - 1, currentLine.length), text);\n\n\tconst proposedLineTokens = model.tokenization.tokenizeLinesAt(position.lineNumber, [edit.replace(currentLine)]);\n\tconst textTokens = proposedLineTokens?.[0].sliceZeroCopy(edit.getRangeAfterReplace());\n\tif (!textTokens) {\n\t\treturn text;\n\t}\n\n\tconst fixedText = fixBracketsInLine(textTokens, languageConfigurationService);\n\treturn fixedText;\n}\n"]}
@@ -0,0 +1,151 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
6
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
9
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ import { raceTimeout } from '../../../../../base/common/async.js';
15
+ import { LcsDiff, StringDiffSequence } from '../../../../../base/common/diff/diff.js';
16
+ import { Disposable } from '../../../../../base/common/lifecycle.js';
17
+ import { localize } from '../../../../../nls.js';
18
+ import { CommandsRegistry } from '../../../../../platform/commands/common/commands.js';
19
+ import { IBulkEditService } from '../../../../browser/services/bulkEditService.js';
20
+ import { TextEdit } from '../../../../common/core/edits/textEdit.js';
21
+ import { Range } from '../../../../common/core/range.js';
22
+ import { InlineCompletionHintStyle } from '../../../../common/languages.js';
23
+ import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';
24
+ import { prepareRename, rename } from '../../../rename/browser/rename.js';
25
+ import { renameSymbolCommandId } from '../controller/commandIds.js';
26
+ import { InlineSuggestHint, InlineSuggestionItem } from './inlineSuggestionItem.js';
27
+ let RenameSymbolProcessor = class RenameSymbolProcessor extends Disposable {
28
+ constructor(_languageFeaturesService, bulkEditService) {
29
+ super();
30
+ this._languageFeaturesService = _languageFeaturesService;
31
+ this._register(CommandsRegistry.registerCommand(renameSymbolCommandId, async (_, textModel, position, newName) => {
32
+ try {
33
+ const result = await rename(this._languageFeaturesService.renameProvider, textModel, position, newName);
34
+ if (result.rejectReason) {
35
+ return;
36
+ }
37
+ bulkEditService.apply(result);
38
+ }
39
+ catch (error) {
40
+ // The actual rename failed we should log this.
41
+ }
42
+ }));
43
+ }
44
+ async proposeRenameRefactoring(textModel, suggestItem) {
45
+ if (!suggestItem.supportsRename) {
46
+ return suggestItem;
47
+ }
48
+ const start = Date.now();
49
+ const edits = this.createSingleEdits(textModel, suggestItem.editRange, suggestItem.insertText);
50
+ if (edits === undefined || edits.renames.edits.length === 0) {
51
+ return suggestItem;
52
+ }
53
+ const { oldName, newName, position } = edits.renames;
54
+ let timedOut = false;
55
+ const loc = await raceTimeout(prepareRename(this._languageFeaturesService.renameProvider, textModel, position), 1000, () => { timedOut = true; });
56
+ const renamePossible = loc !== undefined && !loc.rejectReason;
57
+ suggestItem.setRenameProcessingInfo({ createdRename: renamePossible, duration: Date.now() - start, timedOut });
58
+ if (!renamePossible) {
59
+ return suggestItem;
60
+ }
61
+ const hintRange = edits.renames.edits[0].replacements[0].range;
62
+ const label = localize(1218, "Rename '{0}' to '{1}'", oldName, newName);
63
+ const command = {
64
+ id: renameSymbolCommandId,
65
+ title: label,
66
+ arguments: [textModel, position, newName],
67
+ };
68
+ const hint = InlineSuggestHint.create({ range: hintRange, content: label, style: InlineCompletionHintStyle.Code });
69
+ return InlineSuggestionItem.create(suggestItem.withRename(command, hint), textModel);
70
+ }
71
+ createSingleEdits(textModel, nesRange, modifiedText) {
72
+ const others = [];
73
+ const renames = [];
74
+ let oldName = undefined;
75
+ let newName = undefined;
76
+ let position = undefined;
77
+ const originalText = textModel.getValueInRange(nesRange);
78
+ const nesOffset = textModel.getOffsetAt(nesRange.getStartPosition());
79
+ const { changes } = (new LcsDiff(new StringDiffSequence(originalText), new StringDiffSequence(modifiedText))).ComputeDiff(true);
80
+ if (changes.length === 0) {
81
+ return undefined;
82
+ }
83
+ let tokenDiff = 0;
84
+ for (const change of changes) {
85
+ const startOffset = nesOffset + change.originalStart;
86
+ const startPos = textModel.getPositionAt(startOffset);
87
+ const wordRange = textModel.getWordAtPosition(startPos);
88
+ // If we don't have a word range at the start position of the current document then we
89
+ // don't treat it as a rename assuming that the rename refactoring will fail as well since
90
+ // there can't be an identifier at that position.
91
+ if (wordRange === null) {
92
+ return undefined;
93
+ }
94
+ const endOffset = startOffset + change.originalLength;
95
+ const endPos = textModel.getPositionAt(endOffset);
96
+ const range = Range.fromPositions(startPos, endPos);
97
+ const text = modifiedText.substring(change.modifiedStart, change.modifiedStart + change.modifiedLength);
98
+ const tokenInfo = getTokenAtPosition(textModel, startPos);
99
+ if (tokenInfo.type === 0 /* StandardTokenType.Other */) {
100
+ let identifier = textModel.getValueInRange(tokenInfo.range);
101
+ if (oldName === undefined) {
102
+ oldName = identifier;
103
+ }
104
+ else if (oldName !== identifier) {
105
+ return undefined;
106
+ }
107
+ // We assume that the new name starts at the same position as the old name from a token range perspective.
108
+ const diff = text.length - change.originalLength;
109
+ const tokenStartPos = textModel.getOffsetAt(tokenInfo.range.getStartPosition()) - nesOffset + tokenDiff;
110
+ const tokenEndPos = textModel.getOffsetAt(tokenInfo.range.getEndPosition()) - nesOffset + tokenDiff;
111
+ identifier = modifiedText.substring(tokenStartPos, tokenEndPos + diff);
112
+ if (newName === undefined) {
113
+ newName = identifier;
114
+ }
115
+ else if (newName !== identifier) {
116
+ return undefined;
117
+ }
118
+ if (position === undefined) {
119
+ position = tokenInfo.range.getStartPosition();
120
+ }
121
+ renames.push(TextEdit.replace(range, text));
122
+ tokenDiff += diff;
123
+ }
124
+ else {
125
+ others.push(TextEdit.replace(range, text));
126
+ }
127
+ }
128
+ if (oldName === undefined || newName === undefined || position === undefined) {
129
+ return undefined;
130
+ }
131
+ return {
132
+ renames: { edits: renames, position, oldName, newName },
133
+ others: { edits: others }
134
+ };
135
+ }
136
+ };
137
+ RenameSymbolProcessor = __decorate([
138
+ __param(0, ILanguageFeaturesService),
139
+ __param(1, IBulkEditService)
140
+ ], RenameSymbolProcessor);
141
+ export { RenameSymbolProcessor };
142
+ function getTokenAtPosition(textModel, position) {
143
+ textModel.tokenization.tokenizeIfCheap(position.lineNumber);
144
+ const tokens = textModel.tokenization.getLineTokens(position.lineNumber);
145
+ const idx = tokens.findTokenIndexAtOffset(position.column - 1);
146
+ return {
147
+ type: tokens.getStandardTokenType(idx),
148
+ range: new Range(position.lineNumber, 1 + tokens.getStartOffset(idx), position.lineNumber, 1 + tokens.getEndOffset(idx))
149
+ };
150
+ }
151
+ //# sourceMappingURL=renameSymbolProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAAW,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAErF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAO7E,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;IAEpD,YAC4C,wBAAkD,EAC3E,eAAiC;QAEnD,KAAK,EAAE,CAAC;QAHmC,6BAAwB,GAAxB,wBAAwB,CAA0B;QAI7F,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,eAAe,CAAC,qBAAqB,EAAE,KAA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AK,SAAS,IAAI,OAAO,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC9E,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,OAAO;YACN,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE;YACvD,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;SACzB,CAAC;IACH,CAAC;CACD,CAAA;AA/HY,qBAAqB;IAG/B,WAAA,wBAAwB,CAAA;IACxB,WAAA,gBAAgB,CAAA;GAJN,qBAAqB,CA+HjC;;AAED,SAAS,kBAAkB,CAAC,SAAqB,EAAE,QAAkB;IACpE,SAAS,CAAC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACzE,MAAM,GAAG,GAAG,MAAM,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/D,OAAO;QACN,IAAI,EAAE,MAAM,CAAC,oBAAoB,CAAC,GAAG,CAAC;QACtC,KAAK,EAAE,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;KACxH,CAAC;AACH,CAAC","file":"renameSymbolProcessor.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { raceTimeout } from '../../../../../base/common/async.js';\nimport { LcsDiff, StringDiffSequence } from '../../../../../base/common/diff/diff.js';\nimport { Disposable } from '../../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../../nls.js';\nimport { CommandsRegistry } from '../../../../../platform/commands/common/commands.js';\nimport { ServicesAccessor } from '../../../../browser/editorExtensions.js';\nimport { IBulkEditService } from '../../../../browser/services/bulkEditService.js';\nimport { TextEdit } from '../../../../common/core/edits/textEdit.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { StandardTokenType } from '../../../../common/encodedTokenAttributes.js';\nimport { Command, InlineCompletionHintStyle } from '../../../../common/languages.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { prepareRename, rename } from '../../../rename/browser/rename.js';\nimport { renameSymbolCommandId } from '../controller/commandIds.js';\nimport { InlineSuggestHint, InlineSuggestionItem } from './inlineSuggestionItem.js';\n\ntype SingleEdits = {\n\trenames: { edits: TextEdit[]; position: Position; oldName: string; newName: string };\n\tothers: { edits: TextEdit[] };\n};\n\nexport class RenameSymbolProcessor extends Disposable {\n\n\tconstructor(\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IBulkEditService bulkEditService: IBulkEditService,\n\t) {\n\t\tsuper();\n\t\tthis._register(CommandsRegistry.registerCommand(renameSymbolCommandId, async (_: ServicesAccessor, textModel: ITextModel, position: Position, newName: string) => {\n\t\t\ttry {\n\t\t\t\tconst result = await rename(this._languageFeaturesService.renameProvider, textModel, position, newName);\n\t\t\t\tif (result.rejectReason) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbulkEditService.apply(result);\n\t\t\t} catch (error) {\n\t\t\t\t// The actual rename failed we should log this.\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic async proposeRenameRefactoring(textModel: ITextModel, suggestItem: InlineSuggestionItem): Promise<InlineSuggestionItem> {\n\t\tif (!suggestItem.supportsRename) {\n\t\t\treturn suggestItem;\n\t\t}\n\n\t\tconst start = Date.now();\n\n\t\tconst edits = this.createSingleEdits(textModel, suggestItem.editRange, suggestItem.insertText);\n\t\tif (edits === undefined || edits.renames.edits.length === 0) {\n\t\t\treturn suggestItem;\n\t\t}\n\n\t\tconst { oldName, newName, position } = edits.renames;\n\t\tlet timedOut = false;\n\t\tconst loc = await raceTimeout(prepareRename(this._languageFeaturesService.renameProvider, textModel, position), 1000, () => { timedOut = true; });\n\t\tconst renamePossible = loc !== undefined && !loc.rejectReason;\n\n\t\tsuggestItem.setRenameProcessingInfo({ createdRename: renamePossible, duration: Date.now() - start, timedOut });\n\n\t\tif (!renamePossible) {\n\t\t\treturn suggestItem;\n\t\t}\n\n\t\tconst hintRange = edits.renames.edits[0].replacements[0].range;\n\t\tconst label = localize('renameSymbol', \"Rename '{0}' to '{1}'\", oldName, newName);\n\t\tconst command: Command = {\n\t\t\tid: renameSymbolCommandId,\n\t\t\ttitle: label,\n\t\t\targuments: [textModel, position, newName],\n\t\t};\n\t\tconst hint = InlineSuggestHint.create({ range: hintRange, content: label, style: InlineCompletionHintStyle.Code });\n\t\treturn InlineSuggestionItem.create(suggestItem.withRename(command, hint), textModel);\n\t}\n\n\tprivate createSingleEdits(textModel: ITextModel, nesRange: Range, modifiedText: string): SingleEdits | undefined {\n\t\tconst others: TextEdit[] = [];\n\t\tconst renames: TextEdit[] = [];\n\t\tlet oldName: string | undefined = undefined;\n\t\tlet newName: string | undefined = undefined;\n\t\tlet position: Position | undefined = undefined;\n\n\t\tconst originalText = textModel.getValueInRange(nesRange);\n\t\tconst nesOffset = textModel.getOffsetAt(nesRange.getStartPosition());\n\n\t\tconst { changes } = (new LcsDiff(new StringDiffSequence(originalText), new StringDiffSequence(modifiedText))).ComputeDiff(true);\n\t\tif (changes.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet tokenDiff: number = 0;\n\t\tfor (const change of changes) {\n\t\t\tconst startOffset = nesOffset + change.originalStart;\n\t\t\tconst startPos = textModel.getPositionAt(startOffset);\n\t\t\tconst wordRange = textModel.getWordAtPosition(startPos);\n\t\t\t// If we don't have a word range at the start position of the current document then we\n\t\t\t// don't treat it as a rename assuming that the rename refactoring will fail as well since\n\t\t\t// there can't be an identifier at that position.\n\t\t\tif (wordRange === null) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst endOffset = startOffset + change.originalLength;\n\t\t\tconst endPos = textModel.getPositionAt(endOffset);\n\t\t\tconst range = Range.fromPositions(startPos, endPos);\n\t\t\tconst text = modifiedText.substring(change.modifiedStart, change.modifiedStart + change.modifiedLength);\n\n\t\t\tconst tokenInfo = getTokenAtPosition(textModel, startPos);\n\t\t\tif (tokenInfo.type === StandardTokenType.Other) {\n\n\t\t\t\tlet identifier = textModel.getValueInRange(tokenInfo.range);\n\t\t\t\tif (oldName === undefined) {\n\t\t\t\t\toldName = identifier;\n\t\t\t\t} else if (oldName !== identifier) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\t// We assume that the new name starts at the same position as the old name from a token range perspective.\n\t\t\t\tconst diff = text.length - change.originalLength;\n\t\t\t\tconst tokenStartPos = textModel.getOffsetAt(tokenInfo.range.getStartPosition()) - nesOffset + tokenDiff;\n\t\t\t\tconst tokenEndPos = textModel.getOffsetAt(tokenInfo.range.getEndPosition()) - nesOffset + tokenDiff;\n\t\t\t\tidentifier = modifiedText.substring(tokenStartPos, tokenEndPos + diff);\n\t\t\t\tif (newName === undefined) {\n\t\t\t\t\tnewName = identifier;\n\t\t\t\t} else if (newName !== identifier) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tif (position === undefined) {\n\t\t\t\t\tposition = tokenInfo.range.getStartPosition();\n\t\t\t\t}\n\n\t\t\t\trenames.push(TextEdit.replace(range, text));\n\t\t\t\ttokenDiff += diff;\n\t\t\t} else {\n\t\t\t\tothers.push(TextEdit.replace(range, text));\n\t\t\t}\n\t\t}\n\n\t\tif (oldName === undefined || newName === undefined || position === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\trenames: { edits: renames, position, oldName, newName },\n\t\t\tothers: { edits: others }\n\t\t};\n\t}\n}\n\nfunction getTokenAtPosition(textModel: ITextModel, position: Position): { type: StandardTokenType; range: Range } {\n\ttextModel.tokenization.tokenizeIfCheap(position.lineNumber);\n\tconst tokens = textModel.tokenization.getLineTokens(position.lineNumber);\n\tconst idx = tokens.findTokenIndexAtOffset(position.column - 1);\n\treturn {\n\t\ttype: tokens.getStandardTokenType(idx),\n\t\trange: new Range(position.lineNumber, 1 + tokens.getStartOffset(idx), position.lineNumber, 1 + tokens.getEndOffset(idx))\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/telemetry.ts","vs/editor/contrib/inlineCompletions/browser/telemetry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,UAAU,uCAAuC,CAAC,WAAkD,EAAE,gBAAgD;IAC3J,WAAW,CAAC,UAAU,CAA2E,4BAA4B,EAAE,gBAAgB,CAAC,CAAC;AAClJ,CAAC","file":"telemetry.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\tnotShownReason: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\tnotShownReason: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n};\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/telemetry.ts","vs/editor/contrib/inlineCompletions/browser/telemetry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,UAAU,uCAAuC,CAAC,WAAkD,EAAE,gBAAgD;IAC3J,WAAW,CAAC,UAAU,CAA2E,4BAA4B,EAAE,gBAAgB,CAAC,CAAC;AAClJ,CAAC","file":"telemetry.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\tnotShownReason: string | undefined;\n\trenameCreated: boolean;\n\trenameDuration: number | undefined;\n\trenameTimedOut: boolean;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\trenameCreated: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether a rename operation was created' };\n\trenameDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration of the rename processor' };\n\trenameTimedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the rename prepare operation timed out' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\tnotShownReason: string | undefined;\n\trenameCreated: boolean;\n\trenameDuration: number | undefined;\n\trenameTimedOut: boolean;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\trenameCreated: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether a rename operation was created' };\n\trenameDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration of the rename processor' };\n\trenameTimedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the rename prepare operation timed out' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n};\n"]}