@vscode/chat-lib 0.0.1 → 0.0.2

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 (391) hide show
  1. package/dist/src/_internal/extension/xtab/common/promptCrafting.d.ts.map +1 -1
  2. package/dist/src/_internal/extension/xtab/common/promptCrafting.js +6 -5
  3. package/dist/src/_internal/extension/xtab/common/promptCrafting.js.map +1 -1
  4. package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +1 -0
  5. package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
  6. package/dist/src/_internal/platform/configuration/common/configurationService.js +1 -0
  7. package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
  8. package/dist/src/_internal/platform/env/common/envService.d.ts +5 -0
  9. package/dist/src/_internal/platform/env/common/envService.d.ts.map +1 -1
  10. package/dist/src/_internal/platform/env/common/envService.js +2 -1
  11. package/dist/src/_internal/platform/env/common/envService.js.map +1 -1
  12. package/dist/src/_internal/platform/env/common/nullEnvService.d.ts +3 -0
  13. package/dist/src/_internal/platform/env/common/nullEnvService.d.ts.map +1 -1
  14. package/dist/src/_internal/platform/env/common/nullEnvService.js +8 -1
  15. package/dist/src/_internal/platform/env/common/nullEnvService.js.map +1 -1
  16. package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts +7 -0
  17. package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts.map +1 -1
  18. package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js +1 -0
  19. package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js.map +1 -1
  20. package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts +8 -0
  21. package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts.map +1 -1
  22. package/dist/src/_internal/util/common/test/shims/chatTypes.js +19 -1
  23. package/dist/src/_internal/util/common/test/shims/chatTypes.js.map +1 -1
  24. package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.d.ts.map +1 -1
  25. package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js +8 -1
  26. package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js.map +1 -1
  27. package/dist/src/_internal/vscodeTypes.d.ts +4 -0
  28. package/dist/src/_internal/vscodeTypes.d.ts.map +1 -1
  29. package/dist/src/_internal/vscodeTypes.js +5 -1
  30. package/dist/src/_internal/vscodeTypes.js.map +1 -1
  31. package/dist/src/main.d.ts +5 -0
  32. package/dist/src/main.d.ts.map +1 -1
  33. package/dist/src/main.js +12 -0
  34. package/dist/src/main.js.map +1 -1
  35. package/dist/src/package.json +46 -19
  36. package/package.json +3 -6
  37. package/src/_internal/extension/byok/node/openAIEndpoint.ts +0 -171
  38. package/src/_internal/extension/common/constants.ts +0 -90
  39. package/src/_internal/extension/inlineEdits/common/delayer.ts +0 -108
  40. package/src/_internal/extension/inlineEdits/common/editRebase.ts +0 -268
  41. package/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx +0 -163
  42. package/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.ts +0 -225
  43. package/src/_internal/extension/inlineEdits/common/rejectionCollector.ts +0 -164
  44. package/src/_internal/extension/inlineEdits/node/debugRecorder.ts +0 -205
  45. package/src/_internal/extension/inlineEdits/node/importFiltering.ts +0 -25
  46. package/src/_internal/extension/inlineEdits/node/nesConfigs.ts +0 -12
  47. package/src/_internal/extension/inlineEdits/node/nextEditCache.ts +0 -278
  48. package/src/_internal/extension/inlineEdits/node/nextEditProvider.ts +0 -778
  49. package/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.ts +0 -983
  50. package/src/_internal/extension/inlineEdits/node/nextEditResult.ts +0 -40
  51. package/src/_internal/extension/prompt/common/importStatement.ts +0 -25
  52. package/src/_internal/extension/prompt/node/chatMLFetcher.ts +0 -706
  53. package/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.ts +0 -146
  54. package/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.ts +0 -527
  55. package/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.ts +0 -76
  56. package/src/_internal/extension/prompts/node/inline/visualization.ts +0 -65
  57. package/src/_internal/extension/vscode.proposed.activeComment.d.ts +0 -23
  58. package/src/_internal/extension/vscode.proposed.aiRelatedInformation.d.ts +0 -49
  59. package/src/_internal/extension/vscode.proposed.aiSettingsSearch.d.ts +0 -31
  60. package/src/_internal/extension/vscode.proposed.aiTextSearchProvider.d.ts +0 -41
  61. package/src/_internal/extension/vscode.proposed.authLearnMore.d.ts +0 -16
  62. package/src/_internal/extension/vscode.proposed.chatBinaryReferenceData.d.ts +0 -41
  63. package/src/_internal/extension/vscode.proposed.chatEditing.d.ts +0 -29
  64. package/src/_internal/extension/vscode.proposed.chatParticipantAdditions.d.ts +0 -636
  65. package/src/_internal/extension/vscode.proposed.chatParticipantPrivate.d.ts +0 -276
  66. package/src/_internal/extension/vscode.proposed.chatProvider.d.ts +0 -62
  67. package/src/_internal/extension/vscode.proposed.chatReadonlyPromptReference.d.ts +0 -17
  68. package/src/_internal/extension/vscode.proposed.chatReferenceDiagnostic.d.ts +0 -23
  69. package/src/_internal/extension/vscode.proposed.chatSessionsProvider.d.ts +0 -218
  70. package/src/_internal/extension/vscode.proposed.chatStatusItem.d.ts +0 -61
  71. package/src/_internal/extension/vscode.proposed.codeActionAI.d.ts +0 -16
  72. package/src/_internal/extension/vscode.proposed.commentReveal.d.ts +0 -32
  73. package/src/_internal/extension/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts +0 -8
  74. package/src/_internal/extension/vscode.proposed.contribCommentsViewThreadMenus.d.ts +0 -6
  75. package/src/_internal/extension/vscode.proposed.contribSourceControlInputBoxMenu.d.ts +0 -7
  76. package/src/_internal/extension/vscode.proposed.dataChannels.d.ts +0 -19
  77. package/src/_internal/extension/vscode.proposed.defaultChatParticipant.d.ts +0 -52
  78. package/src/_internal/extension/vscode.proposed.documentFiltersExclusive.d.ts +0 -13
  79. package/src/_internal/extension/vscode.proposed.embeddings.d.ts +0 -33
  80. package/src/_internal/extension/vscode.proposed.extensionsAny.d.ts +0 -40
  81. package/src/_internal/extension/vscode.proposed.findFiles2.d.ts +0 -125
  82. package/src/_internal/extension/vscode.proposed.findTextInFiles.d.ts +0 -104
  83. package/src/_internal/extension/vscode.proposed.findTextInFiles2.d.ts +0 -144
  84. package/src/_internal/extension/vscode.proposed.inlineCompletionsAdditions.d.ts +0 -202
  85. package/src/_internal/extension/vscode.proposed.interactive.d.ts +0 -11
  86. package/src/_internal/extension/vscode.proposed.languageModelCapabilities.d.ts +0 -25
  87. package/src/_internal/extension/vscode.proposed.languageModelDataPart.d.ts +0 -163
  88. package/src/_internal/extension/vscode.proposed.languageModelSystem.d.ts +0 -17
  89. package/src/_internal/extension/vscode.proposed.languageModelThinkingPart.d.ts +0 -49
  90. package/src/_internal/extension/vscode.proposed.languageModelToolResultAudience.d.ts +0 -36
  91. package/src/_internal/extension/vscode.proposed.mappedEditsProvider.d.ts +0 -110
  92. package/src/_internal/extension/vscode.proposed.newSymbolNamesProvider.d.ts +0 -47
  93. package/src/_internal/extension/vscode.proposed.readonlyMessage.d.ts +0 -14
  94. package/src/_internal/extension/vscode.proposed.resolvers.d.ts +0 -475
  95. package/src/_internal/extension/vscode.proposed.scmInputBoxValueProvider.d.ts +0 -25
  96. package/src/_internal/extension/vscode.proposed.taskProblemMatcherStatus.d.ts +0 -42
  97. package/src/_internal/extension/vscode.proposed.terminalDataWriteEvent.d.ts +0 -32
  98. package/src/_internal/extension/vscode.proposed.terminalExecuteCommandEvent.d.ts +0 -48
  99. package/src/_internal/extension/vscode.proposed.terminalQuickFixProvider.d.ts +0 -87
  100. package/src/_internal/extension/vscode.proposed.terminalSelection.d.ts +0 -16
  101. package/src/_internal/extension/vscode.proposed.testObserver.d.ts +0 -199
  102. package/src/_internal/extension/vscode.proposed.textDocumentChangeReason.d.ts +0 -30
  103. package/src/_internal/extension/vscode.proposed.textSearchProvider.d.ts +0 -281
  104. package/src/_internal/extension/vscode.proposed.textSearchProvider2.d.ts +0 -297
  105. package/src/_internal/extension/xtab/common/promptCrafting.ts +0 -670
  106. package/src/_internal/extension/xtab/node/xtabEndpoint.ts +0 -102
  107. package/src/_internal/extension/xtab/node/xtabProvider.ts +0 -976
  108. package/src/_internal/extension/xtab/node/xtabUtils.ts +0 -62
  109. package/src/_internal/platform/authentication/common/authentication.ts +0 -309
  110. package/src/_internal/platform/authentication/common/copilotToken.ts +0 -300
  111. package/src/_internal/platform/authentication/common/copilotTokenManager.ts +0 -59
  112. package/src/_internal/platform/authentication/common/copilotTokenStore.ts +0 -40
  113. package/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.ts +0 -96
  114. package/src/_internal/platform/authentication/node/copilotTokenManager.ts +0 -303
  115. package/src/_internal/platform/chat/common/chatMLFetcher.ts +0 -124
  116. package/src/_internal/platform/chat/common/chatQuotaService.ts +0 -63
  117. package/src/_internal/platform/chat/common/chatQuotaServiceImpl.ts +0 -96
  118. package/src/_internal/platform/chat/common/commonTypes.ts +0 -353
  119. package/src/_internal/platform/chat/common/conversationOptions.ts +0 -16
  120. package/src/_internal/platform/chat/common/globalStringUtils.ts +0 -54
  121. package/src/_internal/platform/chat/common/interactionService.ts +0 -35
  122. package/src/_internal/platform/configuration/common/configurationService.ts +0 -803
  123. package/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.ts +0 -39
  124. package/src/_internal/platform/configuration/common/jsonSchema.ts +0 -139
  125. package/src/_internal/platform/configuration/common/validator.ts +0 -242
  126. package/src/_internal/platform/diff/common/diffService.ts +0 -41
  127. package/src/_internal/platform/diff/common/diffWorker.ts +0 -83
  128. package/src/_internal/platform/diff/node/diffServiceImpl.ts +0 -85
  129. package/src/_internal/platform/editing/common/abstractText.ts +0 -177
  130. package/src/_internal/platform/editing/common/notebookDocumentSnapshot.ts +0 -122
  131. package/src/_internal/platform/editing/common/positionOffsetTransformer.ts +0 -202
  132. package/src/_internal/platform/editing/common/textDocumentSnapshot.ts +0 -274
  133. package/src/_internal/platform/endpoint/common/capiClient.ts +0 -37
  134. package/src/_internal/platform/endpoint/common/chatModelCapabilities.ts +0 -115
  135. package/src/_internal/platform/endpoint/common/domainService.ts +0 -27
  136. package/src/_internal/platform/endpoint/common/endpointProvider.ts +0 -104
  137. package/src/_internal/platform/endpoint/common/endpointTypes.ts +0 -12
  138. package/src/_internal/platform/endpoint/common/licenseAgreement.ts +0 -11
  139. package/src/_internal/platform/endpoint/common/statefulMarkerContainer.tsx +0 -85
  140. package/src/_internal/platform/endpoint/common/thinkingDataContainer.tsx +0 -44
  141. package/src/_internal/platform/endpoint/node/capiClientImpl.ts +0 -18
  142. package/src/_internal/platform/endpoint/node/chatEndpoint.ts +0 -435
  143. package/src/_internal/platform/endpoint/node/domainServiceImpl.ts +0 -80
  144. package/src/_internal/platform/endpoint/node/proxyXtabEndpoint.ts +0 -43
  145. package/src/_internal/platform/endpoint/node/responsesApi.ts +0 -326
  146. package/src/_internal/platform/env/common/envService.ts +0 -134
  147. package/src/_internal/platform/env/common/nullEnvService.ts +0 -68
  148. package/src/_internal/platform/env/common/packagejson.ts +0 -49
  149. package/src/_internal/platform/git/common/gitExtensionService.ts +0 -21
  150. package/src/_internal/platform/git/common/nullGitExtensionService.ts +0 -20
  151. package/src/_internal/platform/git/vscode/git.d.ts +0 -414
  152. package/src/_internal/platform/github/common/githubAPI.ts +0 -44
  153. package/src/_internal/platform/github/common/githubService.ts +0 -87
  154. package/src/_internal/platform/github/common/nullOctokitServiceImpl.ts +0 -21
  155. package/src/_internal/platform/ignore/common/ignoreService.ts +0 -72
  156. package/src/_internal/platform/inlineCompletions/common/api.ts +0 -198
  157. package/src/_internal/platform/inlineEdits/common/dataTypes/diagnosticData.ts +0 -32
  158. package/src/_internal/platform/inlineEdits/common/dataTypes/documentId.ts +0 -52
  159. package/src/_internal/platform/inlineEdits/common/dataTypes/edit.ts +0 -165
  160. package/src/_internal/platform/inlineEdits/common/dataTypes/editUtils.ts +0 -74
  161. package/src/_internal/platform/inlineEdits/common/dataTypes/fetchCancellationError.ts +0 -14
  162. package/src/_internal/platform/inlineEdits/common/dataTypes/languageContext.ts +0 -107
  163. package/src/_internal/platform/inlineEdits/common/dataTypes/languageId.ts +0 -14
  164. package/src/_internal/platform/inlineEdits/common/dataTypes/permutation.ts +0 -69
  165. package/src/_internal/platform/inlineEdits/common/dataTypes/rootedLineEdit.ts +0 -49
  166. package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLength.ts +0 -74
  167. package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/combineTextEditInfos.ts +0 -132
  168. package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.ts +0 -184
  169. package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/textEditInfo.ts +0 -32
  170. package/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts +0 -89
  171. package/src/_internal/platform/inlineEdits/common/debugRecorderBookmark.ts +0 -10
  172. package/src/_internal/platform/inlineEdits/common/editReason.ts +0 -134
  173. package/src/_internal/platform/inlineEdits/common/inlineEditLogContext.ts +0 -490
  174. package/src/_internal/platform/inlineEdits/common/observableGit.ts +0 -49
  175. package/src/_internal/platform/inlineEdits/common/observableWorkspace.ts +0 -239
  176. package/src/_internal/platform/inlineEdits/common/responseProcessor.ts +0 -249
  177. package/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.ts +0 -468
  178. package/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.ts +0 -59
  179. package/src/_internal/platform/inlineEdits/common/utils/observable.ts +0 -54
  180. package/src/_internal/platform/inlineEdits/common/utils/stringifyChatMessages.ts +0 -29
  181. package/src/_internal/platform/inlineEdits/common/utils/utils.ts +0 -56
  182. package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/historyContextProvider.ts +0 -60
  183. package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesHistoryContextProvider.ts +0 -353
  184. package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesXtabHistoryTracker.ts +0 -176
  185. package/src/_internal/platform/languageContextProvider/common/languageContextProviderService.ts +0 -25
  186. package/src/_internal/platform/languageContextProvider/common/nullLanguageContextProviderService.ts +0 -38
  187. package/src/_internal/platform/languageServer/common/languageContextService.ts +0 -186
  188. package/src/_internal/platform/languages/common/languageDiagnosticsService.ts +0 -67
  189. package/src/_internal/platform/languages/common/testLanguageDiagnosticsService.ts +0 -28
  190. package/src/_internal/platform/log/common/logService.ts +0 -232
  191. package/src/_internal/platform/nesFetch/common/completionsAPI.ts +0 -78
  192. package/src/_internal/platform/nesFetch/common/completionsFetchService.ts +0 -118
  193. package/src/_internal/platform/nesFetch/common/responseStream.ts +0 -151
  194. package/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.ts +0 -236
  195. package/src/_internal/platform/nesFetch/node/streamTransformer.ts +0 -95
  196. package/src/_internal/platform/networking/common/fetch.ts +0 -349
  197. package/src/_internal/platform/networking/common/fetcherService.ts +0 -84
  198. package/src/_internal/platform/networking/common/networking.ts +0 -442
  199. package/src/_internal/platform/networking/common/openai.ts +0 -273
  200. package/src/_internal/platform/networking/node/chatStream.ts +0 -137
  201. package/src/_internal/platform/networking/node/stream.ts +0 -749
  202. package/src/_internal/platform/notebook/common/alternativeContent.ts +0 -89
  203. package/src/_internal/platform/notebook/common/alternativeContentFormat.ts +0 -10
  204. package/src/_internal/platform/notebook/common/alternativeContentProvider.json.ts +0 -262
  205. package/src/_internal/platform/notebook/common/alternativeContentProvider.text.ts +0 -243
  206. package/src/_internal/platform/notebook/common/alternativeContentProvider.ts +0 -41
  207. package/src/_internal/platform/notebook/common/alternativeContentProvider.xml.ts +0 -205
  208. package/src/_internal/platform/notebook/common/alternativeNotebookDocument.ts +0 -155
  209. package/src/_internal/platform/notebook/common/helpers.ts +0 -212
  210. package/src/_internal/platform/notebook/common/notebookService.ts +0 -43
  211. package/src/_internal/platform/openai/node/fetch.ts +0 -596
  212. package/src/_internal/platform/parser/node/nodes.ts +0 -190
  213. package/src/_internal/platform/requestLogger/node/nullRequestLogger.ts +0 -26
  214. package/src/_internal/platform/requestLogger/node/requestLogger.ts +0 -383
  215. package/src/_internal/platform/simulationTestContext/common/simulationTestContext.ts +0 -29
  216. package/src/_internal/platform/snippy/common/snippyService.ts +0 -25
  217. package/src/_internal/platform/telemetry/common/nullExperimentationService.ts +0 -64
  218. package/src/_internal/platform/telemetry/common/nullTelemetryService.ts +0 -53
  219. package/src/_internal/platform/telemetry/common/telemetry.ts +0 -215
  220. package/src/_internal/platform/telemetry/common/telemetryData.ts +0 -205
  221. package/src/_internal/platform/thinking/common/thinking.ts +0 -61
  222. package/src/_internal/platform/thinking/common/thinkingUtils.ts +0 -57
  223. package/src/_internal/platform/tokenizer/node/parseTikTokens.ts +0 -23
  224. package/src/_internal/platform/tokenizer/node/tikTokenizerImpl.ts +0 -74
  225. package/src/_internal/platform/tokenizer/node/tikTokenizerWorker.ts +0 -24
  226. package/src/_internal/platform/tokenizer/node/tokenizer.ts +0 -357
  227. package/src/_internal/platform/workspace/common/workspaceService.ts +0 -226
  228. package/src/_internal/platform/workspaceRecorder/common/workspaceLog.ts +0 -118
  229. package/src/_internal/util/common/anomalyDetection.ts +0 -112
  230. package/src/_internal/util/common/arrays.ts +0 -81
  231. package/src/_internal/util/common/async.ts +0 -155
  232. package/src/_internal/util/common/cache.ts +0 -183
  233. package/src/_internal/util/common/crypto.ts +0 -41
  234. package/src/_internal/util/common/errors.ts +0 -22
  235. package/src/_internal/util/common/globals.d.ts +0 -12
  236. package/src/_internal/util/common/imageUtils.ts +0 -154
  237. package/src/_internal/util/common/languages.ts +0 -940
  238. package/src/_internal/util/common/notebooks.ts +0 -286
  239. package/src/_internal/util/common/result.ts +0 -71
  240. package/src/_internal/util/common/services.ts +0 -43
  241. package/src/_internal/util/common/test/shims/chatTypes.ts +0 -448
  242. package/src/_internal/util/common/test/shims/editing.ts +0 -233
  243. package/src/_internal/util/common/test/shims/enums.ts +0 -61
  244. package/src/_internal/util/common/test/shims/l10n.ts +0 -37
  245. package/src/_internal/util/common/test/shims/newSymbolName.ts +0 -23
  246. package/src/_internal/util/common/test/shims/terminal.ts +0 -33
  247. package/src/_internal/util/common/test/shims/vscodeTypesShim.ts +0 -115
  248. package/src/_internal/util/common/time.ts +0 -31
  249. package/src/_internal/util/common/tokenizer.ts +0 -30
  250. package/src/_internal/util/common/tracing.ts +0 -52
  251. package/src/_internal/util/common/types.ts +0 -33
  252. package/src/_internal/util/common/variableLengthQuantity.ts +0 -40
  253. package/src/_internal/util/node/worker.ts +0 -130
  254. package/src/_internal/util/vs/base/common/arrays.ts +0 -926
  255. package/src/_internal/util/vs/base/common/arraysFind.ts +0 -206
  256. package/src/_internal/util/vs/base/common/assert.ts +0 -89
  257. package/src/_internal/util/vs/base/common/async.ts +0 -2582
  258. package/src/_internal/util/vs/base/common/buffer.ts +0 -501
  259. package/src/_internal/util/vs/base/common/cache.ts +0 -122
  260. package/src/_internal/util/vs/base/common/cancellation.ts +0 -150
  261. package/src/_internal/util/vs/base/common/charCode.ts +0 -452
  262. package/src/_internal/util/vs/base/common/codicons.ts +0 -66
  263. package/src/_internal/util/vs/base/common/codiconsLibrary.ts +0 -618
  264. package/src/_internal/util/vs/base/common/codiconsUtil.ts +0 -30
  265. package/src/_internal/util/vs/base/common/collections.ts +0 -156
  266. package/src/_internal/util/vs/base/common/diff/diff.ts +0 -1317
  267. package/src/_internal/util/vs/base/common/diff/diffChange.ts +0 -62
  268. package/src/_internal/util/vs/base/common/equals.ts +0 -148
  269. package/src/_internal/util/vs/base/common/errors.ts +0 -342
  270. package/src/_internal/util/vs/base/common/event.ts +0 -1782
  271. package/src/_internal/util/vs/base/common/extpath.ts +0 -425
  272. package/src/_internal/util/vs/base/common/filters.ts +0 -928
  273. package/src/_internal/util/vs/base/common/functional.ts +0 -34
  274. package/src/_internal/util/vs/base/common/glob.ts +0 -839
  275. package/src/_internal/util/vs/base/common/hash.ts +0 -326
  276. package/src/_internal/util/vs/base/common/htmlContent.ts +0 -212
  277. package/src/_internal/util/vs/base/common/iconLabels.ts +0 -118
  278. package/src/_internal/util/vs/base/common/iterator.ts +0 -196
  279. package/src/_internal/util/vs/base/common/lazy.ts +0 -59
  280. package/src/_internal/util/vs/base/common/lifecycle.ts +0 -845
  281. package/src/_internal/util/vs/base/common/linkedList.ts +0 -144
  282. package/src/_internal/util/vs/base/common/map.ts +0 -954
  283. package/src/_internal/util/vs/base/common/marshallingIds.ts +0 -35
  284. package/src/_internal/util/vs/base/common/mime.ts +0 -136
  285. package/src/_internal/util/vs/base/common/naturalLanguage/korean.ts +0 -425
  286. package/src/_internal/util/vs/base/common/network.ts +0 -429
  287. package/src/_internal/util/vs/base/common/numbers.ts +0 -166
  288. package/src/_internal/util/vs/base/common/objects.ts +0 -242
  289. package/src/_internal/util/vs/base/common/observable.ts +0 -10
  290. package/src/_internal/util/vs/base/common/observableInternal/base.ts +0 -208
  291. package/src/_internal/util/vs/base/common/observableInternal/changeTracker.ts +0 -96
  292. package/src/_internal/util/vs/base/common/observableInternal/commonFacade/cancellation.ts +0 -9
  293. package/src/_internal/util/vs/base/common/observableInternal/commonFacade/deps.ts +0 -12
  294. package/src/_internal/util/vs/base/common/observableInternal/debugLocation.ts +0 -88
  295. package/src/_internal/util/vs/base/common/observableInternal/debugName.ts +0 -150
  296. package/src/_internal/util/vs/base/common/observableInternal/experimental/utils.ts +0 -62
  297. package/src/_internal/util/vs/base/common/observableInternal/index.ts +0 -61
  298. package/src/_internal/util/vs/base/common/observableInternal/logging/consoleObservableLogger.ts +0 -388
  299. package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerApi.d.ts +0 -154
  300. package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerRpc.ts +0 -80
  301. package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/devToolsLogger.ts +0 -485
  302. package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/rpc.ts +0 -103
  303. package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/utils.ts +0 -69
  304. package/src/_internal/util/vs/base/common/observableInternal/logging/logging.ts +0 -133
  305. package/src/_internal/util/vs/base/common/observableInternal/map.ts +0 -81
  306. package/src/_internal/util/vs/base/common/observableInternal/observables/baseObservable.ts +0 -172
  307. package/src/_internal/util/vs/base/common/observableInternal/observables/constObservable.ts +0 -44
  308. package/src/_internal/util/vs/base/common/observableInternal/observables/derived.ts +0 -190
  309. package/src/_internal/util/vs/base/common/observableInternal/observables/derivedImpl.ts +0 -445
  310. package/src/_internal/util/vs/base/common/observableInternal/observables/lazyObservableValue.ts +0 -154
  311. package/src/_internal/util/vs/base/common/observableInternal/observables/observableFromEvent.ts +0 -174
  312. package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignal.ts +0 -67
  313. package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignalFromEvent.ts +0 -62
  314. package/src/_internal/util/vs/base/common/observableInternal/observables/observableValue.ts +0 -131
  315. package/src/_internal/util/vs/base/common/observableInternal/observables/observableValueOpts.ts +0 -37
  316. package/src/_internal/util/vs/base/common/observableInternal/reactions/autorun.ts +0 -188
  317. package/src/_internal/util/vs/base/common/observableInternal/reactions/autorunImpl.ts +0 -256
  318. package/src/_internal/util/vs/base/common/observableInternal/set.ts +0 -78
  319. package/src/_internal/util/vs/base/common/observableInternal/transaction.ts +0 -115
  320. package/src/_internal/util/vs/base/common/observableInternal/utils/promise.ts +0 -129
  321. package/src/_internal/util/vs/base/common/observableInternal/utils/runOnChange.ts +0 -65
  322. package/src/_internal/util/vs/base/common/observableInternal/utils/utils.ts +0 -281
  323. package/src/_internal/util/vs/base/common/observableInternal/utils/utilsCancellation.ts +0 -101
  324. package/src/_internal/util/vs/base/common/observableInternal/utils/valueWithChangeEvent.ts +0 -31
  325. package/src/_internal/util/vs/base/common/path.ts +0 -1591
  326. package/src/_internal/util/vs/base/common/platform.ts +0 -282
  327. package/src/_internal/util/vs/base/common/process.ts +0 -78
  328. package/src/_internal/util/vs/base/common/resources.ts +0 -446
  329. package/src/_internal/util/vs/base/common/sequence.ts +0 -36
  330. package/src/_internal/util/vs/base/common/sseParser.ts +0 -247
  331. package/src/_internal/util/vs/base/common/stopwatch.ts +0 -43
  332. package/src/_internal/util/vs/base/common/stream.ts +0 -792
  333. package/src/_internal/util/vs/base/common/strings.ts +0 -1364
  334. package/src/_internal/util/vs/base/common/symbols.ts +0 -11
  335. package/src/_internal/util/vs/base/common/themables.ts +0 -106
  336. package/src/_internal/util/vs/base/common/types.ts +0 -345
  337. package/src/_internal/util/vs/base/common/uint.ts +0 -61
  338. package/src/_internal/util/vs/base/common/uri.ts +0 -752
  339. package/src/_internal/util/vs/base/common/uuid.ts +0 -72
  340. package/src/_internal/util/vs/base-common.d.ts +0 -42
  341. package/src/_internal/util/vs/editor/common/core/editOperation.ts +0 -62
  342. package/src/_internal/util/vs/editor/common/core/edits/edit.ts +0 -399
  343. package/src/_internal/util/vs/editor/common/core/edits/lineEdit.ts +0 -414
  344. package/src/_internal/util/vs/editor/common/core/edits/stringEdit.ts +0 -568
  345. package/src/_internal/util/vs/editor/common/core/edits/textEdit.ts +0 -411
  346. package/src/_internal/util/vs/editor/common/core/position.ts +0 -186
  347. package/src/_internal/util/vs/editor/common/core/range.ts +0 -519
  348. package/src/_internal/util/vs/editor/common/core/ranges/lineRange.ts +0 -416
  349. package/src/_internal/util/vs/editor/common/core/ranges/offsetRange.ts +0 -275
  350. package/src/_internal/util/vs/editor/common/core/text/abstractText.ts +0 -127
  351. package/src/_internal/util/vs/editor/common/core/text/positionToOffset.ts +0 -26
  352. package/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.ts +0 -144
  353. package/src/_internal/util/vs/editor/common/core/text/textLength.ts +0 -150
  354. package/src/_internal/util/vs/editor/common/core/wordHelper.ts +0 -177
  355. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts +0 -210
  356. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts +0 -109
  357. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts +0 -178
  358. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts +0 -331
  359. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts +0 -273
  360. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts +0 -475
  361. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts +0 -47
  362. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts +0 -248
  363. package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts +0 -76
  364. package/src/_internal/util/vs/editor/common/diff/legacyLinesDiffComputer.ts +0 -693
  365. package/src/_internal/util/vs/editor/common/diff/linesDiffComputer.ts +0 -61
  366. package/src/_internal/util/vs/editor/common/diff/rangeMapping.ts +0 -418
  367. package/src/_internal/util/vs/editor/common/model/prefixSumComputer.ts +0 -304
  368. package/src/_internal/util/vs/nls.messages.ts +0 -21
  369. package/src/_internal/util/vs/nls.ts +0 -243
  370. package/src/_internal/util/vs/platform/instantiation/common/descriptors.ts +0 -23
  371. package/src/_internal/util/vs/platform/instantiation/common/graph.ts +0 -113
  372. package/src/_internal/util/vs/platform/instantiation/common/instantiation.ts +0 -127
  373. package/src/_internal/util/vs/platform/instantiation/common/instantiationService.ts +0 -483
  374. package/src/_internal/util/vs/platform/instantiation/common/serviceCollection.ts +0 -34
  375. package/src/_internal/util/vs/vscode-globals-nls.d.ts +0 -42
  376. package/src/_internal/util/vs/vscode-globals-product.d.ts +0 -35
  377. package/src/_internal/util/vs/workbench/api/common/extHostTypes/diagnostic.ts +0 -109
  378. package/src/_internal/util/vs/workbench/api/common/extHostTypes/es5ClassCompat.ts +0 -34
  379. package/src/_internal/util/vs/workbench/api/common/extHostTypes/location.ts +0 -51
  380. package/src/_internal/util/vs/workbench/api/common/extHostTypes/markdownString.ts +0 -83
  381. package/src/_internal/util/vs/workbench/api/common/extHostTypes/notebooks.ts +0 -296
  382. package/src/_internal/util/vs/workbench/api/common/extHostTypes/position.ts +0 -195
  383. package/src/_internal/util/vs/workbench/api/common/extHostTypes/range.ts +0 -167
  384. package/src/_internal/util/vs/workbench/api/common/extHostTypes/selection.ts +0 -94
  385. package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetString.ts +0 -103
  386. package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetTextEdit.ts +0 -44
  387. package/src/_internal/util/vs/workbench/api/common/extHostTypes/symbolInformation.ts +0 -89
  388. package/src/_internal/util/vs/workbench/api/common/extHostTypes/textEdit.ts +0 -99
  389. package/src/_internal/vscodeTypes.ts +0 -100
  390. package/src/main.ts +0 -207
  391. package/src/package.json +0 -4063
