@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,177 +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 { Lazy } from '../../../util/vs/base/common/lazy';
|
|
7
|
-
import { Position as CorePos } from '../../../util/vs/editor/common/core/position';
|
|
8
|
-
import { OffsetRange } from '../../../util/vs/editor/common/core/ranges/offsetRange';
|
|
9
|
-
import { PositionOffsetTransformer } from '../../../util/vs/editor/common/core/text/positionToOffset';
|
|
10
|
-
import { Range, Position as VSCodePos } from '../../../util/common/test/shims/vscodeTypesShim';
|
|
11
|
-
import { TextDocumentSnapshot } from './textDocumentSnapshot';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Represents an immutable view of a string with line/column characteristics.
|
|
15
|
-
* Offers many methods to work with various data types (ranges, positions, offsets, ...).
|
|
16
|
-
*/
|
|
17
|
-
export abstract class AbstractDocument {
|
|
18
|
-
abstract getText(): string;
|
|
19
|
-
|
|
20
|
-
abstract getTextInOffsetRange(offsetRange: OffsetRange): string;
|
|
21
|
-
|
|
22
|
-
abstract getPositionAtOffset(offset: number): VSCodePos;
|
|
23
|
-
|
|
24
|
-
abstract getOffsetAtPosition(position: VSCodePos): number;
|
|
25
|
-
|
|
26
|
-
abstract getLineText(lineIndex: number): string;
|
|
27
|
-
|
|
28
|
-
abstract getLineLength(lineIndex: number): number;
|
|
29
|
-
|
|
30
|
-
abstract getLineCount(): number;
|
|
31
|
-
|
|
32
|
-
rangeToOffsetRange(range: Range): OffsetRange {
|
|
33
|
-
return new OffsetRange(this.getOffsetAtPosition(range.start), this.getOffsetAtPosition(range.end));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
offsetRangeToRange(offsetRange: OffsetRange): Range {
|
|
37
|
-
return new Range(
|
|
38
|
-
this.getPositionAtOffset(offsetRange.start),
|
|
39
|
-
this.getPositionAtOffset(offsetRange.endExclusive),
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
abstract getPositionOffsetTransformer(): PositionOffsetTransformer;
|
|
44
|
-
|
|
45
|
-
get length() {
|
|
46
|
-
return this.getText().length;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface AbstractDocumentWithLanguageId extends AbstractDocument {
|
|
51
|
-
readonly languageId: string;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export class VsCodeTextDocument extends AbstractDocument implements AbstractDocumentWithLanguageId {
|
|
55
|
-
public readonly uri = this.document.uri;
|
|
56
|
-
|
|
57
|
-
public readonly languageId = this.document.languageId;
|
|
58
|
-
|
|
59
|
-
constructor(public readonly document: TextDocumentSnapshot) {
|
|
60
|
-
super();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
getLineText(lineIndex: number): string {
|
|
64
|
-
return this.document.lineAt(lineIndex).text;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
getLineLength(lineIndex: number): number {
|
|
68
|
-
return this.document.lineAt(lineIndex).text.length;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
getLineCount(): number {
|
|
72
|
-
return this.document.lineCount;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
getText(): string {
|
|
76
|
-
return this.document.getText();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
getTextInOffsetRange(offsetRange: OffsetRange): string {
|
|
80
|
-
return offsetRange.substring(this.document.getText());
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
getPositionAtOffset(offset: number): VSCodePos {
|
|
84
|
-
return this.document.positionAt(offset);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
getOffsetAtPosition(position: VSCodePos): number {
|
|
88
|
-
return this.document.offsetAt(position);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
private readonly _transformer = new Lazy(() => new PositionOffsetTransformer(this.document.getText()));
|
|
92
|
-
|
|
93
|
-
override getPositionOffsetTransformer() {
|
|
94
|
-
return this._transformer.value;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export class StringTextDocument extends AbstractDocument {
|
|
99
|
-
private readonly _transformer = new PositionOffsetTransformer(this.value);
|
|
100
|
-
|
|
101
|
-
constructor(
|
|
102
|
-
public readonly value: string,
|
|
103
|
-
) {
|
|
104
|
-
super();
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
override getText(): string {
|
|
108
|
-
return this.value;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
getLineText(lineIndex: number): string {
|
|
112
|
-
const startOffset = this._transformer.getOffset(new CorePos(lineIndex + 1, 1));
|
|
113
|
-
const endOffset = startOffset + this.getLineLength(lineIndex);
|
|
114
|
-
return this.value.substring(startOffset, endOffset);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
getLineLength(lineIndex: number): number {
|
|
118
|
-
return this._transformer.getLineLength(lineIndex + 1);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
getLineCount(): number {
|
|
122
|
-
return this._transformer.textLength.lineCount + 1;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
override getTextInOffsetRange(offsetRange: OffsetRange): string {
|
|
126
|
-
return offsetRange.substring(this.value);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
override getPositionAtOffset(offset: number): VSCodePos {
|
|
130
|
-
return corePositionToVSCodePosition(this._transformer.getPosition(offset));
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
override getOffsetAtPosition(position: VSCodePos): number {
|
|
134
|
-
position = this._validatePosition(position);
|
|
135
|
-
return this._transformer.getOffset(vsCodePositionToCorePosition(position));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
private _validatePosition(position: VSCodePos): VSCodePos {
|
|
139
|
-
if (position.line < 0) {
|
|
140
|
-
return new VSCodePos(0, 0);
|
|
141
|
-
}
|
|
142
|
-
const lineCount = this._transformer.textLength.lineCount + 1;
|
|
143
|
-
if (position.line >= lineCount) {
|
|
144
|
-
const lineLength = this._transformer.getLineLength(lineCount);
|
|
145
|
-
return new VSCodePos(lineCount - 1, lineLength);
|
|
146
|
-
}
|
|
147
|
-
if (position.character < 0) {
|
|
148
|
-
return new VSCodePos(position.line, 0);
|
|
149
|
-
}
|
|
150
|
-
const lineLength = this._transformer.getLineLength(position.line + 1);
|
|
151
|
-
if (position.character > lineLength) {
|
|
152
|
-
return new VSCodePos(position.line, lineLength);
|
|
153
|
-
}
|
|
154
|
-
return position;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
override getPositionOffsetTransformer() {
|
|
158
|
-
return this._transformer;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export class StringTextDocumentWithLanguageId extends StringTextDocument implements AbstractDocumentWithLanguageId {
|
|
163
|
-
constructor(
|
|
164
|
-
value: string,
|
|
165
|
-
public readonly languageId: string,
|
|
166
|
-
) {
|
|
167
|
-
super(value);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function corePositionToVSCodePosition(position: CorePos): VSCodePos {
|
|
172
|
-
return new VSCodePos(position.lineNumber - 1, position.column - 1);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function vsCodePositionToCorePosition(position: VSCodePos): CorePos {
|
|
176
|
-
return new CorePos(position.line + 1, position.character + 1);
|
|
177
|
-
}
|
|
@@ -1,122 +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 type { NotebookDocument, TextLine, Uri } from 'vscode';
|
|
7
|
-
import { Position, Range, Selection } from '../../../util/common/test/shims/vscodeTypesShim';
|
|
8
|
-
import { AlternativeNotebookDocument } from '../../notebook/common/alternativeNotebookDocument';
|
|
9
|
-
import { isUriComponents, UriComponents } from '../../../util/vs/base/common/uri';
|
|
10
|
-
import { getAlternativeNotebookDocumentProvider } from '../../notebook/common/alternativeContent';
|
|
11
|
-
import { isNumber, isString } from '../../../util/vs/base/common/types';
|
|
12
|
-
import { getDefaultLanguage } from '../../notebook/common/helpers';
|
|
13
|
-
|
|
14
|
-
export interface INotebookDocumentSnapshotJSON {
|
|
15
|
-
readonly type: 'notebook';
|
|
16
|
-
readonly uri: UriComponents;
|
|
17
|
-
readonly _text: string;
|
|
18
|
-
readonly languageId: string;
|
|
19
|
-
readonly version: number;
|
|
20
|
-
readonly alternativeFormat: 'json' | 'xml' | 'text';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function isNotebookDocumentSnapshotJSON(thing: any): thing is INotebookDocumentSnapshotJSON {
|
|
24
|
-
if (!thing || typeof thing !== 'object') {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return thing.type === 'notebook' && isUriComponents(thing.uri) && isString(thing._text) &&
|
|
28
|
-
isString(thing.languageId) && isNumber(thing.version) && isString(thing.alternativeFormat);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class NotebookDocumentSnapshot {
|
|
32
|
-
static create(doc: NotebookDocument, format: 'json' | 'xml' | 'text'): NotebookDocumentSnapshot {
|
|
33
|
-
const uri = doc.uri;
|
|
34
|
-
const version = doc.version;
|
|
35
|
-
return new NotebookDocumentSnapshot(doc, uri, version, format);
|
|
36
|
-
}
|
|
37
|
-
static fromJSON(doc: NotebookDocument, json: INotebookDocumentSnapshotJSON): NotebookDocumentSnapshot {
|
|
38
|
-
// TODO@DonJayamanne
|
|
39
|
-
return NotebookDocumentSnapshot.create(doc, json.alternativeFormat);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
readonly type = 'notebook';
|
|
43
|
-
readonly document: NotebookDocument;
|
|
44
|
-
readonly _text: string;
|
|
45
|
-
readonly uri: Uri;
|
|
46
|
-
readonly version: number;
|
|
47
|
-
readonly languageId: string;
|
|
48
|
-
|
|
49
|
-
private _alternativeDocument: AlternativeNotebookDocument;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
private constructor(doc: NotebookDocument, uri: Uri, version: number, public readonly alternativeFormat: 'json' | 'xml' | 'text') {
|
|
53
|
-
this.document = doc;
|
|
54
|
-
this.uri = uri;
|
|
55
|
-
this.version = version;
|
|
56
|
-
this.languageId = alternativeFormat === 'text' ? getDefaultLanguage(doc) || 'python' : alternativeFormat;
|
|
57
|
-
|
|
58
|
-
this._alternativeDocument = getAlternativeNotebookDocumentProvider(alternativeFormat).getAlternativeDocument(doc);
|
|
59
|
-
this._text = this._alternativeDocument.getText();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
getText(range?: Range): string {
|
|
63
|
-
return this._alternativeDocument.getText(range);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
getSelection() {
|
|
67
|
-
return new Selection(0, 0, this.lineCount, 0);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
getWholeRange(): Range {
|
|
71
|
-
return new Range(0, 0, this.lineCount, 0);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
get lines(): string[] {
|
|
75
|
-
return this._alternativeDocument.lines;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
get lineCount(): number {
|
|
79
|
-
return this._alternativeDocument.lineCount;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
lineAt(line: number): TextLine;
|
|
83
|
-
lineAt(position: Position): TextLine;
|
|
84
|
-
lineAt(lineOrPosition: number | Position): TextLine {
|
|
85
|
-
let line: number | undefined;
|
|
86
|
-
if (lineOrPosition instanceof Position) {
|
|
87
|
-
line = lineOrPosition.line;
|
|
88
|
-
} else if (typeof lineOrPosition === 'number') {
|
|
89
|
-
line = lineOrPosition;
|
|
90
|
-
} else {
|
|
91
|
-
throw new Error(`Invalid argument`);
|
|
92
|
-
}
|
|
93
|
-
if (line < 0 || line >= this.lines.length) {
|
|
94
|
-
throw new Error('Illegal value for `line`');
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return this._alternativeDocument.lineAt(line);
|
|
98
|
-
}
|
|
99
|
-
offsetAt(position: Position): number {
|
|
100
|
-
return this._alternativeDocument.offsetAt(position);
|
|
101
|
-
}
|
|
102
|
-
positionAt(offset: number): Position {
|
|
103
|
-
return this._alternativeDocument.positionAt(offset);
|
|
104
|
-
}
|
|
105
|
-
validateRange(range: Range): Range {
|
|
106
|
-
return this._alternativeDocument.validateRange(range);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
validatePosition(position: Position): Position {
|
|
110
|
-
return this._alternativeDocument.validatePosition(position);
|
|
111
|
-
}
|
|
112
|
-
toJSON(): INotebookDocumentSnapshotJSON {
|
|
113
|
-
return {
|
|
114
|
-
type: 'notebook',
|
|
115
|
-
uri: this.uri.toJSON(),
|
|
116
|
-
languageId: this.languageId,
|
|
117
|
-
version: this.version,
|
|
118
|
-
_text: this._alternativeDocument.getText(),
|
|
119
|
-
alternativeFormat: this.alternativeFormat
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
@@ -1,202 +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 type * as vscode from 'vscode';
|
|
7
|
-
import { splitLines } from '../../../util/vs/base/common/strings';
|
|
8
|
-
import { StringEdit, StringReplacement } from '../../../util/vs/editor/common/core/edits/stringEdit';
|
|
9
|
-
import { OffsetRange } from '../../../util/vs/editor/common/core/ranges/offsetRange';
|
|
10
|
-
import { PrefixSumComputer } from '../../../util/vs/editor/common/model/prefixSumComputer';
|
|
11
|
-
import { Position, Range, TextEdit } from '../../../util/common/test/shims/vscodeTypesShim';
|
|
12
|
-
export class PositionOffsetTransformer {
|
|
13
|
-
private readonly _eol: string;
|
|
14
|
-
private _lines: string[];
|
|
15
|
-
private _lineStarts: PrefixSumComputer;
|
|
16
|
-
|
|
17
|
-
constructor(text: string) {
|
|
18
|
-
this._lines = splitLines(text);
|
|
19
|
-
this._eol = text.charAt(this._lines[0].length) === '\r' ? '\r\n' : '\n';
|
|
20
|
-
const lineStartValues = new Uint32Array(this._lines.length);
|
|
21
|
-
for (let i = 0; i < this._lines.length; i++) {
|
|
22
|
-
lineStartValues[i] = this._lines[i].length + this._eol.length;
|
|
23
|
-
}
|
|
24
|
-
this._lineStarts = new PrefixSumComputer(lineStartValues);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
getText(): string {
|
|
28
|
-
return this._lines.join(this._eol);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
applyOffsetEdits(offsetEdits: StringEdit) {
|
|
32
|
-
const { replacements } = offsetEdits;
|
|
33
|
-
for (let i = replacements.length - 1; i >= 0; i--) {
|
|
34
|
-
const edit = replacements[i];
|
|
35
|
-
const range = this.toRange(edit.replaceRange);
|
|
36
|
-
|
|
37
|
-
this._acceptDeleteRange(range);
|
|
38
|
-
this._acceptInsertText(range.start, edit.newText);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private _acceptDeleteRange(range: vscode.Range): void {
|
|
43
|
-
|
|
44
|
-
if (range.start.line === range.end.line) {
|
|
45
|
-
if (range.start.character === range.end.character) {
|
|
46
|
-
// Nothing to delete
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
// Delete text on the affected line
|
|
50
|
-
this._setLineText(range.start.line,
|
|
51
|
-
this._lines[range.start.line].substring(0, range.start.character)
|
|
52
|
-
+ this._lines[range.start.line].substring(range.end.character)
|
|
53
|
-
);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Take remaining text on last line and append it to remaining text on first line
|
|
58
|
-
this._setLineText(range.start.line,
|
|
59
|
-
this._lines[range.start.line].substring(0, range.start.character)
|
|
60
|
-
+ this._lines[range.end.line].substring(range.end.character)
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
// Delete middle lines
|
|
64
|
-
this._lines.splice(range.start.line + 1, range.end.line - range.start.line);
|
|
65
|
-
this._lineStarts.removeValues(range.start.line + 1, range.end.line - range.start.line);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
private _acceptInsertText(position: vscode.Position, insertText: string): void {
|
|
69
|
-
if (insertText.length === 0) {
|
|
70
|
-
// Nothing to insert
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const insertLines = splitLines(insertText);
|
|
74
|
-
if (insertLines.length === 1) {
|
|
75
|
-
// Inserting text on one line
|
|
76
|
-
this._setLineText(position.line,
|
|
77
|
-
this._lines[position.line].substring(0, position.character)
|
|
78
|
-
+ insertLines[0]
|
|
79
|
-
+ this._lines[position.line].substring(position.character)
|
|
80
|
-
);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Append overflowing text from first line to the end of text to insert
|
|
85
|
-
insertLines[insertLines.length - 1] += this._lines[position.line].substring(position.character);
|
|
86
|
-
|
|
87
|
-
// Delete overflowing text from first line and insert text on first line
|
|
88
|
-
this._setLineText(position.line,
|
|
89
|
-
this._lines[position.line].substring(0, position.character)
|
|
90
|
-
+ insertLines[0]
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
// Insert new lines & store lengths
|
|
94
|
-
const newLengths = new Uint32Array(insertLines.length - 1);
|
|
95
|
-
for (let i = 1; i < insertLines.length; i++) {
|
|
96
|
-
this._lines.splice(position.line + 1 + i - 1, 0, insertLines[i]);
|
|
97
|
-
newLengths[i - 1] = insertLines[i].length + this._eol.length;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
this._lineStarts.insertValues(position.line + 1, newLengths);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* All changes to a line's text go through this method
|
|
105
|
-
*/
|
|
106
|
-
private _setLineText(lineIndex: number, newValue: string): void {
|
|
107
|
-
this._lines[lineIndex] = newValue;
|
|
108
|
-
this._lineStarts.setValue(lineIndex, this._lines[lineIndex].length + this._eol.length);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
getLineCount(): number {
|
|
112
|
-
return this._lines.length;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
getOffset(position: Position): number {
|
|
116
|
-
position = this.validatePosition(position);
|
|
117
|
-
return this._lineStarts.getPrefixSum(position.line - 1) + position.character;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
getPosition(offset: number): Position {
|
|
121
|
-
offset = Math.floor(offset);
|
|
122
|
-
offset = Math.max(0, offset);
|
|
123
|
-
|
|
124
|
-
const out = this._lineStarts.getIndexOf(offset);
|
|
125
|
-
|
|
126
|
-
const lineLength = this._lines[out.index].length;
|
|
127
|
-
|
|
128
|
-
// Ensure we return a valid position
|
|
129
|
-
return new Position(out.index, Math.min(out.remainder, lineLength));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
toRange(offsetRange: OffsetRange): Range {
|
|
133
|
-
return new Range(this.getPosition(offsetRange.start), this.getPosition(offsetRange.endExclusive));
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
toOffsetRange(range: Range): OffsetRange {
|
|
137
|
-
return new OffsetRange(
|
|
138
|
-
this.getOffset(range.start),
|
|
139
|
-
this.getOffset(range.end)
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
toOffsetEdit(edits: readonly TextEdit[]): StringEdit {
|
|
144
|
-
const validEdits = edits.map(edit => new TextEdit(this.validateRange(edit.range), edit.newText));
|
|
145
|
-
return new StringEdit(validEdits.map(edit => {
|
|
146
|
-
return new StringReplacement(this.toOffsetRange(edit.range), edit.newText);
|
|
147
|
-
}));
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
toTextEdits(edit: StringEdit): TextEdit[] {
|
|
151
|
-
return edit.replacements.map(edit => {
|
|
152
|
-
return new TextEdit(this.toRange(edit.replaceRange), edit.newText);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
public validatePosition(position: vscode.Position): vscode.Position {
|
|
157
|
-
if (!(position instanceof Position)) {
|
|
158
|
-
throw new Error('Invalid argument');
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (this._lines.length === 0) {
|
|
162
|
-
return position.with(0, 0);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
let { line, character } = position;
|
|
166
|
-
let hasChanged = false;
|
|
167
|
-
|
|
168
|
-
if (line < 0) {
|
|
169
|
-
line = 0;
|
|
170
|
-
character = 0;
|
|
171
|
-
hasChanged = true;
|
|
172
|
-
}
|
|
173
|
-
else if (line >= this._lines.length) {
|
|
174
|
-
line = this._lines.length - 1;
|
|
175
|
-
character = this._lines[line].length;
|
|
176
|
-
hasChanged = true;
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
const maxCharacter = this._lines[line].length;
|
|
180
|
-
if (character < 0) {
|
|
181
|
-
character = 0;
|
|
182
|
-
hasChanged = true;
|
|
183
|
-
}
|
|
184
|
-
else if (character > maxCharacter) {
|
|
185
|
-
character = maxCharacter;
|
|
186
|
-
hasChanged = true;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (!hasChanged) {
|
|
191
|
-
return position;
|
|
192
|
-
}
|
|
193
|
-
return new Position(line, character);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
validateRange(range: Range): Range {
|
|
197
|
-
return new Range(
|
|
198
|
-
this.validatePosition(range.start),
|
|
199
|
-
this.validatePosition(range.end)
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
}
|