@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.
- package/dist/src/_internal/extension/xtab/common/promptCrafting.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js +6 -5
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +1 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +1 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/env/common/envService.d.ts +5 -0
- package/dist/src/_internal/platform/env/common/envService.d.ts.map +1 -1
- package/dist/src/_internal/platform/env/common/envService.js +2 -1
- package/dist/src/_internal/platform/env/common/envService.js.map +1 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.d.ts +3 -0
- package/dist/src/_internal/platform/env/common/nullEnvService.d.ts.map +1 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.js +8 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.js.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts +7 -0
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js +1 -0
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts +8 -0
- package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.js +19 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js +8 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js.map +1 -1
- package/dist/src/_internal/vscodeTypes.d.ts +4 -0
- package/dist/src/_internal/vscodeTypes.d.ts.map +1 -1
- package/dist/src/_internal/vscodeTypes.js +5 -1
- package/dist/src/_internal/vscodeTypes.js.map +1 -1
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +12 -0
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +46 -19
- package/package.json +3 -6
- package/src/_internal/extension/byok/node/openAIEndpoint.ts +0 -171
- package/src/_internal/extension/common/constants.ts +0 -90
- package/src/_internal/extension/inlineEdits/common/delayer.ts +0 -108
- package/src/_internal/extension/inlineEdits/common/editRebase.ts +0 -268
- package/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx +0 -163
- package/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.ts +0 -225
- package/src/_internal/extension/inlineEdits/common/rejectionCollector.ts +0 -164
- package/src/_internal/extension/inlineEdits/node/debugRecorder.ts +0 -205
- package/src/_internal/extension/inlineEdits/node/importFiltering.ts +0 -25
- package/src/_internal/extension/inlineEdits/node/nesConfigs.ts +0 -12
- package/src/_internal/extension/inlineEdits/node/nextEditCache.ts +0 -278
- package/src/_internal/extension/inlineEdits/node/nextEditProvider.ts +0 -778
- package/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.ts +0 -983
- package/src/_internal/extension/inlineEdits/node/nextEditResult.ts +0 -40
- package/src/_internal/extension/prompt/common/importStatement.ts +0 -25
- package/src/_internal/extension/prompt/node/chatMLFetcher.ts +0 -706
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.ts +0 -146
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.ts +0 -527
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.ts +0 -76
- package/src/_internal/extension/prompts/node/inline/visualization.ts +0 -65
- package/src/_internal/extension/vscode.proposed.activeComment.d.ts +0 -23
- package/src/_internal/extension/vscode.proposed.aiRelatedInformation.d.ts +0 -49
- package/src/_internal/extension/vscode.proposed.aiSettingsSearch.d.ts +0 -31
- package/src/_internal/extension/vscode.proposed.aiTextSearchProvider.d.ts +0 -41
- package/src/_internal/extension/vscode.proposed.authLearnMore.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.chatBinaryReferenceData.d.ts +0 -41
- package/src/_internal/extension/vscode.proposed.chatEditing.d.ts +0 -29
- package/src/_internal/extension/vscode.proposed.chatParticipantAdditions.d.ts +0 -636
- package/src/_internal/extension/vscode.proposed.chatParticipantPrivate.d.ts +0 -276
- package/src/_internal/extension/vscode.proposed.chatProvider.d.ts +0 -62
- package/src/_internal/extension/vscode.proposed.chatReadonlyPromptReference.d.ts +0 -17
- package/src/_internal/extension/vscode.proposed.chatReferenceDiagnostic.d.ts +0 -23
- package/src/_internal/extension/vscode.proposed.chatSessionsProvider.d.ts +0 -218
- package/src/_internal/extension/vscode.proposed.chatStatusItem.d.ts +0 -61
- package/src/_internal/extension/vscode.proposed.codeActionAI.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.commentReveal.d.ts +0 -32
- package/src/_internal/extension/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts +0 -8
- package/src/_internal/extension/vscode.proposed.contribCommentsViewThreadMenus.d.ts +0 -6
- package/src/_internal/extension/vscode.proposed.contribSourceControlInputBoxMenu.d.ts +0 -7
- package/src/_internal/extension/vscode.proposed.dataChannels.d.ts +0 -19
- package/src/_internal/extension/vscode.proposed.defaultChatParticipant.d.ts +0 -52
- package/src/_internal/extension/vscode.proposed.documentFiltersExclusive.d.ts +0 -13
- package/src/_internal/extension/vscode.proposed.embeddings.d.ts +0 -33
- package/src/_internal/extension/vscode.proposed.extensionsAny.d.ts +0 -40
- package/src/_internal/extension/vscode.proposed.findFiles2.d.ts +0 -125
- package/src/_internal/extension/vscode.proposed.findTextInFiles.d.ts +0 -104
- package/src/_internal/extension/vscode.proposed.findTextInFiles2.d.ts +0 -144
- package/src/_internal/extension/vscode.proposed.inlineCompletionsAdditions.d.ts +0 -202
- package/src/_internal/extension/vscode.proposed.interactive.d.ts +0 -11
- package/src/_internal/extension/vscode.proposed.languageModelCapabilities.d.ts +0 -25
- package/src/_internal/extension/vscode.proposed.languageModelDataPart.d.ts +0 -163
- package/src/_internal/extension/vscode.proposed.languageModelSystem.d.ts +0 -17
- package/src/_internal/extension/vscode.proposed.languageModelThinkingPart.d.ts +0 -49
- package/src/_internal/extension/vscode.proposed.languageModelToolResultAudience.d.ts +0 -36
- package/src/_internal/extension/vscode.proposed.mappedEditsProvider.d.ts +0 -110
- package/src/_internal/extension/vscode.proposed.newSymbolNamesProvider.d.ts +0 -47
- package/src/_internal/extension/vscode.proposed.readonlyMessage.d.ts +0 -14
- package/src/_internal/extension/vscode.proposed.resolvers.d.ts +0 -475
- package/src/_internal/extension/vscode.proposed.scmInputBoxValueProvider.d.ts +0 -25
- package/src/_internal/extension/vscode.proposed.taskProblemMatcherStatus.d.ts +0 -42
- package/src/_internal/extension/vscode.proposed.terminalDataWriteEvent.d.ts +0 -32
- package/src/_internal/extension/vscode.proposed.terminalExecuteCommandEvent.d.ts +0 -48
- package/src/_internal/extension/vscode.proposed.terminalQuickFixProvider.d.ts +0 -87
- package/src/_internal/extension/vscode.proposed.terminalSelection.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.testObserver.d.ts +0 -199
- package/src/_internal/extension/vscode.proposed.textDocumentChangeReason.d.ts +0 -30
- package/src/_internal/extension/vscode.proposed.textSearchProvider.d.ts +0 -281
- package/src/_internal/extension/vscode.proposed.textSearchProvider2.d.ts +0 -297
- package/src/_internal/extension/xtab/common/promptCrafting.ts +0 -670
- package/src/_internal/extension/xtab/node/xtabEndpoint.ts +0 -102
- package/src/_internal/extension/xtab/node/xtabProvider.ts +0 -976
- package/src/_internal/extension/xtab/node/xtabUtils.ts +0 -62
- package/src/_internal/platform/authentication/common/authentication.ts +0 -309
- package/src/_internal/platform/authentication/common/copilotToken.ts +0 -300
- package/src/_internal/platform/authentication/common/copilotTokenManager.ts +0 -59
- package/src/_internal/platform/authentication/common/copilotTokenStore.ts +0 -40
- package/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.ts +0 -96
- package/src/_internal/platform/authentication/node/copilotTokenManager.ts +0 -303
- package/src/_internal/platform/chat/common/chatMLFetcher.ts +0 -124
- package/src/_internal/platform/chat/common/chatQuotaService.ts +0 -63
- package/src/_internal/platform/chat/common/chatQuotaServiceImpl.ts +0 -96
- package/src/_internal/platform/chat/common/commonTypes.ts +0 -353
- package/src/_internal/platform/chat/common/conversationOptions.ts +0 -16
- package/src/_internal/platform/chat/common/globalStringUtils.ts +0 -54
- package/src/_internal/platform/chat/common/interactionService.ts +0 -35
- package/src/_internal/platform/configuration/common/configurationService.ts +0 -803
- package/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.ts +0 -39
- package/src/_internal/platform/configuration/common/jsonSchema.ts +0 -139
- package/src/_internal/platform/configuration/common/validator.ts +0 -242
- package/src/_internal/platform/diff/common/diffService.ts +0 -41
- package/src/_internal/platform/diff/common/diffWorker.ts +0 -83
- package/src/_internal/platform/diff/node/diffServiceImpl.ts +0 -85
- package/src/_internal/platform/editing/common/abstractText.ts +0 -177
- package/src/_internal/platform/editing/common/notebookDocumentSnapshot.ts +0 -122
- package/src/_internal/platform/editing/common/positionOffsetTransformer.ts +0 -202
- package/src/_internal/platform/editing/common/textDocumentSnapshot.ts +0 -274
- package/src/_internal/platform/endpoint/common/capiClient.ts +0 -37
- package/src/_internal/platform/endpoint/common/chatModelCapabilities.ts +0 -115
- package/src/_internal/platform/endpoint/common/domainService.ts +0 -27
- package/src/_internal/platform/endpoint/common/endpointProvider.ts +0 -104
- package/src/_internal/platform/endpoint/common/endpointTypes.ts +0 -12
- package/src/_internal/platform/endpoint/common/licenseAgreement.ts +0 -11
- package/src/_internal/platform/endpoint/common/statefulMarkerContainer.tsx +0 -85
- package/src/_internal/platform/endpoint/common/thinkingDataContainer.tsx +0 -44
- package/src/_internal/platform/endpoint/node/capiClientImpl.ts +0 -18
- package/src/_internal/platform/endpoint/node/chatEndpoint.ts +0 -435
- package/src/_internal/platform/endpoint/node/domainServiceImpl.ts +0 -80
- package/src/_internal/platform/endpoint/node/proxyXtabEndpoint.ts +0 -43
- package/src/_internal/platform/endpoint/node/responsesApi.ts +0 -326
- package/src/_internal/platform/env/common/envService.ts +0 -134
- package/src/_internal/platform/env/common/nullEnvService.ts +0 -68
- package/src/_internal/platform/env/common/packagejson.ts +0 -49
- package/src/_internal/platform/git/common/gitExtensionService.ts +0 -21
- package/src/_internal/platform/git/common/nullGitExtensionService.ts +0 -20
- package/src/_internal/platform/git/vscode/git.d.ts +0 -414
- package/src/_internal/platform/github/common/githubAPI.ts +0 -44
- package/src/_internal/platform/github/common/githubService.ts +0 -87
- package/src/_internal/platform/github/common/nullOctokitServiceImpl.ts +0 -21
- package/src/_internal/platform/ignore/common/ignoreService.ts +0 -72
- package/src/_internal/platform/inlineCompletions/common/api.ts +0 -198
- package/src/_internal/platform/inlineEdits/common/dataTypes/diagnosticData.ts +0 -32
- package/src/_internal/platform/inlineEdits/common/dataTypes/documentId.ts +0 -52
- package/src/_internal/platform/inlineEdits/common/dataTypes/edit.ts +0 -165
- package/src/_internal/platform/inlineEdits/common/dataTypes/editUtils.ts +0 -74
- package/src/_internal/platform/inlineEdits/common/dataTypes/fetchCancellationError.ts +0 -14
- package/src/_internal/platform/inlineEdits/common/dataTypes/languageContext.ts +0 -107
- package/src/_internal/platform/inlineEdits/common/dataTypes/languageId.ts +0 -14
- package/src/_internal/platform/inlineEdits/common/dataTypes/permutation.ts +0 -69
- package/src/_internal/platform/inlineEdits/common/dataTypes/rootedLineEdit.ts +0 -49
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLength.ts +0 -74
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/combineTextEditInfos.ts +0 -132
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.ts +0 -184
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/textEditInfo.ts +0 -32
- package/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts +0 -89
- package/src/_internal/platform/inlineEdits/common/debugRecorderBookmark.ts +0 -10
- package/src/_internal/platform/inlineEdits/common/editReason.ts +0 -134
- package/src/_internal/platform/inlineEdits/common/inlineEditLogContext.ts +0 -490
- package/src/_internal/platform/inlineEdits/common/observableGit.ts +0 -49
- package/src/_internal/platform/inlineEdits/common/observableWorkspace.ts +0 -239
- package/src/_internal/platform/inlineEdits/common/responseProcessor.ts +0 -249
- package/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.ts +0 -468
- package/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.ts +0 -59
- package/src/_internal/platform/inlineEdits/common/utils/observable.ts +0 -54
- package/src/_internal/platform/inlineEdits/common/utils/stringifyChatMessages.ts +0 -29
- package/src/_internal/platform/inlineEdits/common/utils/utils.ts +0 -56
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/historyContextProvider.ts +0 -60
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesHistoryContextProvider.ts +0 -353
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesXtabHistoryTracker.ts +0 -176
- package/src/_internal/platform/languageContextProvider/common/languageContextProviderService.ts +0 -25
- package/src/_internal/platform/languageContextProvider/common/nullLanguageContextProviderService.ts +0 -38
- package/src/_internal/platform/languageServer/common/languageContextService.ts +0 -186
- package/src/_internal/platform/languages/common/languageDiagnosticsService.ts +0 -67
- package/src/_internal/platform/languages/common/testLanguageDiagnosticsService.ts +0 -28
- package/src/_internal/platform/log/common/logService.ts +0 -232
- package/src/_internal/platform/nesFetch/common/completionsAPI.ts +0 -78
- package/src/_internal/platform/nesFetch/common/completionsFetchService.ts +0 -118
- package/src/_internal/platform/nesFetch/common/responseStream.ts +0 -151
- package/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.ts +0 -236
- package/src/_internal/platform/nesFetch/node/streamTransformer.ts +0 -95
- package/src/_internal/platform/networking/common/fetch.ts +0 -349
- package/src/_internal/platform/networking/common/fetcherService.ts +0 -84
- package/src/_internal/platform/networking/common/networking.ts +0 -442
- package/src/_internal/platform/networking/common/openai.ts +0 -273
- package/src/_internal/platform/networking/node/chatStream.ts +0 -137
- package/src/_internal/platform/networking/node/stream.ts +0 -749
- package/src/_internal/platform/notebook/common/alternativeContent.ts +0 -89
- package/src/_internal/platform/notebook/common/alternativeContentFormat.ts +0 -10
- package/src/_internal/platform/notebook/common/alternativeContentProvider.json.ts +0 -262
- package/src/_internal/platform/notebook/common/alternativeContentProvider.text.ts +0 -243
- package/src/_internal/platform/notebook/common/alternativeContentProvider.ts +0 -41
- package/src/_internal/platform/notebook/common/alternativeContentProvider.xml.ts +0 -205
- package/src/_internal/platform/notebook/common/alternativeNotebookDocument.ts +0 -155
- package/src/_internal/platform/notebook/common/helpers.ts +0 -212
- package/src/_internal/platform/notebook/common/notebookService.ts +0 -43
- package/src/_internal/platform/openai/node/fetch.ts +0 -596
- package/src/_internal/platform/parser/node/nodes.ts +0 -190
- package/src/_internal/platform/requestLogger/node/nullRequestLogger.ts +0 -26
- package/src/_internal/platform/requestLogger/node/requestLogger.ts +0 -383
- package/src/_internal/platform/simulationTestContext/common/simulationTestContext.ts +0 -29
- package/src/_internal/platform/snippy/common/snippyService.ts +0 -25
- package/src/_internal/platform/telemetry/common/nullExperimentationService.ts +0 -64
- package/src/_internal/platform/telemetry/common/nullTelemetryService.ts +0 -53
- package/src/_internal/platform/telemetry/common/telemetry.ts +0 -215
- package/src/_internal/platform/telemetry/common/telemetryData.ts +0 -205
- package/src/_internal/platform/thinking/common/thinking.ts +0 -61
- package/src/_internal/platform/thinking/common/thinkingUtils.ts +0 -57
- package/src/_internal/platform/tokenizer/node/parseTikTokens.ts +0 -23
- package/src/_internal/platform/tokenizer/node/tikTokenizerImpl.ts +0 -74
- package/src/_internal/platform/tokenizer/node/tikTokenizerWorker.ts +0 -24
- package/src/_internal/platform/tokenizer/node/tokenizer.ts +0 -357
- package/src/_internal/platform/workspace/common/workspaceService.ts +0 -226
- package/src/_internal/platform/workspaceRecorder/common/workspaceLog.ts +0 -118
- package/src/_internal/util/common/anomalyDetection.ts +0 -112
- package/src/_internal/util/common/arrays.ts +0 -81
- package/src/_internal/util/common/async.ts +0 -155
- package/src/_internal/util/common/cache.ts +0 -183
- package/src/_internal/util/common/crypto.ts +0 -41
- package/src/_internal/util/common/errors.ts +0 -22
- package/src/_internal/util/common/globals.d.ts +0 -12
- package/src/_internal/util/common/imageUtils.ts +0 -154
- package/src/_internal/util/common/languages.ts +0 -940
- package/src/_internal/util/common/notebooks.ts +0 -286
- package/src/_internal/util/common/result.ts +0 -71
- package/src/_internal/util/common/services.ts +0 -43
- package/src/_internal/util/common/test/shims/chatTypes.ts +0 -448
- package/src/_internal/util/common/test/shims/editing.ts +0 -233
- package/src/_internal/util/common/test/shims/enums.ts +0 -61
- package/src/_internal/util/common/test/shims/l10n.ts +0 -37
- package/src/_internal/util/common/test/shims/newSymbolName.ts +0 -23
- package/src/_internal/util/common/test/shims/terminal.ts +0 -33
- package/src/_internal/util/common/test/shims/vscodeTypesShim.ts +0 -115
- package/src/_internal/util/common/time.ts +0 -31
- package/src/_internal/util/common/tokenizer.ts +0 -30
- package/src/_internal/util/common/tracing.ts +0 -52
- package/src/_internal/util/common/types.ts +0 -33
- package/src/_internal/util/common/variableLengthQuantity.ts +0 -40
- package/src/_internal/util/node/worker.ts +0 -130
- package/src/_internal/util/vs/base/common/arrays.ts +0 -926
- package/src/_internal/util/vs/base/common/arraysFind.ts +0 -206
- package/src/_internal/util/vs/base/common/assert.ts +0 -89
- package/src/_internal/util/vs/base/common/async.ts +0 -2582
- package/src/_internal/util/vs/base/common/buffer.ts +0 -501
- package/src/_internal/util/vs/base/common/cache.ts +0 -122
- package/src/_internal/util/vs/base/common/cancellation.ts +0 -150
- package/src/_internal/util/vs/base/common/charCode.ts +0 -452
- package/src/_internal/util/vs/base/common/codicons.ts +0 -66
- package/src/_internal/util/vs/base/common/codiconsLibrary.ts +0 -618
- package/src/_internal/util/vs/base/common/codiconsUtil.ts +0 -30
- package/src/_internal/util/vs/base/common/collections.ts +0 -156
- package/src/_internal/util/vs/base/common/diff/diff.ts +0 -1317
- package/src/_internal/util/vs/base/common/diff/diffChange.ts +0 -62
- package/src/_internal/util/vs/base/common/equals.ts +0 -148
- package/src/_internal/util/vs/base/common/errors.ts +0 -342
- package/src/_internal/util/vs/base/common/event.ts +0 -1782
- package/src/_internal/util/vs/base/common/extpath.ts +0 -425
- package/src/_internal/util/vs/base/common/filters.ts +0 -928
- package/src/_internal/util/vs/base/common/functional.ts +0 -34
- package/src/_internal/util/vs/base/common/glob.ts +0 -839
- package/src/_internal/util/vs/base/common/hash.ts +0 -326
- package/src/_internal/util/vs/base/common/htmlContent.ts +0 -212
- package/src/_internal/util/vs/base/common/iconLabels.ts +0 -118
- package/src/_internal/util/vs/base/common/iterator.ts +0 -196
- package/src/_internal/util/vs/base/common/lazy.ts +0 -59
- package/src/_internal/util/vs/base/common/lifecycle.ts +0 -845
- package/src/_internal/util/vs/base/common/linkedList.ts +0 -144
- package/src/_internal/util/vs/base/common/map.ts +0 -954
- package/src/_internal/util/vs/base/common/marshallingIds.ts +0 -35
- package/src/_internal/util/vs/base/common/mime.ts +0 -136
- package/src/_internal/util/vs/base/common/naturalLanguage/korean.ts +0 -425
- package/src/_internal/util/vs/base/common/network.ts +0 -429
- package/src/_internal/util/vs/base/common/numbers.ts +0 -166
- package/src/_internal/util/vs/base/common/objects.ts +0 -242
- package/src/_internal/util/vs/base/common/observable.ts +0 -10
- package/src/_internal/util/vs/base/common/observableInternal/base.ts +0 -208
- package/src/_internal/util/vs/base/common/observableInternal/changeTracker.ts +0 -96
- package/src/_internal/util/vs/base/common/observableInternal/commonFacade/cancellation.ts +0 -9
- package/src/_internal/util/vs/base/common/observableInternal/commonFacade/deps.ts +0 -12
- package/src/_internal/util/vs/base/common/observableInternal/debugLocation.ts +0 -88
- package/src/_internal/util/vs/base/common/observableInternal/debugName.ts +0 -150
- package/src/_internal/util/vs/base/common/observableInternal/experimental/utils.ts +0 -62
- package/src/_internal/util/vs/base/common/observableInternal/index.ts +0 -61
- package/src/_internal/util/vs/base/common/observableInternal/logging/consoleObservableLogger.ts +0 -388
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerApi.d.ts +0 -154
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerRpc.ts +0 -80
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/devToolsLogger.ts +0 -485
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/rpc.ts +0 -103
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/utils.ts +0 -69
- package/src/_internal/util/vs/base/common/observableInternal/logging/logging.ts +0 -133
- package/src/_internal/util/vs/base/common/observableInternal/map.ts +0 -81
- package/src/_internal/util/vs/base/common/observableInternal/observables/baseObservable.ts +0 -172
- package/src/_internal/util/vs/base/common/observableInternal/observables/constObservable.ts +0 -44
- package/src/_internal/util/vs/base/common/observableInternal/observables/derived.ts +0 -190
- package/src/_internal/util/vs/base/common/observableInternal/observables/derivedImpl.ts +0 -445
- package/src/_internal/util/vs/base/common/observableInternal/observables/lazyObservableValue.ts +0 -154
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableFromEvent.ts +0 -174
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignal.ts +0 -67
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignalFromEvent.ts +0 -62
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableValue.ts +0 -131
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableValueOpts.ts +0 -37
- package/src/_internal/util/vs/base/common/observableInternal/reactions/autorun.ts +0 -188
- package/src/_internal/util/vs/base/common/observableInternal/reactions/autorunImpl.ts +0 -256
- package/src/_internal/util/vs/base/common/observableInternal/set.ts +0 -78
- package/src/_internal/util/vs/base/common/observableInternal/transaction.ts +0 -115
- package/src/_internal/util/vs/base/common/observableInternal/utils/promise.ts +0 -129
- package/src/_internal/util/vs/base/common/observableInternal/utils/runOnChange.ts +0 -65
- package/src/_internal/util/vs/base/common/observableInternal/utils/utils.ts +0 -281
- package/src/_internal/util/vs/base/common/observableInternal/utils/utilsCancellation.ts +0 -101
- package/src/_internal/util/vs/base/common/observableInternal/utils/valueWithChangeEvent.ts +0 -31
- package/src/_internal/util/vs/base/common/path.ts +0 -1591
- package/src/_internal/util/vs/base/common/platform.ts +0 -282
- package/src/_internal/util/vs/base/common/process.ts +0 -78
- package/src/_internal/util/vs/base/common/resources.ts +0 -446
- package/src/_internal/util/vs/base/common/sequence.ts +0 -36
- package/src/_internal/util/vs/base/common/sseParser.ts +0 -247
- package/src/_internal/util/vs/base/common/stopwatch.ts +0 -43
- package/src/_internal/util/vs/base/common/stream.ts +0 -792
- package/src/_internal/util/vs/base/common/strings.ts +0 -1364
- package/src/_internal/util/vs/base/common/symbols.ts +0 -11
- package/src/_internal/util/vs/base/common/themables.ts +0 -106
- package/src/_internal/util/vs/base/common/types.ts +0 -345
- package/src/_internal/util/vs/base/common/uint.ts +0 -61
- package/src/_internal/util/vs/base/common/uri.ts +0 -752
- package/src/_internal/util/vs/base/common/uuid.ts +0 -72
- package/src/_internal/util/vs/base-common.d.ts +0 -42
- package/src/_internal/util/vs/editor/common/core/editOperation.ts +0 -62
- package/src/_internal/util/vs/editor/common/core/edits/edit.ts +0 -399
- package/src/_internal/util/vs/editor/common/core/edits/lineEdit.ts +0 -414
- package/src/_internal/util/vs/editor/common/core/edits/stringEdit.ts +0 -568
- package/src/_internal/util/vs/editor/common/core/edits/textEdit.ts +0 -411
- package/src/_internal/util/vs/editor/common/core/position.ts +0 -186
- package/src/_internal/util/vs/editor/common/core/range.ts +0 -519
- package/src/_internal/util/vs/editor/common/core/ranges/lineRange.ts +0 -416
- package/src/_internal/util/vs/editor/common/core/ranges/offsetRange.ts +0 -275
- package/src/_internal/util/vs/editor/common/core/text/abstractText.ts +0 -127
- package/src/_internal/util/vs/editor/common/core/text/positionToOffset.ts +0 -26
- package/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.ts +0 -144
- package/src/_internal/util/vs/editor/common/core/text/textLength.ts +0 -150
- package/src/_internal/util/vs/editor/common/core/wordHelper.ts +0 -177
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts +0 -210
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts +0 -109
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts +0 -178
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts +0 -331
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts +0 -273
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts +0 -475
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts +0 -47
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts +0 -248
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts +0 -76
- package/src/_internal/util/vs/editor/common/diff/legacyLinesDiffComputer.ts +0 -693
- package/src/_internal/util/vs/editor/common/diff/linesDiffComputer.ts +0 -61
- package/src/_internal/util/vs/editor/common/diff/rangeMapping.ts +0 -418
- package/src/_internal/util/vs/editor/common/model/prefixSumComputer.ts +0 -304
- package/src/_internal/util/vs/nls.messages.ts +0 -21
- package/src/_internal/util/vs/nls.ts +0 -243
- package/src/_internal/util/vs/platform/instantiation/common/descriptors.ts +0 -23
- package/src/_internal/util/vs/platform/instantiation/common/graph.ts +0 -113
- package/src/_internal/util/vs/platform/instantiation/common/instantiation.ts +0 -127
- package/src/_internal/util/vs/platform/instantiation/common/instantiationService.ts +0 -483
- package/src/_internal/util/vs/platform/instantiation/common/serviceCollection.ts +0 -34
- package/src/_internal/util/vs/vscode-globals-nls.d.ts +0 -42
- package/src/_internal/util/vs/vscode-globals-product.d.ts +0 -35
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/diagnostic.ts +0 -109
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/es5ClassCompat.ts +0 -34
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/location.ts +0 -51
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/markdownString.ts +0 -83
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/notebooks.ts +0 -296
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/position.ts +0 -195
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/range.ts +0 -167
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/selection.ts +0 -94
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetString.ts +0 -103
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetTextEdit.ts +0 -44
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/symbolInformation.ts +0 -89
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/textEdit.ts +0 -99
- package/src/_internal/vscodeTypes.ts +0 -100
- package/src/main.ts +0 -207
- package/src/package.json +0 -4063
package/src/_internal/util/vs/base/common/observableInternal/observables/observableFromEvent.ts
DELETED
|
@@ -1,174 +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 { IObservable, ITransaction } from '../base';
|
|
9
|
-
import { subtransaction } from '../transaction';
|
|
10
|
-
import { EqualityComparer, Event, IDisposable, strictEquals } from '../commonFacade/deps';
|
|
11
|
-
import { DebugOwner, DebugNameData, IDebugNameData } from '../debugName';
|
|
12
|
-
import { getLogger } from '../logging/logging';
|
|
13
|
-
import { BaseObservable } from './baseObservable';
|
|
14
|
-
import { DebugLocation } from '../debugLocation';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export function observableFromEvent<T, TArgs = unknown>(
|
|
18
|
-
owner: DebugOwner,
|
|
19
|
-
event: Event<TArgs>,
|
|
20
|
-
getValue: (args: TArgs | undefined) => T,
|
|
21
|
-
debugLocation?: DebugLocation,
|
|
22
|
-
): IObservable<T>;
|
|
23
|
-
export function observableFromEvent<T, TArgs = unknown>(
|
|
24
|
-
event: Event<TArgs>,
|
|
25
|
-
getValue: (args: TArgs | undefined) => T,
|
|
26
|
-
): IObservable<T>;
|
|
27
|
-
export function observableFromEvent(...args:
|
|
28
|
-
[owner: DebugOwner, event: Event<any>, getValue: (args: any | undefined) => any, debugLocation?: DebugLocation] |
|
|
29
|
-
[event: Event<any>, getValue: (args: any | undefined) => any]
|
|
30
|
-
): IObservable<any> {
|
|
31
|
-
let owner;
|
|
32
|
-
let event;
|
|
33
|
-
let getValue;
|
|
34
|
-
let debugLocation;
|
|
35
|
-
if (args.length === 2) {
|
|
36
|
-
[event, getValue] = args;
|
|
37
|
-
} else {
|
|
38
|
-
[owner, event, getValue, debugLocation] = args;
|
|
39
|
-
}
|
|
40
|
-
return new FromEventObservable(
|
|
41
|
-
new DebugNameData(owner, undefined, getValue),
|
|
42
|
-
event,
|
|
43
|
-
getValue,
|
|
44
|
-
() => FromEventObservable.globalTransaction,
|
|
45
|
-
strictEquals,
|
|
46
|
-
debugLocation ?? DebugLocation.ofCaller()
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function observableFromEventOpts<T, TArgs = unknown>(
|
|
51
|
-
options: IDebugNameData & {
|
|
52
|
-
equalsFn?: EqualityComparer<T>;
|
|
53
|
-
},
|
|
54
|
-
event: Event<TArgs>,
|
|
55
|
-
getValue: (args: TArgs | undefined) => T,
|
|
56
|
-
debugLocation = DebugLocation.ofCaller()
|
|
57
|
-
): IObservable<T> {
|
|
58
|
-
return new FromEventObservable(
|
|
59
|
-
new DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? getValue),
|
|
60
|
-
event,
|
|
61
|
-
getValue, () => FromEventObservable.globalTransaction, options.equalsFn ?? strictEquals, debugLocation
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export class FromEventObservable<TArgs, T> extends BaseObservable<T> {
|
|
66
|
-
public static globalTransaction: ITransaction | undefined;
|
|
67
|
-
|
|
68
|
-
private _value: T | undefined;
|
|
69
|
-
private _hasValue = false;
|
|
70
|
-
private _subscription: IDisposable | undefined;
|
|
71
|
-
|
|
72
|
-
constructor(
|
|
73
|
-
private readonly _debugNameData: DebugNameData,
|
|
74
|
-
private readonly event: Event<TArgs>,
|
|
75
|
-
public readonly _getValue: (args: TArgs | undefined) => T,
|
|
76
|
-
private readonly _getTransaction: () => ITransaction | undefined,
|
|
77
|
-
private readonly _equalityComparator: EqualityComparer<T>,
|
|
78
|
-
debugLocation: DebugLocation
|
|
79
|
-
) {
|
|
80
|
-
super(debugLocation);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private getDebugName(): string | undefined {
|
|
84
|
-
return this._debugNameData.getDebugName(this);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
public get debugName(): string {
|
|
88
|
-
const name = this.getDebugName();
|
|
89
|
-
return 'From Event' + (name ? `: ${name}` : '');
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
protected override onFirstObserverAdded(): void {
|
|
93
|
-
this._subscription = this.event(this.handleEvent);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
private readonly handleEvent = (args: TArgs | undefined) => {
|
|
97
|
-
const newValue = this._getValue(args);
|
|
98
|
-
const oldValue = this._value;
|
|
99
|
-
|
|
100
|
-
const didChange = !this._hasValue || !(this._equalityComparator(oldValue!, newValue));
|
|
101
|
-
let didRunTransaction = false;
|
|
102
|
-
|
|
103
|
-
if (didChange) {
|
|
104
|
-
this._value = newValue;
|
|
105
|
-
|
|
106
|
-
if (this._hasValue) {
|
|
107
|
-
didRunTransaction = true;
|
|
108
|
-
subtransaction(
|
|
109
|
-
this._getTransaction(),
|
|
110
|
-
(tx) => {
|
|
111
|
-
getLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });
|
|
112
|
-
|
|
113
|
-
for (const o of this._observers) {
|
|
114
|
-
tx.updateObserver(o, this);
|
|
115
|
-
o.handleChange(this, undefined);
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
() => {
|
|
119
|
-
const name = this.getDebugName();
|
|
120
|
-
return 'Event fired' + (name ? `: ${name}` : '');
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
this._hasValue = true;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (!didRunTransaction) {
|
|
128
|
-
getLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
protected override onLastObserverRemoved(): void {
|
|
133
|
-
this._subscription!.dispose();
|
|
134
|
-
this._subscription = undefined;
|
|
135
|
-
this._hasValue = false;
|
|
136
|
-
this._value = undefined;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
public get(): T {
|
|
140
|
-
if (this._subscription) {
|
|
141
|
-
if (!this._hasValue) {
|
|
142
|
-
this.handleEvent(undefined);
|
|
143
|
-
}
|
|
144
|
-
return this._value!;
|
|
145
|
-
} else {
|
|
146
|
-
// no cache, as there are no subscribers to keep it updated
|
|
147
|
-
const value = this._getValue(undefined);
|
|
148
|
-
return value;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
public debugSetValue(value: unknown) {
|
|
153
|
-
this._value = value as any;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export namespace observableFromEvent {
|
|
158
|
-
export const Observer = FromEventObservable;
|
|
159
|
-
|
|
160
|
-
export function batchEventsGlobally(tx: ITransaction, fn: () => void): void {
|
|
161
|
-
let didSet = false;
|
|
162
|
-
if (FromEventObservable.globalTransaction === undefined) {
|
|
163
|
-
FromEventObservable.globalTransaction = tx;
|
|
164
|
-
didSet = true;
|
|
165
|
-
}
|
|
166
|
-
try {
|
|
167
|
-
fn();
|
|
168
|
-
} finally {
|
|
169
|
-
if (didSet) {
|
|
170
|
-
FromEventObservable.globalTransaction = undefined;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignal.ts
DELETED
|
@@ -1,67 +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 { IObservableWithChange, ITransaction } from '../base';
|
|
9
|
-
import { transaction } from '../transaction';
|
|
10
|
-
import { DebugNameData } from '../debugName';
|
|
11
|
-
import { BaseObservable } from './baseObservable';
|
|
12
|
-
import { DebugLocation } from '../debugLocation';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Creates a signal that can be triggered to invalidate observers.
|
|
16
|
-
* Signals don't have a value - when they are triggered they indicate a change.
|
|
17
|
-
* However, signals can carry a delta that is passed to observers.
|
|
18
|
-
*/
|
|
19
|
-
export function observableSignal<TDelta = void>(debugName: string): IObservableSignal<TDelta>;
|
|
20
|
-
export function observableSignal<TDelta = void>(owner: object): IObservableSignal<TDelta>;
|
|
21
|
-
export function observableSignal<TDelta = void>(debugNameOrOwner: string | object, debugLocation = DebugLocation.ofCaller()): IObservableSignal<TDelta> {
|
|
22
|
-
if (typeof debugNameOrOwner === 'string') {
|
|
23
|
-
return new ObservableSignal<TDelta>(debugNameOrOwner, undefined, debugLocation);
|
|
24
|
-
} else {
|
|
25
|
-
return new ObservableSignal<TDelta>(undefined, debugNameOrOwner, debugLocation);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface IObservableSignal<TChange> extends IObservableWithChange<void, TChange> {
|
|
30
|
-
trigger(tx: ITransaction | undefined, change: TChange): void;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
class ObservableSignal<TChange> extends BaseObservable<void, TChange> implements IObservableSignal<TChange> {
|
|
34
|
-
public get debugName() {
|
|
35
|
-
return new DebugNameData(this._owner, this._debugName, undefined).getDebugName(this) ?? 'Observable Signal';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public override toString(): string {
|
|
39
|
-
return this.debugName;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
constructor(
|
|
43
|
-
private readonly _debugName: string | undefined,
|
|
44
|
-
private readonly _owner: object | undefined,
|
|
45
|
-
debugLocation: DebugLocation
|
|
46
|
-
) {
|
|
47
|
-
super(debugLocation);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public trigger(tx: ITransaction | undefined, change: TChange): void {
|
|
51
|
-
if (!tx) {
|
|
52
|
-
transaction(tx => {
|
|
53
|
-
this.trigger(tx, change);
|
|
54
|
-
}, () => `Trigger signal ${this.debugName}`);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
for (const o of this._observers) {
|
|
59
|
-
tx.updateObserver(o, this);
|
|
60
|
-
o.handleChange(this, change);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public override get(): void {
|
|
65
|
-
// NO OP
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,62 +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 { IObservable } from '../base';
|
|
9
|
-
import { transaction } from '../transaction';
|
|
10
|
-
import { Event, IDisposable } from '../commonFacade/deps';
|
|
11
|
-
import { DebugOwner, DebugNameData } from '../debugName';
|
|
12
|
-
import { BaseObservable } from './baseObservable';
|
|
13
|
-
import { DebugLocation } from '../debugLocation';
|
|
14
|
-
|
|
15
|
-
export function observableSignalFromEvent(
|
|
16
|
-
owner: DebugOwner | string,
|
|
17
|
-
event: Event<any>,
|
|
18
|
-
debugLocation = DebugLocation.ofCaller()
|
|
19
|
-
): IObservable<void> {
|
|
20
|
-
return new FromEventObservableSignal(typeof owner === 'string' ? owner : new DebugNameData(owner, undefined, undefined), event, debugLocation);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
class FromEventObservableSignal extends BaseObservable<void> {
|
|
24
|
-
private subscription: IDisposable | undefined;
|
|
25
|
-
|
|
26
|
-
public readonly debugName: string;
|
|
27
|
-
constructor(
|
|
28
|
-
debugNameDataOrName: DebugNameData | string,
|
|
29
|
-
private readonly event: Event<any>,
|
|
30
|
-
debugLocation: DebugLocation
|
|
31
|
-
) {
|
|
32
|
-
super(debugLocation);
|
|
33
|
-
this.debugName = typeof debugNameDataOrName === 'string'
|
|
34
|
-
? debugNameDataOrName
|
|
35
|
-
: debugNameDataOrName.getDebugName(this) ?? 'Observable Signal From Event';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
protected override onFirstObserverAdded(): void {
|
|
39
|
-
this.subscription = this.event(this.handleEvent);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private readonly handleEvent = () => {
|
|
43
|
-
transaction(
|
|
44
|
-
(tx) => {
|
|
45
|
-
for (const o of this._observers) {
|
|
46
|
-
tx.updateObserver(o, this);
|
|
47
|
-
o.handleChange(this, undefined);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
() => this.debugName
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
protected override onLastObserverRemoved(): void {
|
|
55
|
-
this.subscription!.dispose();
|
|
56
|
-
this.subscription = undefined;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public override get(): void {
|
|
60
|
-
// NO OP
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,131 +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 { ISettableObservable, ITransaction } from '../base';
|
|
9
|
-
import { TransactionImpl } from '../transaction';
|
|
10
|
-
import { BaseObservable } from './baseObservable';
|
|
11
|
-
import { EqualityComparer, IDisposable, strictEquals } from '../commonFacade/deps';
|
|
12
|
-
import { DebugNameData } from '../debugName';
|
|
13
|
-
import { getLogger } from '../logging/logging';
|
|
14
|
-
import { DebugLocation } from '../debugLocation';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Creates an observable value.
|
|
18
|
-
* Observers get informed when the value changes.
|
|
19
|
-
* @template TChange An arbitrary type to describe how or why the value changed. Defaults to `void`.
|
|
20
|
-
* Observers will receive every single change value.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export function observableValue<T, TChange = void>(name: string, initialValue: T): ISettableObservable<T, TChange>;
|
|
24
|
-
export function observableValue<T, TChange = void>(owner: object, initialValue: T): ISettableObservable<T, TChange>;
|
|
25
|
-
export function observableValue<T, TChange = void>(nameOrOwner: string | object, initialValue: T, debugLocation = DebugLocation.ofCaller()): ISettableObservable<T, TChange> {
|
|
26
|
-
let debugNameData: DebugNameData;
|
|
27
|
-
if (typeof nameOrOwner === 'string') {
|
|
28
|
-
debugNameData = new DebugNameData(undefined, nameOrOwner, undefined);
|
|
29
|
-
} else {
|
|
30
|
-
debugNameData = new DebugNameData(nameOrOwner, undefined, undefined);
|
|
31
|
-
}
|
|
32
|
-
return new ObservableValue(debugNameData, initialValue, strictEquals, debugLocation);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class ObservableValue<T, TChange = void>
|
|
36
|
-
extends BaseObservable<T, TChange>
|
|
37
|
-
implements ISettableObservable<T, TChange> {
|
|
38
|
-
protected _value: T;
|
|
39
|
-
|
|
40
|
-
get debugName() {
|
|
41
|
-
return this._debugNameData.getDebugName(this) ?? 'ObservableValue';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
constructor(
|
|
45
|
-
private readonly _debugNameData: DebugNameData,
|
|
46
|
-
initialValue: T,
|
|
47
|
-
private readonly _equalityComparator: EqualityComparer<T>,
|
|
48
|
-
debugLocation: DebugLocation
|
|
49
|
-
) {
|
|
50
|
-
super(debugLocation);
|
|
51
|
-
this._value = initialValue;
|
|
52
|
-
|
|
53
|
-
getLogger()?.handleObservableUpdated(this, { hadValue: false, newValue: initialValue, change: undefined, didChange: true, oldValue: undefined });
|
|
54
|
-
}
|
|
55
|
-
public override get(): T {
|
|
56
|
-
return this._value;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public set(value: T, tx: ITransaction | undefined, change: TChange): void {
|
|
60
|
-
if (change === undefined && this._equalityComparator(this._value, value)) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
let _tx: TransactionImpl | undefined;
|
|
65
|
-
if (!tx) {
|
|
66
|
-
tx = _tx = new TransactionImpl(() => { }, () => `Setting ${this.debugName}`);
|
|
67
|
-
}
|
|
68
|
-
try {
|
|
69
|
-
const oldValue = this._value;
|
|
70
|
-
this._setValue(value);
|
|
71
|
-
getLogger()?.handleObservableUpdated(this, { oldValue, newValue: value, change, didChange: true, hadValue: true });
|
|
72
|
-
|
|
73
|
-
for (const observer of this._observers) {
|
|
74
|
-
tx.updateObserver(observer, this);
|
|
75
|
-
observer.handleChange(this, change);
|
|
76
|
-
}
|
|
77
|
-
} finally {
|
|
78
|
-
if (_tx) {
|
|
79
|
-
_tx.finish();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
override toString(): string {
|
|
85
|
-
return `${this.debugName}: ${this._value}`;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
protected _setValue(newValue: T): void {
|
|
89
|
-
this._value = newValue;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public debugGetState() {
|
|
93
|
-
return {
|
|
94
|
-
value: this._value,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
public debugSetValue(value: unknown) {
|
|
99
|
-
this._value = value as T;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* A disposable observable. When disposed, its value is also disposed.
|
|
104
|
-
* When a new value is set, the previous value is disposed.
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
export function disposableObservableValue<T extends IDisposable | undefined, TChange = void>(nameOrOwner: string | object, initialValue: T, debugLocation = DebugLocation.ofCaller()): ISettableObservable<T, TChange> & IDisposable {
|
|
108
|
-
let debugNameData: DebugNameData;
|
|
109
|
-
if (typeof nameOrOwner === 'string') {
|
|
110
|
-
debugNameData = new DebugNameData(undefined, nameOrOwner, undefined);
|
|
111
|
-
} else {
|
|
112
|
-
debugNameData = new DebugNameData(nameOrOwner, undefined, undefined);
|
|
113
|
-
}
|
|
114
|
-
return new DisposableObservableValue(debugNameData, initialValue, strictEquals, debugLocation);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export class DisposableObservableValue<T extends IDisposable | undefined, TChange = void> extends ObservableValue<T, TChange> implements IDisposable {
|
|
118
|
-
protected override _setValue(newValue: T): void {
|
|
119
|
-
if (this._value === newValue) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (this._value) {
|
|
123
|
-
this._value.dispose();
|
|
124
|
-
}
|
|
125
|
-
this._value = newValue;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
public dispose(): void {
|
|
129
|
-
this._value?.dispose();
|
|
130
|
-
}
|
|
131
|
-
}
|
package/src/_internal/util/vs/base/common/observableInternal/observables/observableValueOpts.ts
DELETED
|
@@ -1,37 +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 { ISettableObservable } from '../base';
|
|
9
|
-
import { DebugNameData, IDebugNameData } from '../debugName';
|
|
10
|
-
import { EqualityComparer, strictEquals } from '../commonFacade/deps';
|
|
11
|
-
import { ObservableValue } from './observableValue';
|
|
12
|
-
import { LazyObservableValue } from './lazyObservableValue';
|
|
13
|
-
import { DebugLocation } from '../debugLocation';
|
|
14
|
-
|
|
15
|
-
export function observableValueOpts<T, TChange = void>(
|
|
16
|
-
options: IDebugNameData & {
|
|
17
|
-
equalsFn?: EqualityComparer<T>;
|
|
18
|
-
lazy?: boolean;
|
|
19
|
-
},
|
|
20
|
-
initialValue: T,
|
|
21
|
-
debugLocation = DebugLocation.ofCaller(),
|
|
22
|
-
): ISettableObservable<T, TChange> {
|
|
23
|
-
if (options.lazy) {
|
|
24
|
-
return new LazyObservableValue(
|
|
25
|
-
new DebugNameData(options.owner, options.debugName, undefined),
|
|
26
|
-
initialValue,
|
|
27
|
-
options.equalsFn ?? strictEquals,
|
|
28
|
-
debugLocation
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
return new ObservableValue(
|
|
32
|
-
new DebugNameData(options.owner, options.debugName, undefined),
|
|
33
|
-
initialValue,
|
|
34
|
-
options.equalsFn ?? strictEquals,
|
|
35
|
-
debugLocation
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,188 +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 { IReaderWithStore, IReader, IObservable } from '../base';
|
|
9
|
-
import { IChangeTracker } from '../changeTracker';
|
|
10
|
-
import { DisposableStore, IDisposable, toDisposable } from '../commonFacade/deps';
|
|
11
|
-
import { DebugNameData, IDebugNameData } from '../debugName';
|
|
12
|
-
import { AutorunObserver } from './autorunImpl';
|
|
13
|
-
import { DebugLocation } from '../debugLocation';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Runs immediately and whenever a transaction ends and an observed observable changed.
|
|
17
|
-
* {@link fn} should start with a JS Doc using `@description` to name the autorun.
|
|
18
|
-
*/
|
|
19
|
-
export function autorun(fn: (reader: IReaderWithStore) => void, debugLocation = DebugLocation.ofCaller()): IDisposable {
|
|
20
|
-
return new AutorunObserver(
|
|
21
|
-
new DebugNameData(undefined, undefined, fn),
|
|
22
|
-
fn,
|
|
23
|
-
undefined,
|
|
24
|
-
debugLocation
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Runs immediately and whenever a transaction ends and an observed observable changed.
|
|
30
|
-
* {@link fn} should start with a JS Doc using `@description` to name the autorun.
|
|
31
|
-
*/
|
|
32
|
-
export function autorunOpts(options: IDebugNameData & {}, fn: (reader: IReaderWithStore) => void, debugLocation = DebugLocation.ofCaller()): IDisposable {
|
|
33
|
-
return new AutorunObserver(
|
|
34
|
-
new DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? fn),
|
|
35
|
-
fn,
|
|
36
|
-
undefined,
|
|
37
|
-
debugLocation
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Runs immediately and whenever a transaction ends and an observed observable changed.
|
|
43
|
-
* {@link fn} should start with a JS Doc using `@description` to name the autorun.
|
|
44
|
-
*
|
|
45
|
-
* Use `changeTracker.createChangeSummary` to create a "change summary" that can collect the changes.
|
|
46
|
-
* Use `changeTracker.handleChange` to add a reported change to the change summary.
|
|
47
|
-
* The run function is given the last change summary.
|
|
48
|
-
* The change summary is discarded after the run function was called.
|
|
49
|
-
*
|
|
50
|
-
* @see autorun
|
|
51
|
-
*/
|
|
52
|
-
export function autorunHandleChanges<TChangeSummary>(
|
|
53
|
-
options: IDebugNameData & {
|
|
54
|
-
changeTracker: IChangeTracker<TChangeSummary>;
|
|
55
|
-
},
|
|
56
|
-
fn: (reader: IReader, changeSummary: TChangeSummary) => void,
|
|
57
|
-
debugLocation = DebugLocation.ofCaller()
|
|
58
|
-
): IDisposable {
|
|
59
|
-
return new AutorunObserver(
|
|
60
|
-
new DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? fn),
|
|
61
|
-
fn,
|
|
62
|
-
options.changeTracker,
|
|
63
|
-
debugLocation
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @see autorunHandleChanges (but with a disposable store that is cleared before the next run or on dispose)
|
|
69
|
-
*/
|
|
70
|
-
export function autorunWithStoreHandleChanges<TChangeSummary>(
|
|
71
|
-
options: IDebugNameData & {
|
|
72
|
-
changeTracker: IChangeTracker<TChangeSummary>;
|
|
73
|
-
},
|
|
74
|
-
fn: (reader: IReader, changeSummary: TChangeSummary, store: DisposableStore) => void
|
|
75
|
-
): IDisposable {
|
|
76
|
-
const store = new DisposableStore();
|
|
77
|
-
const disposable = autorunHandleChanges(
|
|
78
|
-
{
|
|
79
|
-
owner: options.owner,
|
|
80
|
-
debugName: options.debugName,
|
|
81
|
-
debugReferenceFn: options.debugReferenceFn ?? fn,
|
|
82
|
-
changeTracker: options.changeTracker,
|
|
83
|
-
},
|
|
84
|
-
(reader, changeSummary) => {
|
|
85
|
-
store.clear();
|
|
86
|
-
fn(reader, changeSummary, store);
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
return toDisposable(() => {
|
|
90
|
-
disposable.dispose();
|
|
91
|
-
store.dispose();
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @see autorun (but with a disposable store that is cleared before the next run or on dispose)
|
|
97
|
-
*
|
|
98
|
-
* @deprecated Use `autorun(reader => { reader.store.add(...) })` instead!
|
|
99
|
-
*/
|
|
100
|
-
export function autorunWithStore(fn: (reader: IReader, store: DisposableStore) => void): IDisposable {
|
|
101
|
-
const store = new DisposableStore();
|
|
102
|
-
const disposable = autorunOpts(
|
|
103
|
-
{
|
|
104
|
-
owner: undefined,
|
|
105
|
-
debugName: undefined,
|
|
106
|
-
debugReferenceFn: fn,
|
|
107
|
-
},
|
|
108
|
-
reader => {
|
|
109
|
-
store.clear();
|
|
110
|
-
fn(reader, store);
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
return toDisposable(() => {
|
|
114
|
-
disposable.dispose();
|
|
115
|
-
store.dispose();
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function autorunDelta<T>(
|
|
120
|
-
observable: IObservable<T>,
|
|
121
|
-
handler: (args: { lastValue: T | undefined; newValue: T }) => void
|
|
122
|
-
): IDisposable {
|
|
123
|
-
let _lastValue: T | undefined;
|
|
124
|
-
return autorunOpts({ debugReferenceFn: handler }, (reader) => {
|
|
125
|
-
const newValue = observable.read(reader);
|
|
126
|
-
const lastValue = _lastValue;
|
|
127
|
-
_lastValue = newValue;
|
|
128
|
-
handler({ lastValue, newValue });
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export function autorunIterableDelta<T>(
|
|
133
|
-
getValue: (reader: IReader) => Iterable<T>,
|
|
134
|
-
handler: (args: { addedValues: T[]; removedValues: T[] }) => void,
|
|
135
|
-
getUniqueIdentifier: (value: T) => unknown = v => v
|
|
136
|
-
) {
|
|
137
|
-
const lastValues = new Map<unknown, T>();
|
|
138
|
-
return autorunOpts({ debugReferenceFn: getValue }, (reader) => {
|
|
139
|
-
const newValues = new Map();
|
|
140
|
-
const removedValues = new Map(lastValues);
|
|
141
|
-
for (const value of getValue(reader)) {
|
|
142
|
-
const id = getUniqueIdentifier(value);
|
|
143
|
-
if (lastValues.has(id)) {
|
|
144
|
-
removedValues.delete(id);
|
|
145
|
-
} else {
|
|
146
|
-
newValues.set(id, value);
|
|
147
|
-
lastValues.set(id, value);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
for (const id of removedValues.keys()) {
|
|
151
|
-
lastValues.delete(id);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (newValues.size || removedValues.size) {
|
|
155
|
-
handler({ addedValues: [...newValues.values()], removedValues: [...removedValues.values()] });
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export interface IReaderWithDispose extends IReaderWithStore, IDisposable { }
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* An autorun with a `dispose()` method on its `reader` which cancels the autorun.
|
|
164
|
-
* It it safe to call `dispose()` synchronously.
|
|
165
|
-
*/
|
|
166
|
-
export function autorunSelfDisposable(fn: (reader: IReaderWithDispose) => void, debugLocation = DebugLocation.ofCaller()): IDisposable {
|
|
167
|
-
let ar: IDisposable | undefined;
|
|
168
|
-
let disposed = false;
|
|
169
|
-
|
|
170
|
-
// eslint-disable-next-line prefer-const
|
|
171
|
-
ar = autorun(reader => {
|
|
172
|
-
fn({
|
|
173
|
-
delayedStore: reader.delayedStore,
|
|
174
|
-
store: reader.store,
|
|
175
|
-
readObservable: reader.readObservable.bind(reader),
|
|
176
|
-
dispose: () => {
|
|
177
|
-
ar?.dispose();
|
|
178
|
-
disposed = true;
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}, debugLocation);
|
|
182
|
-
|
|
183
|
-
if (disposed) {
|
|
184
|
-
ar.dispose();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return ar;
|
|
188
|
-
}
|