@@ -1,127 +0,0 @@
1
- //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
2
-
3
- /*---------------------------------------------------------------------------------------------
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License. See License.txt in the project root for license information.
6
- *--------------------------------------------------------------------------------------------*/
7
-
8
- import { DisposableStore } from '../../../base/common/lifecycle';
9
- import * as descriptors from './descriptors';
10
- import { ServiceCollection } from './serviceCollection';
11
-
12
- // ------ internal util
13
-
14
- export namespace _util {
15
-
16
- export const serviceIds = new Map<string, ServiceIdentifier<any>>();
17
-
18
- export const DI_TARGET = '$di$target';
19
- export const DI_DEPENDENCIES = '$di$dependencies';
20
-
21
- export function getServiceDependencies(ctor: any): { id: ServiceIdentifier<any>; index: number }[] {
22
- return ctor[DI_DEPENDENCIES] || [];
23
- }
24
- }
25
-
26
- // --- interfaces ------
27
-
28
- export type BrandedService = { _serviceBrand: undefined };
29
-
30
- export interface IConstructorSignature<T, Args extends any[] = []> {
31
- new <Services extends BrandedService[]>(...args: [...Args, ...Services]): T;
32
- }
33
-
34
- export interface ServicesAccessor {
35
- get<T>(id: ServiceIdentifier<T>): T;
36
- getIfExists<T>(id: ServiceIdentifier<T>): T | undefined;
37
- }
38
-
39
- export const IInstantiationService = createDecorator<IInstantiationService>('instantiationService');
40
-
41
- /**
42
- * Given a list of arguments as a tuple, attempt to extract the leading, non-service arguments
43
- * to their own tuple.
44
- */
45
- export type GetLeadingNonServiceArgs<TArgs extends any[]> =
46
- TArgs extends [] ? []
47
- : TArgs extends [...infer TFirst, BrandedService] ? GetLeadingNonServiceArgs<TFirst>
48
- : TArgs;
49
-
50
- export interface IInstantiationService {
51
-
52
- readonly _serviceBrand: undefined;
53
-
54
- /**
55
- * Synchronously creates an instance that is denoted by the descriptor
56
- */
57
- createInstance<T>(descriptor: descriptors.SyncDescriptor0<T>): T;
58
- createInstance<Ctor extends new (...args: any[]) => unknown, R extends InstanceType<Ctor>>(ctor: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;
59
-
60
- /**
61
- * Calls a function with a service accessor.
62
- */
63
- invokeFunction<R, TS extends any[] = []>(fn: (accessor: ServicesAccessor, ...args: TS) => R, ...args: TS): R;
64
-
65
- /**
66
- * Creates a child of this service which inherits all current services
67
- * and adds/overwrites the given services.
68
- *
69
- * NOTE that the returned child is `disposable` and should be disposed when not used
70
- * anymore. This will also dispose all the services that this service has created.
71
- */
72
- createChild(services: ServiceCollection, store?: DisposableStore): IInstantiationService;
73
-
74
- /**
75
- * Disposes this instantiation service.
76
- *
77
- * - Will dispose all services that this instantiation service has created.
78
- * - Will dispose all its children but not its parent.
79
- * - Will NOT dispose services-instances that this service has been created with
80
- * - Will NOT dispose consumer-instances this service has created
81
- */
82
- dispose(): void;
83
- }
84
-
85
-
86
- /**
87
- * Identifies a service of type `T`.
88
- */
89
- export interface ServiceIdentifier<T> {
90
- (...args: any[]): void;
91
- type: T;
92
- }
93
-
94
- function storeServiceDependency(id: Function, target: Function, index: number): void {
95
- if ((target as any)[_util.DI_TARGET] === target) {
96
- (target as any)[_util.DI_DEPENDENCIES].push({ id, index });
97
- } else {
98
- (target as any)[_util.DI_DEPENDENCIES] = [{ id, index }];
99
- (target as any)[_util.DI_TARGET] = target;
100
- }
101
- }
102
-
103
- /**
104
- * The *only* valid way to create a {{ServiceIdentifier}}.
105
- */
106
- export function createDecorator<T>(serviceId: string): ServiceIdentifier<T> {
107
-
108
- if (_util.serviceIds.has(serviceId)) {
109
- return _util.serviceIds.get(serviceId)!;
110
- }
111
-
112
- const id = <any>function (target: Function, key: string, index: number) {
113
- if (arguments.length !== 3) {
114
- throw new Error('@IServiceName-decorator can only be used to decorate a parameter');
115
- }
116
- storeServiceDependency(id, target, index);
117
- };
118
-
119
- id.toString = () => serviceId;
120
-
121
- _util.serviceIds.set(serviceId, id);
122
- return id;
123
- }
124
-
125
- export function refineServiceDecorator<T1, T extends T1>(serviceIdentifier: ServiceIdentifier<T1>): ServiceIdentifier<T> {
126
- return <ServiceIdentifier<T>>serviceIdentifier;
127
- }
@@ -1,483 +0,0 @@
1
- //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
2
-
3
- /*---------------------------------------------------------------------------------------------
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License. See License.txt in the project root for license information.
6
- *--------------------------------------------------------------------------------------------*/
7
-
8
- import { GlobalIdleValue } from '../../../base/common/async';
9
- import { Event } from '../../../base/common/event';
10
- import { illegalState } from '../../../base/common/errors';
11
- import { DisposableStore, dispose, IDisposable, isDisposable, toDisposable } from '../../../base/common/lifecycle';
12
- import { SyncDescriptor, SyncDescriptor0 } from './descriptors';
13
- import { Graph } from './graph';
14
- import { GetLeadingNonServiceArgs, IInstantiationService, ServiceIdentifier, ServicesAccessor, _util } from './instantiation';
15
- import { ServiceCollection } from './serviceCollection';
16
- import { LinkedList } from '../../../base/common/linkedList';
17
-
18
- // TRACING
19
- const _enableAllTracing = false
20
- // || "TRUE" // DO NOT CHECK IN!
21
- ;
22
-
23
- class CyclicDependencyError extends Error {
24
- constructor(graph: Graph<any>) {
25
- super('cyclic dependency between services');
26
- this.message = graph.findCycleSlow() ?? `UNABLE to detect cycle, dumping graph: \n${graph.toString()}`;
27
- }
28
- }
29
-
30
- export class InstantiationService implements IInstantiationService {
31
-
32
- declare readonly _serviceBrand: undefined;
33
-
34
- readonly _globalGraph?: Graph<string>;
35
- private _globalGraphImplicitDependency?: string;
36
-
37
- private _isDisposed = false;
38
- private readonly _servicesToMaybeDispose = new Set<any>();
39
- private readonly _children = new Set<InstantiationService>();
40
-
41
- constructor(
42
- private readonly _services: ServiceCollection = new ServiceCollection(),
43
- private readonly _strict: boolean = false,
44
- private readonly _parent?: InstantiationService,
45
- private readonly _enableTracing: boolean = _enableAllTracing
46
- ) {
47
-
48
- this._services.set(IInstantiationService, this);
49
- this._globalGraph = _enableTracing ? _parent?._globalGraph ?? new Graph(e => e) : undefined;
50
- }
51
-
52
- dispose(): void {
53
- if (!this._isDisposed) {
54
- this._isDisposed = true;
55
- // dispose all child services
56
- dispose(this._children);
57
- this._children.clear();
58
-
59
- // dispose all services created by this service
60
- for (const candidate of this._servicesToMaybeDispose) {
61
- if (isDisposable(candidate)) {
62
- candidate.dispose();
63
- }
64
- }
65
- this._servicesToMaybeDispose.clear();
66
- }
67
- }
68
-
69
- private _throwIfDisposed(): void {
70
- if (this._isDisposed) {
71
- throw new Error('InstantiationService has been disposed');
72
- }
73
- }
74
-
75
- createChild(services: ServiceCollection, store?: DisposableStore): IInstantiationService {
76
- this._throwIfDisposed();
77
-
78
- const that = this;
79
- const result = new class extends InstantiationService {
80
- override dispose(): void {
81
- that._children.delete(result);
82
- super.dispose();
83
- }
84
- }(services, this._strict, this, this._enableTracing);
85
- this._children.add(result);
86
-
87
- store?.add(result);
88
- return result;
89
- }
90
-
91
- invokeFunction<R, TS extends any[] = []>(fn: (accessor: ServicesAccessor, ...args: TS) => R, ...args: TS): R {
92
- this._throwIfDisposed();
93
-
94
- const _trace = Trace.traceInvocation(this._enableTracing, fn);
95
- let _done = false;
96
- try {
97
- const accessor: ServicesAccessor = {
98
- get: <T>(id: ServiceIdentifier<T>) => {
99
-
100
- if (_done) {
101
- throw illegalState('service accessor is only valid during the invocation of its target method');
102
- }
103
-
104
- const result = this._getOrCreateServiceInstance(id, _trace);
105
- if (!result) {
106
- throw new Error(`[invokeFunction] unknown service '${id}'`);
107
- }
108
- return result;
109
- },
110
- getIfExists: <T>(id: ServiceIdentifier<T>) => {
111
- if (_done) {
112
- throw illegalState('service accessor is only valid during the invocation of its target method');
113
- }
114
- const result = this._getOrCreateServiceInstance(id, _trace);
115
- return result;
116
- }
117
- };
118
- return fn(accessor, ...args);
119
- } finally {
120
- _done = true;
121
- _trace.stop();
122
- }
123
- }
124
-
125
- createInstance<T>(descriptor: SyncDescriptor0<T>): T;
126
- createInstance<Ctor extends new (...args: any[]) => unknown, R extends InstanceType<Ctor>>(ctor: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;
127
- createInstance(ctorOrDescriptor: any | SyncDescriptor<any>, ...rest: any[]): unknown {
128
- this._throwIfDisposed();
129
-
130
- let _trace: Trace;
131
- let result: unknown;
132
- if (ctorOrDescriptor instanceof SyncDescriptor) {
133
- _trace = Trace.traceCreation(this._enableTracing, ctorOrDescriptor.ctor);
134
- result = this._createInstance(ctorOrDescriptor.ctor, ctorOrDescriptor.staticArguments.concat(rest), _trace);
135
- } else {
136
- _trace = Trace.traceCreation(this._enableTracing, ctorOrDescriptor);
137
- result = this._createInstance(ctorOrDescriptor, rest, _trace);
138
- }
139
- _trace.stop();
140
- return result;
141
- }
142
-
143
- private _createInstance<T>(ctor: any, args: any[] = [], _trace: Trace): T {
144
-
145
- // arguments defined by service decorators
146
- const serviceDependencies = _util.getServiceDependencies(ctor).sort((a, b) => a.index - b.index);
147
- const serviceArgs: any[] = [];
148
- for (const dependency of serviceDependencies) {
149
- const service = this._getOrCreateServiceInstance(dependency.id, _trace);
150
- if (!service) {
151
- this._throwIfStrict(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`, false);
152
- }
153
- serviceArgs.push(service);
154
- }
155
-
156
- const firstServiceArgPos = serviceDependencies.length > 0 ? serviceDependencies[0].index : args.length;
157
-
158
- // check for argument mismatches, adjust static args if needed
159
- if (args.length !== firstServiceArgPos) {
160
- console.trace(`[createInstance] First service dependency of ${ctor.name} at position ${firstServiceArgPos + 1} conflicts with ${args.length} static arguments`);
161
-
162
- const delta = firstServiceArgPos - args.length;
163
- if (delta > 0) {
164
- args = args.concat(new Array(delta));
165
- } else {
166
- args = args.slice(0, firstServiceArgPos);
167
- }
168
- }
169
-
170
- // now create the instance
171
- return Reflect.construct<any, T>(ctor, args.concat(serviceArgs));
172
- }
173
-
174
- private _setCreatedServiceInstance<T>(id: ServiceIdentifier<T>, instance: T): void {
175
- if (this._services.get(id) instanceof SyncDescriptor) {
176
- this._services.set(id, instance);
177
- } else if (this._parent) {
178
- this._parent._setCreatedServiceInstance(id, instance);
179
- } else {
180
- throw new Error('illegalState - setting UNKNOWN service instance');
181
- }
182
- }
183
-
184
- private _getServiceInstanceOrDescriptor<T>(id: ServiceIdentifier<T>): T | SyncDescriptor<T> {
185
- const instanceOrDesc = this._services.get(id);
186
- if (!instanceOrDesc && this._parent) {
187
- return this._parent._getServiceInstanceOrDescriptor(id);
188
- } else {
189
- return instanceOrDesc;
190
- }
191
- }
192
-
193
- protected _getOrCreateServiceInstance<T>(id: ServiceIdentifier<T>, _trace: Trace): T {
194
- if (this._globalGraph && this._globalGraphImplicitDependency) {
195
- this._globalGraph.insertEdge(this._globalGraphImplicitDependency, String(id));
196
- }
197
- const thing = this._getServiceInstanceOrDescriptor(id);
198
- if (thing instanceof SyncDescriptor) {
199
- return this._safeCreateAndCacheServiceInstance(id, thing, _trace.branch(id, true));
200
- } else {
201
- _trace.branch(id, false);
202
- return thing;
203
- }
204
- }
205
-
206
- private readonly _activeInstantiations = new Set<ServiceIdentifier<any>>();
207
-
208
-
209
- private _safeCreateAndCacheServiceInstance<T>(id: ServiceIdentifier<T>, desc: SyncDescriptor<T>, _trace: Trace): T {
210
- if (this._activeInstantiations.has(id)) {
211
- throw new Error(`illegal state - RECURSIVELY instantiating service '${id}'`);
212
- }
213
- this._activeInstantiations.add(id);
214
- try {
215
- return this._createAndCacheServiceInstance(id, desc, _trace);
216
- } finally {
217
- this._activeInstantiations.delete(id);
218
- }
219
- }
220
-
221
- private _createAndCacheServiceInstance<T>(id: ServiceIdentifier<T>, desc: SyncDescriptor<T>, _trace: Trace): T {
222
-
223
- type Triple = { id: ServiceIdentifier<any>; desc: SyncDescriptor<any>; _trace: Trace };
224
- const graph = new Graph<Triple>(data => data.id.toString());
225
-
226
- let cycleCount = 0;
227
- const stack = [{ id, desc, _trace }];
228
- const seen = new Set<string>();
229
- while (stack.length) {
230
- const item = stack.pop()!;
231
-
232
- if (seen.has(String(item.id))) {
233
- continue;
234
- }
235
- seen.add(String(item.id));
236
-
237
- graph.lookupOrInsertNode(item);
238
-
239
- // a weak but working heuristic for cycle checks
240
- if (cycleCount++ > 1000) {
241
- throw new CyclicDependencyError(graph);
242
- }
243
-
244
- // check all dependencies for existence and if they need to be created first
245
- for (const dependency of _util.getServiceDependencies(item.desc.ctor)) {
246
-
247
- const instanceOrDesc = this._getServiceInstanceOrDescriptor(dependency.id);
248
- if (!instanceOrDesc) {
249
- this._throwIfStrict(`[createInstance] ${id} depends on ${dependency.id} which is NOT registered.`, true);
250
- }
251
-
252
- // take note of all service dependencies
253
- this._globalGraph?.insertEdge(String(item.id), String(dependency.id));
254
-
255
- if (instanceOrDesc instanceof SyncDescriptor) {
256
- const d = { id: dependency.id, desc: instanceOrDesc, _trace: item._trace.branch(dependency.id, true) };
257
- graph.insertEdge(item, d);
258
- stack.push(d);
259
- }
260
- }
261
- }
262
-
263
- while (true) {
264
- const roots = graph.roots();
265
-
266
- // if there is no more roots but still
267
- // nodes in the graph we have a cycle
268
- if (roots.length === 0) {
269
- if (!graph.isEmpty()) {
270
- throw new CyclicDependencyError(graph);
271
- }
272
- break;
273
- }
274
-
275
- for (const { data } of roots) {
276
- // Repeat the check for this still being a service sync descriptor. That's because
277
- // instantiating a dependency might have side-effect and recursively trigger instantiation
278
- // so that some dependencies are now fullfilled already.
279
- const instanceOrDesc = this._getServiceInstanceOrDescriptor(data.id);
280
- if (instanceOrDesc instanceof SyncDescriptor) {
281
- // create instance and overwrite the service collections
282
- const instance = this._createServiceInstanceWithOwner(data.id, data.desc.ctor, data.desc.staticArguments, data.desc.supportsDelayedInstantiation, data._trace);
283
- this._setCreatedServiceInstance(data.id, instance);
284
- }
285
- graph.removeNode(data);
286
- }
287
- }
288
- return <T>this._getServiceInstanceOrDescriptor(id);
289
- }
290
-
291
- private _createServiceInstanceWithOwner<T>(id: ServiceIdentifier<T>, ctor: any, args: any[] = [], supportsDelayedInstantiation: boolean, _trace: Trace): T {
292
- if (this._services.get(id) instanceof SyncDescriptor) {
293
- return this._createServiceInstance(id, ctor, args, supportsDelayedInstantiation, _trace, this._servicesToMaybeDispose);
294
- } else if (this._parent) {
295
- return this._parent._createServiceInstanceWithOwner(id, ctor, args, supportsDelayedInstantiation, _trace);
296
- } else {
297
- throw new Error(`illegalState - creating UNKNOWN service instance ${ctor.name}`);
298
- }
299
- }
300
-
301
- private _createServiceInstance<T>(id: ServiceIdentifier<T>, ctor: any, args: any[] = [], supportsDelayedInstantiation: boolean, _trace: Trace, disposeBucket: Set<any>): T {
302
- if (!supportsDelayedInstantiation) {
303
- // eager instantiation
304
- const result = this._createInstance<T>(ctor, args, _trace);
305
- disposeBucket.add(result);
306
- return result;
307
-
308
- } else {
309
- const child = new InstantiationService(undefined, this._strict, this, this._enableTracing);
310
- child._globalGraphImplicitDependency = String(id);
311
-
312
- type EaryListenerData = {
313
- listener: Parameters<Event<any>>;
314
- disposable?: IDisposable;
315
- };
316
-
317
- // Return a proxy object that's backed by an idle value. That
318
- // strategy is to instantiate services in our idle time or when actually
319
- // needed but not when injected into a consumer
320
-
321
- // return "empty events" when the service isn't instantiated yet
322
- const earlyListeners = new Map<string, LinkedList<EaryListenerData>>();
323
-
324
- const idle = new GlobalIdleValue<any>(() => {
325
- const result = child._createInstance<T>(ctor, args, _trace);
326
-
327
- // early listeners that we kept are now being subscribed to
328
- // the real service
329
- for (const [key, values] of earlyListeners) {
330
- const candidate = <Event<any>>(<any>result)[key];
331
- if (typeof candidate === 'function') {
332
- for (const value of values) {
333
- value.disposable = candidate.apply(result, value.listener);
334
- }
335
- }
336
- }
337
- earlyListeners.clear();
338
- disposeBucket.add(result);
339
- return result;
340
- });
341
- return <T>new Proxy(Object.create(null), {
342
- get(target: any, key: PropertyKey): unknown {
343
-
344
- if (!idle.isInitialized) {
345
- // looks like an event
346
- if (typeof key === 'string' && (key.startsWith('onDid') || key.startsWith('onWill'))) {
347
- let list = earlyListeners.get(key);
348
- if (!list) {
349
- list = new LinkedList();
350
- earlyListeners.set(key, list);
351
- }
352
- const event: Event<any> = (callback, thisArg, disposables) => {
353
- if (idle.isInitialized) {
354
- return idle.value[key](callback, thisArg, disposables);
355
- } else {
356
- const entry: EaryListenerData = { listener: [callback, thisArg, disposables], disposable: undefined };
357
- const rm = list.push(entry);
358
- const result = toDisposable(() => {
359
- rm();
360
- entry.disposable?.dispose();
361
- });
362
- return result;
363
- }
364
- };
365
- return event;
366
- }
367
- }
368
-
369
- // value already exists
370
- if (key in target) {
371
- return target[key];
372
- }
373
-
374
- // create value
375
- const obj = idle.value;
376
- let prop = obj[key];
377
- if (typeof prop !== 'function') {
378
- return prop;
379
- }
380
- prop = prop.bind(obj);
381
- target[key] = prop;
382
- return prop;
383
- },
384
- set(_target: T, p: PropertyKey, value: any): boolean {
385
- idle.value[p] = value;
386
- return true;
387
- },
388
- getPrototypeOf(_target: T) {
389
- return ctor.prototype;
390
- }
391
- });
392
- }
393
- }
394
-
395
- private _throwIfStrict(msg: string, printWarning: boolean): void {
396
- if (printWarning) {
397
- console.warn(msg);
398
- }
399
- if (this._strict) {
400
- throw new Error(msg);
401
- }
402
- }
403
- }
404
-
405
- //#region -- tracing ---
406
-
407
- const enum TraceType {
408
- None = 0,
409
- Creation = 1,
410
- Invocation = 2,
411
- Branch = 3,
412
- }
413
-
414
- export class Trace {
415
-
416
- static all = new Set<string>();
417
-
418
- private static readonly _None = new class extends Trace {
419
- constructor() { super(TraceType.None, null); }
420
- override stop() { }
421
- override branch() { return this; }
422
- };
423
-
424
- static traceInvocation(_enableTracing: boolean, ctor: any): Trace {
425
- return !_enableTracing ? Trace._None : new Trace(TraceType.Invocation, ctor.name || new Error().stack!.split('\n').slice(3, 4).join('\n'));
426
- }
427
-
428
- static traceCreation(_enableTracing: boolean, ctor: any): Trace {
429
- return !_enableTracing ? Trace._None : new Trace(TraceType.Creation, ctor.name);
430
- }
431
-
432
- private static _totals: number = 0;
433
- private readonly _start: number = Date.now();
434
- private readonly _dep: [ServiceIdentifier<any>, boolean, Trace?][] = [];
435
-
436
- private constructor(
437
- readonly type: TraceType,
438
- readonly name: string | null
439
- ) { }
440
-
441
- branch(id: ServiceIdentifier<any>, first: boolean): Trace {
442
- const child = new Trace(TraceType.Branch, id.toString());
443
- this._dep.push([id, first, child]);
444
- return child;
445
- }
446
-
447
- stop() {
448
- const dur = Date.now() - this._start;
449
- Trace._totals += dur;
450
-
451
- let causedCreation = false;
452
-
453
- function printChild(n: number, trace: Trace) {
454
- const res: string[] = [];
455
- const prefix = new Array(n + 1).join('\t');
456
- for (const [id, first, child] of trace._dep) {
457
- if (first && child) {
458
- causedCreation = true;
459
- res.push(`${prefix}CREATES -> ${id}`);
460
- const nested = printChild(n + 1, child);
461
- if (nested) {
462
- res.push(nested);
463
- }
464
- } else {
465
- res.push(`${prefix}uses -> ${id}`);
466
- }
467
- }
468
- return res.join('\n');
469
- }
470
-
471
- const lines = [
472
- `${this.type === TraceType.Creation ? 'CREATE' : 'CALL'} ${this.name}`,
473
- `${printChild(1, this)}`,
474
- `DONE, took ${dur.toFixed(2)}ms (grand total ${Trace._totals.toFixed(2)}ms)`
475
- ];
476
-
477
- if (dur > 2 || causedCreation) {
478
- Trace.all.add(lines.join('\n'));
479
- }
480
- }
481
- }
482
-
483
- //#endregion
@@ -1,34 +0,0 @@
1
- //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
2
-
3
- /*---------------------------------------------------------------------------------------------
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License. See License.txt in the project root for license information.
6
- *--------------------------------------------------------------------------------------------*/
7
-
8
- import { ServiceIdentifier } from './instantiation';
9
- import { SyncDescriptor } from './descriptors';
10
-
11
- export class ServiceCollection {
12
-
13
- private _entries = new Map<ServiceIdentifier<any>, any>();
14
-
15
- constructor(...entries: [ServiceIdentifier<any>, any][]) {
16
- for (const [id, service] of entries) {
17
- this.set(id, service);
18
- }
19
- }
20
-
21
- set<T>(id: ServiceIdentifier<T>, instanceOrDescriptor: T | SyncDescriptor<T>): T | SyncDescriptor<T> {
22
- const result = this._entries.get(id);
23
- this._entries.set(id, instanceOrDescriptor);
24
- return result;
25
- }
26
-
27
- has(id: ServiceIdentifier<any>): boolean {
28
- return this._entries.has(id);
29
- }
30
-
31
- get<T>(id: ServiceIdentifier<T>): T | SyncDescriptor<T> {
32
- return this._entries.get(id);
33
- }
34
- }
@@ -1,42 +0,0 @@
1
- //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
2
-
3
- /*---------------------------------------------------------------------------------------------
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License. See License.txt in the project root for license information.
6
- *--------------------------------------------------------------------------------------------*/
7
-
8
- // AMD2ESM migration relevant
9
-
10
- /**
11
- * NLS Globals: these need to be defined in all contexts that make
12
- * use of our `nls.localize` and `nls.localize2` functions. This includes:
13
- * - Electron main process
14
- * - Electron window (renderer) process
15
- * - Utility Process
16
- * - Node.js
17
- * - Browser
18
- * - Web worker
19
- *
20
- * That is because during build time we strip out all english strings from
21
- * the resulting JS code and replace it with a <number> that is then looked
22
- * up from the `_VSCODE_NLS_MESSAGES` array.
23
- */
24
- declare global {
25
- /**
26
- * All NLS messages produced by `localize` and `localize2` calls
27
- * under `src/vs` translated to the language as indicated by
28
- * `_VSCODE_NLS_LANGUAGE`.
29
- *
30
- * Instead of accessing this global variable directly, use function getNLSMessages.
31
- */
32
- var _VSCODE_NLS_MESSAGES: string[];
33
- /**
34
- * The actual language of the NLS messages (e.g. 'en', de' or 'pt-br').
35
- *
36
- * Instead of accessing this global variable directly, use function getNLSLanguage.
37
- */
38
- var _VSCODE_NLS_LANGUAGE: string | undefined;
39
- }
40
-
41
- // fake export to make global work
42
- export { }