@vscode/chat-lib 0.0.1 → 0.0.3
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/inlineEdits/node/nextEditProvider.d.ts +2 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js +70 -28
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts +4 -3
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js +85 -109
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js +14 -6
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js.map +1 -1
- 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/extension/xtab/node/xtabProvider.d.ts +1 -0
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js +44 -42
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js.map +1 -1
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.d.ts.map +1 -1
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js +8 -4
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +8 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +11 -3
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/capiClient.d.ts +1 -1
- package/dist/src/_internal/platform/endpoint/common/capiClient.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/capiClient.js +2 -2
- package/dist/src/_internal/platform/endpoint/common/capiClient.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts +4 -0
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js +7 -0
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/capiClientImpl.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/capiClientImpl.js +1 -1
- package/dist/src/_internal/platform/endpoint/node/capiClientImpl.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js +10 -4
- package/dist/src/_internal/platform/endpoint/node/responsesApi.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/github/common/githubService.d.ts +3 -3
- package/dist/src/_internal/platform/github/common/githubService.d.ts.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts +0 -3
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js +0 -5
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.d.ts +2 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.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/platform/telemetry/common/telemetry.d.ts +1 -0
- package/dist/src/_internal/platform/telemetry/common/telemetry.d.ts.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/telemetry.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/enums.d.ts +6 -0
- package/dist/src/_internal/util/common/test/shims/enums.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/enums.js +8 -1
- package/dist/src/_internal/util/common/test/shims/enums.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 +9 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js.map +1 -1
- package/dist/src/_internal/vscodeTypes.d.ts +5 -0
- package/dist/src/_internal/vscodeTypes.d.ts.map +1 -1
- package/dist/src/_internal/vscodeTypes.js +6 -1
- package/dist/src/_internal/vscodeTypes.js.map +1 -1
- package/dist/src/main.d.ts +15 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +73 -13
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +70 -31
- package/package.json +7 -9
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.d.ts +0 -42
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.d.ts.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.js +0 -125
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.js.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.d.ts +0 -60
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.d.ts.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.js +0 -416
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.js.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.d.ts +0 -30
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.d.ts.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.js +0 -64
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.js.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/visualization.d.ts +0 -26
- package/dist/src/_internal/extension/prompts/node/inline/visualization.d.ts.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/visualization.js +0 -41
- package/dist/src/_internal/extension/prompts/node/inline/visualization.js.map +0 -1
- package/dist/src/_internal/platform/editing/common/abstractText.d.ts +0 -58
- package/dist/src/_internal/platform/editing/common/abstractText.d.ts.map +0 -1
- package/dist/src/_internal/platform/editing/common/abstractText.js +0 -129
- package/dist/src/_internal/platform/editing/common/abstractText.js.map +0 -1
- package/dist/src/_internal/platform/parser/node/nodes.d.ts +0 -93
- package/dist/src/_internal/platform/parser/node/nodes.d.ts.map +0 -1
- package/dist/src/_internal/platform/parser/node/nodes.js +0 -133
- package/dist/src/_internal/platform/parser/node/nodes.js.map +0 -1
- package/dist/src/_internal/platform/telemetry/common/nullTelemetryService.d.ts +0 -18
- package/dist/src/_internal/platform/telemetry/common/nullTelemetryService.d.ts.map +0 -1
- package/dist/src/_internal/platform/telemetry/common/nullTelemetryService.js +0 -50
- package/dist/src/_internal/platform/telemetry/common/nullTelemetryService.js.map +0 -1
- package/dist/src/_internal/util/common/arrays.d.ts +0 -18
- package/dist/src/_internal/util/common/arrays.d.ts.map +0 -1
- package/dist/src/_internal/util/common/arrays.js +0 -80
- package/dist/src/_internal/util/common/arrays.js.map +0 -1
- 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
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export class EditReason {
|
|
8
|
-
public static create(metadata: ITextModelEditReasonMetadata | undefined): EditReason {
|
|
9
|
-
if (!metadata) {
|
|
10
|
-
return EditReason.unknown;
|
|
11
|
-
}
|
|
12
|
-
return new EditReason(metadata);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
private constructor(
|
|
16
|
-
public readonly metadata: ITextModelEditReasonMetadata,
|
|
17
|
-
) {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
public static readonly unknown = new EditReason({ source: 'unknown', name: undefined });
|
|
21
|
-
|
|
22
|
-
toKey(level: number): string {
|
|
23
|
-
return new TextModelEditReason(this.metadata, privateSymbol).toKey(level);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const privateSymbol = Symbol('TextModelEditReason');
|
|
29
|
-
|
|
30
|
-
export class TextModelEditReason {
|
|
31
|
-
constructor(
|
|
32
|
-
public readonly metadata: ITextModelEditReasonMetadata,
|
|
33
|
-
_privateCtorGuard: typeof privateSymbol,
|
|
34
|
-
) { }
|
|
35
|
-
|
|
36
|
-
public toString(): string {
|
|
37
|
-
return `${this.metadata.source}`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public getType(): string {
|
|
41
|
-
const metadata = this.metadata;
|
|
42
|
-
switch (metadata.source) {
|
|
43
|
-
case 'cursor':
|
|
44
|
-
return metadata.kind;
|
|
45
|
-
case 'inlineCompletionAccept':
|
|
46
|
-
return metadata.source + (metadata.$nes ? ':nes' : '');
|
|
47
|
-
case 'unknown':
|
|
48
|
-
return metadata.name || 'unknown';
|
|
49
|
-
default:
|
|
50
|
-
return metadata.source;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Converts the metadata to a key string.
|
|
56
|
-
* Only includes properties/values that have `level` many `$` prefixes or less.
|
|
57
|
-
*/
|
|
58
|
-
public toKey(level: number): string {
|
|
59
|
-
const metadata = this.metadata;
|
|
60
|
-
const keys = Object.entries(metadata).filter(([key, value]) => {
|
|
61
|
-
const prefixCount = (key.match(/\$/g) || []).length;
|
|
62
|
-
return prefixCount <= level && value !== undefined && value !== null && value !== '';
|
|
63
|
-
}).map(([key, value]) => `${key}:${value}`);
|
|
64
|
-
return keys.join('-');
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
type TextModelEditReasonT<T> = TextModelEditReason & {
|
|
69
|
-
metadataT: T;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
function createEditReason<T extends Record<string, any>>(metadata: T): TextModelEditReasonT<T> {
|
|
73
|
-
return new TextModelEditReason(metadata as any, privateSymbol) as any;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export const EditReasons = {
|
|
77
|
-
unknown(data: { name?: string | null }) {
|
|
78
|
-
return createEditReason({
|
|
79
|
-
source: 'unknown',
|
|
80
|
-
name: data.name,
|
|
81
|
-
} as const);
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
chatApplyEdits(data: { modelId: string | undefined }) {
|
|
85
|
-
return createEditReason({
|
|
86
|
-
source: 'Chat.applyEdits',
|
|
87
|
-
$modelId: data.modelId,
|
|
88
|
-
} as const);
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
inlineCompletionAccept(data: { nes: boolean; requestUuid: string; extensionId: string }) {
|
|
92
|
-
return createEditReason({
|
|
93
|
-
source: 'inlineCompletionAccept',
|
|
94
|
-
$nes: data.nes,
|
|
95
|
-
$extensionId: data.extensionId,
|
|
96
|
-
$$requestUuid: data.requestUuid,
|
|
97
|
-
} as const);
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
inlineCompletionPartialAccept(data: { nes: boolean; requestUuid: string; extensionId: string; type: 'word' | 'line' }) {
|
|
101
|
-
return createEditReason({
|
|
102
|
-
source: 'inlineCompletionPartialAccept',
|
|
103
|
-
type: data.type,
|
|
104
|
-
$extensionId: data.extensionId,
|
|
105
|
-
$$requestUuid: data.requestUuid,
|
|
106
|
-
} as const);
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
inlineChatApplyEdit(data: { modelId: string | undefined }) {
|
|
110
|
-
return createEditReason({
|
|
111
|
-
source: 'inlineChat.applyEdits',
|
|
112
|
-
$modelId: data.modelId,
|
|
113
|
-
} as const);
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
reloadFromDisk: () => createEditReason({ source: 'reloadFromDisk' } as const),
|
|
117
|
-
|
|
118
|
-
cursor(data: { kind: 'compositionType' | 'compositionEnd' | 'type' | 'paste' | 'cut' | 'executeCommands' | 'executeCommand'; detailedSource?: string | null }) {
|
|
119
|
-
return createEditReason({
|
|
120
|
-
source: 'cursor',
|
|
121
|
-
kind: data.kind,
|
|
122
|
-
detailedSource: data.detailedSource,
|
|
123
|
-
} as const);
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
setValue: () => createEditReason({ source: 'setValue' } as const),
|
|
127
|
-
eolChange: () => createEditReason({ source: 'eolChange' } as const),
|
|
128
|
-
applyEdits: () => createEditReason({ source: 'applyEdits' } as const),
|
|
129
|
-
snippet: () => createEditReason({ source: 'snippet' } as const),
|
|
130
|
-
suggest: (data: { extensionId: string | undefined }) => createEditReason({ source: 'suggest', $extensionId: data.extensionId } as const),
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
type Values<T> = T[keyof T];
|
|
134
|
-
type ITextModelEditReasonMetadata = Values<{ [TKey in keyof typeof EditReasons]: ReturnType<typeof EditReasons[TKey]>['metadataT'] }>;
|
|
@@ -1,490 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
import { Raw } from '@vscode/prompt-tsx';
|
|
7
|
-
import type { Diagnostic, InlineCompletionContext, Uri } from 'vscode';
|
|
8
|
-
import * as yaml from 'yaml';
|
|
9
|
-
import * as errors from '../../../util/common/errors';
|
|
10
|
-
import { isCancellationError } from '../../../util/vs/base/common/errors';
|
|
11
|
-
import { ThemeIcon } from '../../../util/vs/base/common/themables';
|
|
12
|
-
import { SerializedLineEdit } from '../../../util/vs/editor/common/core/edits/lineEdit';
|
|
13
|
-
import { SerializedEdit } from './dataTypes/editUtils';
|
|
14
|
-
import { FetchCancellationError } from './dataTypes/fetchCancellationError';
|
|
15
|
-
import { LanguageContextResponse, SerializedContextResponse, SerializedDiagnostic, serializeFileDiagnostics, serializeLanguageContext } from './dataTypes/languageContext';
|
|
16
|
-
import { RootedLineEdit } from './dataTypes/rootedLineEdit';
|
|
17
|
-
import { DebugRecorderBookmark } from './debugRecorderBookmark';
|
|
18
|
-
import { ISerializedNextEditRequest, StatelessNextEditRequest } from './statelessNextEditProvider';
|
|
19
|
-
import { stringifyChatMessages } from './utils/stringifyChatMessages';
|
|
20
|
-
import { Icon, now } from './utils/utils';
|
|
21
|
-
import { HistoryContext } from './workspaceEditTracker/historyContextProvider';
|
|
22
|
-
|
|
23
|
-
export class InlineEditRequestLogContext {
|
|
24
|
-
|
|
25
|
-
private static _id = 0;
|
|
26
|
-
|
|
27
|
-
public readonly requestId = InlineEditRequestLogContext._id++;
|
|
28
|
-
|
|
29
|
-
public readonly time = now();
|
|
30
|
-
|
|
31
|
-
/** Tweaks visibility of this log element in the log tree */
|
|
32
|
-
protected _isVisible: boolean = false;
|
|
33
|
-
|
|
34
|
-
get includeInLogTree(): boolean {
|
|
35
|
-
return this._isVisible;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
constructor(
|
|
39
|
-
public readonly filePath: string,
|
|
40
|
-
public readonly version: number,
|
|
41
|
-
private _context: InlineCompletionContext | undefined,
|
|
42
|
-
) { }
|
|
43
|
-
|
|
44
|
-
public recordingBookmark: DebugRecorderBookmark | undefined = undefined;
|
|
45
|
-
|
|
46
|
-
toLogDocument(): string {
|
|
47
|
-
const lines: string[] = [];
|
|
48
|
-
lines.push('# ' + this.getMarkdownTitle() + ` (Request #${this.requestId})`);
|
|
49
|
-
|
|
50
|
-
lines.push('💡 Tip: double-click anywhere to open this file as text to copy-paste content into an issue.\n');
|
|
51
|
-
|
|
52
|
-
lines.push('<details><summary>Explanation for icons</summary>\n');
|
|
53
|
-
lines.push(`- ${Icon.lightbulbFull.svg} - model had suggestions\n`);
|
|
54
|
-
lines.push(`- ${Icon.circleSlash.svg} - model had NO suggestions\n`);
|
|
55
|
-
lines.push(`- ${Icon.database.svg} - response is from cache\n`);
|
|
56
|
-
lines.push(`- ${Icon.error.svg} - error happened\n`);
|
|
57
|
-
lines.push(`- ${Icon.skipped.svg} - fetching started but got cancelled\n`);
|
|
58
|
-
lines.push('</details>\n');
|
|
59
|
-
|
|
60
|
-
lines.push(`Inline Edit Provider: ${this._statelessNextEditProviderId ?? '<NOT-SET>'}\n`);
|
|
61
|
-
|
|
62
|
-
lines.push(`Chat Endpoint`);
|
|
63
|
-
lines.push('```');
|
|
64
|
-
lines.push(`Model name: ${this._endpointInfo?.modelName ?? '<NOT-SET>'}`);
|
|
65
|
-
lines.push(`URL: ${this._endpointInfo?.url ?? '<NOT-SET>'}`);
|
|
66
|
-
lines.push('```');
|
|
67
|
-
|
|
68
|
-
const isCachedStr = this._logContextOfCachedEdit ? `(cached #${this._logContextOfCachedEdit.requestId})` : '(not cached)';
|
|
69
|
-
|
|
70
|
-
if (this._nextEditRequest) {
|
|
71
|
-
lines.push(`## Latest user edits ${isCachedStr}`);
|
|
72
|
-
lines.push("<details open><summary>Edit</summary>\n");
|
|
73
|
-
lines.push(this._nextEditRequest.toMarkdown());
|
|
74
|
-
lines.push("\n</details>\n");
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (this._diagnosticsResultEdit) {
|
|
78
|
-
lines.push(`## Proposed diagnostics edits ${this._nesTypePicked === 'diagnostics' ? '(Picked)' : '(Not Picked)'}`);
|
|
79
|
-
lines.push("<details open><summary>Edit</summary>\n");
|
|
80
|
-
lines.push("``` patch");
|
|
81
|
-
lines.push(this._diagnosticsResultEdit.toString());
|
|
82
|
-
lines.push("```");
|
|
83
|
-
lines.push("\n</details>\n");
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (this._resultEdit) {
|
|
87
|
-
lines.push(`## Proposed next edits ${isCachedStr}`);
|
|
88
|
-
lines.push("<details open><summary>Edit</summary>\n");
|
|
89
|
-
lines.push("``` patch");
|
|
90
|
-
lines.push(this._resultEdit.toString());
|
|
91
|
-
lines.push("```");
|
|
92
|
-
lines.push("\n</details>\n");
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (this.prompt) {
|
|
96
|
-
lines.push(`## Prompt ${isCachedStr}`);
|
|
97
|
-
lines.push("<details><summary>Click to view</summary>\n");
|
|
98
|
-
const e = this.prompt;
|
|
99
|
-
lines.push("````");
|
|
100
|
-
lines.push(...e.split('\n'));
|
|
101
|
-
lines.push("````");
|
|
102
|
-
lines.push("\n</details>\n");
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (this.error) {
|
|
106
|
-
lines.push(`## Error ${isCachedStr}`);
|
|
107
|
-
lines.push("```");
|
|
108
|
-
lines.push(errors.toString(errors.fromUnknown(this.error)));
|
|
109
|
-
lines.push("```");
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (this.response) {
|
|
113
|
-
lines.push(`## Response ${isCachedStr}`);
|
|
114
|
-
lines.push("<details><summary>Click to view</summary>\n");
|
|
115
|
-
lines.push("````");
|
|
116
|
-
lines.push(this.response);
|
|
117
|
-
lines.push("````");
|
|
118
|
-
lines.push("\n</details>\n");
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (this._responseResults) {
|
|
122
|
-
lines.push(`## Response Results ${isCachedStr}`);
|
|
123
|
-
lines.push("<details><summary>Click to view</summary>\n");
|
|
124
|
-
lines.push("```");
|
|
125
|
-
lines.push(yaml.stringify(this._responseResults, null, '\t'));
|
|
126
|
-
lines.push("```");
|
|
127
|
-
lines.push("\n</details>\n");
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (this._isAccepted !== undefined) {
|
|
131
|
-
lines.push(`## Accepted : ${this._isAccepted ? 'Yes' : 'No'}`);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (this._logs.length > 0) {
|
|
135
|
-
lines.push("## Logs");
|
|
136
|
-
lines.push("<details open><summary>Logs</summary>\n");
|
|
137
|
-
lines.push(...this._logs);
|
|
138
|
-
lines.push("\n</details>\n");
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return lines.join('\n');
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
toMinimalLog(): string {
|
|
145
|
-
// Does not include the users files, but just the relevant edits
|
|
146
|
-
const lines: string[] = [];
|
|
147
|
-
|
|
148
|
-
if (this._nesTypePicked === 'diagnostics' && this._diagnosticsResultEdit) {
|
|
149
|
-
lines.push(`## Result (Diagnostics):`);
|
|
150
|
-
lines.push("``` patch");
|
|
151
|
-
lines.push(this._diagnosticsResultEdit.toString());
|
|
152
|
-
lines.push("```");
|
|
153
|
-
} else if (this._nesTypePicked === 'llm' && this._resultEdit) {
|
|
154
|
-
lines.push(`## Result:`);
|
|
155
|
-
lines.push("``` patch");
|
|
156
|
-
lines.push(this._resultEdit.toString());
|
|
157
|
-
lines.push("```");
|
|
158
|
-
} else {
|
|
159
|
-
lines.push(`## Result: <NOT-SET>`);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (this.error) {
|
|
163
|
-
lines.push(`## Error:`);
|
|
164
|
-
lines.push("```");
|
|
165
|
-
lines.push(errors.toString(errors.fromUnknown(this.error)));
|
|
166
|
-
lines.push("```");
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
lines.push(`### Info:`);
|
|
170
|
-
lines.push(`**From cache:** ${this._logContextOfCachedEdit ? `YES (Request: ${this._logContextOfCachedEdit.requestId})` : 'NO'}`);
|
|
171
|
-
if (this._context) {
|
|
172
|
-
lines.push(`**Trigger Kind:** ${this._context.triggerKind === 0 ? 'Manual' : 'Automatic'}`);
|
|
173
|
-
lines.push(`**Request UUID:** ${this._context.requestUuid}`);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return lines.join('\n');
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
private _statelessNextEditProviderId: string | undefined = undefined;
|
|
180
|
-
|
|
181
|
-
setStatelessNextEditProviderId(id: string) {
|
|
182
|
-
this._statelessNextEditProviderId = id;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
private _nextEditRequest: StatelessNextEditRequest | undefined = undefined;
|
|
186
|
-
|
|
187
|
-
setRequestInput(nextEditRequest: StatelessNextEditRequest): void {
|
|
188
|
-
this._isVisible = true;
|
|
189
|
-
this._nextEditRequest = nextEditRequest;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
private _resultEdit: RootedLineEdit | undefined = undefined;
|
|
193
|
-
|
|
194
|
-
setResult(resultEdit: RootedLineEdit) {
|
|
195
|
-
this._isVisible = true;
|
|
196
|
-
this._resultEdit = resultEdit;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
protected _diagnosticsResultEdit: RootedLineEdit | undefined = undefined;
|
|
200
|
-
|
|
201
|
-
setDiagnosticsResult(resultEdit: RootedLineEdit) {
|
|
202
|
-
this._isVisible = true;
|
|
203
|
-
this._diagnosticsResultEdit = resultEdit;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
private _nesTypePicked: 'llm' | 'diagnostics' | undefined;
|
|
207
|
-
|
|
208
|
-
public setPickedNESType(nesTypePicked: 'llm' | 'diagnostics'): this {
|
|
209
|
-
this._nesTypePicked = nesTypePicked;
|
|
210
|
-
return this;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
private _logContextOfCachedEdit: InlineEditRequestLogContext | undefined = undefined;
|
|
214
|
-
|
|
215
|
-
setIsCachedResult(logContextOfCachedEdit: InlineEditRequestLogContext): void {
|
|
216
|
-
|
|
217
|
-
this._logContextOfCachedEdit = logContextOfCachedEdit;
|
|
218
|
-
|
|
219
|
-
{ // inherit stateless provider state from cached log context
|
|
220
|
-
this.recordingBookmark = logContextOfCachedEdit.recordingBookmark;
|
|
221
|
-
|
|
222
|
-
if (logContextOfCachedEdit._nextEditRequest) {
|
|
223
|
-
this._nextEditRequest = logContextOfCachedEdit._nextEditRequest;
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
if (logContextOfCachedEdit._resultEdit) {
|
|
227
|
-
this.setResult(logContextOfCachedEdit._resultEdit);
|
|
228
|
-
}
|
|
229
|
-
if (logContextOfCachedEdit._diagnosticsResultEdit) {
|
|
230
|
-
this.setDiagnosticsResult(logContextOfCachedEdit._diagnosticsResultEdit);
|
|
231
|
-
}
|
|
232
|
-
if (logContextOfCachedEdit._endpointInfo) {
|
|
233
|
-
this.setEndpointInfo(logContextOfCachedEdit._endpointInfo.url, logContextOfCachedEdit._endpointInfo.modelName);
|
|
234
|
-
}
|
|
235
|
-
if (logContextOfCachedEdit.prompt) {
|
|
236
|
-
this.setPrompt(logContextOfCachedEdit.prompt);
|
|
237
|
-
}
|
|
238
|
-
if (logContextOfCachedEdit.response) {
|
|
239
|
-
this.setResponse(logContextOfCachedEdit.response);
|
|
240
|
-
}
|
|
241
|
-
if (logContextOfCachedEdit.responseResults) {
|
|
242
|
-
this.setResponseResults(logContextOfCachedEdit.responseResults);
|
|
243
|
-
}
|
|
244
|
-
if (logContextOfCachedEdit.fullResponsePromise) {
|
|
245
|
-
this.setFullResponse(logContextOfCachedEdit.fullResponsePromise);
|
|
246
|
-
}
|
|
247
|
-
if (logContextOfCachedEdit.error) {
|
|
248
|
-
this.setError(logContextOfCachedEdit.error);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
this._isVisible = true;
|
|
253
|
-
this._icon = Icon.database;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
private _endpointInfo: { url: string; modelName: string } | undefined;
|
|
257
|
-
|
|
258
|
-
public setEndpointInfo(url: string, modelName: string): void {
|
|
259
|
-
this._endpointInfo = { url, modelName };
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
public _prompt: string | undefined = undefined;
|
|
263
|
-
|
|
264
|
-
get prompt(): string | undefined {
|
|
265
|
-
return this._prompt;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
setPrompt(prompt: string | Raw.ChatMessage[]) {
|
|
269
|
-
this._isVisible = true;
|
|
270
|
-
if (typeof prompt === 'string') {
|
|
271
|
-
this._prompt = prompt;
|
|
272
|
-
} else {
|
|
273
|
-
this._prompt = stringifyChatMessages(prompt);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
private _icon: Icon.t | undefined;
|
|
278
|
-
|
|
279
|
-
getIcon(): ThemeIcon | undefined {
|
|
280
|
-
return this._icon?.themeIcon;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
public setIsSkipped() {
|
|
284
|
-
this._isVisible = false;
|
|
285
|
-
this._icon = Icon.skipped;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
public markAsNoSuggestions() {
|
|
289
|
-
this._isVisible = true;
|
|
290
|
-
this._icon = Icon.circleSlash;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
private error: unknown | undefined = undefined;
|
|
294
|
-
setError(e: unknown): void {
|
|
295
|
-
this._isVisible = true;
|
|
296
|
-
this.error = e;
|
|
297
|
-
|
|
298
|
-
if (this.error instanceof FetchCancellationError) {
|
|
299
|
-
this._icon = Icon.skipped;
|
|
300
|
-
} else if (isCancellationError(this.error)) {
|
|
301
|
-
this._isVisible = false;
|
|
302
|
-
} else {
|
|
303
|
-
this._icon = Icon.error;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Model Response
|
|
309
|
-
*/
|
|
310
|
-
private response: string | undefined = undefined;
|
|
311
|
-
setResponse(v: string): void {
|
|
312
|
-
this._isVisible = true;
|
|
313
|
-
this.response = v;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
private fullResponsePromise: Promise<string | undefined> | undefined = undefined;
|
|
317
|
-
private fullResponse: string | undefined = undefined;
|
|
318
|
-
setFullResponse(promise: Promise<string | undefined>): void {
|
|
319
|
-
this.fullResponsePromise = promise;
|
|
320
|
-
promise.then(response => this.fullResponse = response);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
async allPromisesResolved(): Promise<void> {
|
|
324
|
-
await this.fullResponsePromise;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
private providerStartTime: number | undefined = undefined;
|
|
328
|
-
setProviderStartTime(): void {
|
|
329
|
-
this.providerStartTime = Date.now();
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
private providerEndTime: number | undefined = undefined;
|
|
333
|
-
setProviderEndTime(): void {
|
|
334
|
-
this.providerEndTime = Date.now();
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
private fetchStartTime: number | undefined = undefined;
|
|
338
|
-
setFetchStartTime(): void {
|
|
339
|
-
this.fetchStartTime = Date.now();
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
private fetchEndTime: number | undefined = undefined;
|
|
343
|
-
setFetchEndTime(): void {
|
|
344
|
-
this.fetchEndTime = Date.now();
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Each of edit suggestions from model
|
|
349
|
-
*/
|
|
350
|
-
private _responseResults: readonly unknown[] | undefined = undefined;
|
|
351
|
-
|
|
352
|
-
get responseResults(): readonly unknown[] | undefined {
|
|
353
|
-
return this._responseResults;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
setResponseResults(v: readonly unknown[]): void {
|
|
357
|
-
this._isVisible = true;
|
|
358
|
-
this._responseResults = v;
|
|
359
|
-
this._icon = Icon.lightbulbFull;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
getDebugName(): string {
|
|
363
|
-
return `NES | ${basename(this.filePath)} (v${this.version})`;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
getMarkdownTitle(): string {
|
|
367
|
-
const icon: string = this._icon ? `${this._icon.svg} ` : '';
|
|
368
|
-
return (icon) + this.getDebugName();
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
protected _recentEdit: HistoryContext | undefined = undefined;
|
|
372
|
-
|
|
373
|
-
setRecentEdit(edit: HistoryContext): void {
|
|
374
|
-
this._recentEdit = edit;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
private _logs: string[] = [];
|
|
378
|
-
addLog(content: string): void {
|
|
379
|
-
this._logs.push(content.replace('\n', '\\n').replace('\t', '\\t').replace('`', '\`') + '\n');
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
private _isAccepted: boolean | undefined = undefined;
|
|
384
|
-
setAccepted(isAccepted: boolean): void {
|
|
385
|
-
this._isAccepted = isAccepted;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
addListToLog(list: string[]): void {
|
|
389
|
-
list.forEach(l => this.addLog(`- ${l}`));
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
addCodeblockToLog(code: string, language: string = ''): void {
|
|
393
|
-
this._logs.push(`\`\`\`${language}\n${code}\n\`\`\`\n`);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
private _fileDiagnostics: [Uri, Diagnostic[]][] | undefined;
|
|
397
|
-
setFileDiagnostics(fileDiagnostics: [Uri, Diagnostic[]][]): void {
|
|
398
|
-
this._fileDiagnostics = fileDiagnostics;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
private _getDiagnosticsForTrackedFiles(): SerializedDiagnostic[] | undefined {
|
|
402
|
-
if (!this._fileDiagnostics || !this._nextEditRequest?.documents) {
|
|
403
|
-
return undefined;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
const diagnosticsOfTrackedFiles = this._fileDiagnostics.filter(([uri]) =>
|
|
407
|
-
this._nextEditRequest!.documents.some(doc => doc.id.toString() === uri.toString())
|
|
408
|
-
);
|
|
409
|
-
|
|
410
|
-
return serializeFileDiagnostics(diagnosticsOfTrackedFiles);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
private _languageContext: LanguageContextResponse | undefined;
|
|
414
|
-
setLanguageContext(langCtx: LanguageContextResponse): void {
|
|
415
|
-
this._languageContext = langCtx;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Convert the current instance into a JSON format to enable serialization
|
|
420
|
-
* @returns JSON representation of the current state
|
|
421
|
-
*/
|
|
422
|
-
toJSON(): ISerializedInlineEditLogContext {
|
|
423
|
-
return {
|
|
424
|
-
requestId: this.requestId,
|
|
425
|
-
time: this.time,
|
|
426
|
-
filePath: this.filePath,
|
|
427
|
-
version: this.version,
|
|
428
|
-
statelessNextEditProviderId: this._statelessNextEditProviderId,
|
|
429
|
-
nextEditRequest: this._nextEditRequest?.serialize(),
|
|
430
|
-
diagnosticsResultEdit: this._diagnosticsResultEdit?.toString(),
|
|
431
|
-
resultEdit: this._resultEdit?.toString(),
|
|
432
|
-
isCachedResult: !!this._logContextOfCachedEdit,
|
|
433
|
-
prompt: this.prompt,
|
|
434
|
-
error: String(this.error),
|
|
435
|
-
response: this.fullResponse,
|
|
436
|
-
responseResults: yaml.stringify(this._responseResults, null, '\t'),
|
|
437
|
-
providerStartTime: this.providerStartTime,
|
|
438
|
-
providerEndTime: this.providerEndTime,
|
|
439
|
-
fetchStartTime: this.fetchStartTime,
|
|
440
|
-
fetchEndTime: this.fetchEndTime,
|
|
441
|
-
logs: this._logs,
|
|
442
|
-
isAccepted: this._isAccepted,
|
|
443
|
-
languageContext: this._languageContext ? serializeLanguageContext(this._languageContext) : undefined,
|
|
444
|
-
diagnostics: this._getDiagnosticsForTrackedFiles()
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
function basename(path: string): string {
|
|
450
|
-
const slash = Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\'));
|
|
451
|
-
if (slash === -1) { return path; }
|
|
452
|
-
return path.slice(slash + 1);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
export interface INextEditProviderTest {
|
|
456
|
-
// from least recent to most recent
|
|
457
|
-
recentWorkspaceEdits: { path: string; initialText: string; edit: SerializedEdit }[];
|
|
458
|
-
recentWorkspaceEditsActiveDocumentIdx?: number; // by default the last document
|
|
459
|
-
statelessDocuments?: { initialText: string; edit: SerializedLineEdit }[];
|
|
460
|
-
statelessActiveDocumentIdx?: number; // by default the last document
|
|
461
|
-
statelessLLMPrompt?: string;
|
|
462
|
-
statelessLLMResponse?: string;
|
|
463
|
-
statelessNextEdit?: SerializedLineEdit;
|
|
464
|
-
|
|
465
|
-
nextEdit?: SerializedEdit;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
export interface ISerializedInlineEditLogContext {
|
|
469
|
-
requestId: number;
|
|
470
|
-
time: number;
|
|
471
|
-
filePath: string;
|
|
472
|
-
version: number;
|
|
473
|
-
statelessNextEditProviderId: string | undefined;
|
|
474
|
-
nextEditRequest: ISerializedNextEditRequest | undefined;
|
|
475
|
-
diagnosticsResultEdit: string | undefined;
|
|
476
|
-
resultEdit: string | undefined;
|
|
477
|
-
isCachedResult: boolean;
|
|
478
|
-
prompt: string | undefined;
|
|
479
|
-
error: string;
|
|
480
|
-
response: string | undefined;
|
|
481
|
-
responseResults: string;
|
|
482
|
-
providerStartTime: number | undefined;
|
|
483
|
-
providerEndTime: number | undefined;
|
|
484
|
-
fetchStartTime: number | undefined;
|
|
485
|
-
fetchEndTime: number | undefined;
|
|
486
|
-
logs: string[];
|
|
487
|
-
isAccepted: boolean | undefined;
|
|
488
|
-
languageContext: SerializedContextResponse | undefined;
|
|
489
|
-
diagnostics: SerializedDiagnostic[] | undefined;
|
|
490
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
import { Disposable } from '../../../util/vs/base/common/lifecycle';
|
|
7
|
-
import { autorunWithStore, IObservable, ISettableObservable, mapObservableArrayCached, observableFromEvent, observableValue, waitForState } from '../../../util/vs/base/common/observable';
|
|
8
|
-
import { IGitExtensionService } from '../../git/common/gitExtensionService';
|
|
9
|
-
import { API } from '../../git/vscode/git';
|
|
10
|
-
|
|
11
|
-
export class ObservableGit extends Disposable {
|
|
12
|
-
|
|
13
|
-
private readonly _gitApi: IObservable<API | undefined>;
|
|
14
|
-
|
|
15
|
-
public readonly branch: ISettableObservable<string | undefined, void>;
|
|
16
|
-
|
|
17
|
-
constructor(
|
|
18
|
-
@IGitExtensionService private readonly _gitExtensionService: IGitExtensionService,
|
|
19
|
-
) {
|
|
20
|
-
super();
|
|
21
|
-
|
|
22
|
-
this._gitApi = observableFromEvent(this, (listener) => this._gitExtensionService.onDidChange(listener), () => this._gitExtensionService.getExtensionApi());
|
|
23
|
-
|
|
24
|
-
this.branch = observableValue<string | undefined>('branchName', undefined);
|
|
25
|
-
|
|
26
|
-
this.init();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async init() {
|
|
30
|
-
const gitApi = await waitForState(this._gitApi);
|
|
31
|
-
if (this._store.isDisposed) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const repos = observableFromEvent(this, (e) => gitApi.onDidOpenRepository(e), () => gitApi.repositories);
|
|
36
|
-
|
|
37
|
-
await waitForState(repos, (repos) => repos.length > 0, undefined);
|
|
38
|
-
if (this._store.isDisposed) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
mapObservableArrayCached(this, repos, (repo, store) => {
|
|
43
|
-
const stateChangeObservable = observableFromEvent(listener => repo.state.onDidChange(listener), () => repo.state.HEAD?.name);
|
|
44
|
-
store.add(autorunWithStore((reader, _store) => {
|
|
45
|
-
this.branch.set(stateChangeObservable.read(reader), undefined);
|
|
46
|
-
}));
|
|
47
|
-
}, repo => repo.rootUri.toString()).recomputeInitiallyAndOnChange(this._store);
|
|
48
|
-
}
|
|
49
|
-
}
|