@vscode/chat-lib 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/_internal/extension/xtab/common/promptCrafting.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js +6 -5
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +1 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +1 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/env/common/envService.d.ts +5 -0
- package/dist/src/_internal/platform/env/common/envService.d.ts.map +1 -1
- package/dist/src/_internal/platform/env/common/envService.js +2 -1
- package/dist/src/_internal/platform/env/common/envService.js.map +1 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.d.ts +3 -0
- package/dist/src/_internal/platform/env/common/nullEnvService.d.ts.map +1 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.js +8 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.js.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts +7 -0
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js +1 -0
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts +8 -0
- package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.js +19 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js +8 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js.map +1 -1
- package/dist/src/_internal/vscodeTypes.d.ts +4 -0
- package/dist/src/_internal/vscodeTypes.d.ts.map +1 -1
- package/dist/src/_internal/vscodeTypes.js +5 -1
- package/dist/src/_internal/vscodeTypes.js.map +1 -1
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +12 -0
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +46 -19
- package/package.json +3 -6
- package/src/_internal/extension/byok/node/openAIEndpoint.ts +0 -171
- package/src/_internal/extension/common/constants.ts +0 -90
- package/src/_internal/extension/inlineEdits/common/delayer.ts +0 -108
- package/src/_internal/extension/inlineEdits/common/editRebase.ts +0 -268
- package/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx +0 -163
- package/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.ts +0 -225
- package/src/_internal/extension/inlineEdits/common/rejectionCollector.ts +0 -164
- package/src/_internal/extension/inlineEdits/node/debugRecorder.ts +0 -205
- package/src/_internal/extension/inlineEdits/node/importFiltering.ts +0 -25
- package/src/_internal/extension/inlineEdits/node/nesConfigs.ts +0 -12
- package/src/_internal/extension/inlineEdits/node/nextEditCache.ts +0 -278
- package/src/_internal/extension/inlineEdits/node/nextEditProvider.ts +0 -778
- package/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.ts +0 -983
- package/src/_internal/extension/inlineEdits/node/nextEditResult.ts +0 -40
- package/src/_internal/extension/prompt/common/importStatement.ts +0 -25
- package/src/_internal/extension/prompt/node/chatMLFetcher.ts +0 -706
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.ts +0 -146
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.ts +0 -527
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.ts +0 -76
- package/src/_internal/extension/prompts/node/inline/visualization.ts +0 -65
- package/src/_internal/extension/vscode.proposed.activeComment.d.ts +0 -23
- package/src/_internal/extension/vscode.proposed.aiRelatedInformation.d.ts +0 -49
- package/src/_internal/extension/vscode.proposed.aiSettingsSearch.d.ts +0 -31
- package/src/_internal/extension/vscode.proposed.aiTextSearchProvider.d.ts +0 -41
- package/src/_internal/extension/vscode.proposed.authLearnMore.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.chatBinaryReferenceData.d.ts +0 -41
- package/src/_internal/extension/vscode.proposed.chatEditing.d.ts +0 -29
- package/src/_internal/extension/vscode.proposed.chatParticipantAdditions.d.ts +0 -636
- package/src/_internal/extension/vscode.proposed.chatParticipantPrivate.d.ts +0 -276
- package/src/_internal/extension/vscode.proposed.chatProvider.d.ts +0 -62
- package/src/_internal/extension/vscode.proposed.chatReadonlyPromptReference.d.ts +0 -17
- package/src/_internal/extension/vscode.proposed.chatReferenceDiagnostic.d.ts +0 -23
- package/src/_internal/extension/vscode.proposed.chatSessionsProvider.d.ts +0 -218
- package/src/_internal/extension/vscode.proposed.chatStatusItem.d.ts +0 -61
- package/src/_internal/extension/vscode.proposed.codeActionAI.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.commentReveal.d.ts +0 -32
- package/src/_internal/extension/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts +0 -8
- package/src/_internal/extension/vscode.proposed.contribCommentsViewThreadMenus.d.ts +0 -6
- package/src/_internal/extension/vscode.proposed.contribSourceControlInputBoxMenu.d.ts +0 -7
- package/src/_internal/extension/vscode.proposed.dataChannels.d.ts +0 -19
- package/src/_internal/extension/vscode.proposed.defaultChatParticipant.d.ts +0 -52
- package/src/_internal/extension/vscode.proposed.documentFiltersExclusive.d.ts +0 -13
- package/src/_internal/extension/vscode.proposed.embeddings.d.ts +0 -33
- package/src/_internal/extension/vscode.proposed.extensionsAny.d.ts +0 -40
- package/src/_internal/extension/vscode.proposed.findFiles2.d.ts +0 -125
- package/src/_internal/extension/vscode.proposed.findTextInFiles.d.ts +0 -104
- package/src/_internal/extension/vscode.proposed.findTextInFiles2.d.ts +0 -144
- package/src/_internal/extension/vscode.proposed.inlineCompletionsAdditions.d.ts +0 -202
- package/src/_internal/extension/vscode.proposed.interactive.d.ts +0 -11
- package/src/_internal/extension/vscode.proposed.languageModelCapabilities.d.ts +0 -25
- package/src/_internal/extension/vscode.proposed.languageModelDataPart.d.ts +0 -163
- package/src/_internal/extension/vscode.proposed.languageModelSystem.d.ts +0 -17
- package/src/_internal/extension/vscode.proposed.languageModelThinkingPart.d.ts +0 -49
- package/src/_internal/extension/vscode.proposed.languageModelToolResultAudience.d.ts +0 -36
- package/src/_internal/extension/vscode.proposed.mappedEditsProvider.d.ts +0 -110
- package/src/_internal/extension/vscode.proposed.newSymbolNamesProvider.d.ts +0 -47
- package/src/_internal/extension/vscode.proposed.readonlyMessage.d.ts +0 -14
- package/src/_internal/extension/vscode.proposed.resolvers.d.ts +0 -475
- package/src/_internal/extension/vscode.proposed.scmInputBoxValueProvider.d.ts +0 -25
- package/src/_internal/extension/vscode.proposed.taskProblemMatcherStatus.d.ts +0 -42
- package/src/_internal/extension/vscode.proposed.terminalDataWriteEvent.d.ts +0 -32
- package/src/_internal/extension/vscode.proposed.terminalExecuteCommandEvent.d.ts +0 -48
- package/src/_internal/extension/vscode.proposed.terminalQuickFixProvider.d.ts +0 -87
- package/src/_internal/extension/vscode.proposed.terminalSelection.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.testObserver.d.ts +0 -199
- package/src/_internal/extension/vscode.proposed.textDocumentChangeReason.d.ts +0 -30
- package/src/_internal/extension/vscode.proposed.textSearchProvider.d.ts +0 -281
- package/src/_internal/extension/vscode.proposed.textSearchProvider2.d.ts +0 -297
- package/src/_internal/extension/xtab/common/promptCrafting.ts +0 -670
- package/src/_internal/extension/xtab/node/xtabEndpoint.ts +0 -102
- package/src/_internal/extension/xtab/node/xtabProvider.ts +0 -976
- package/src/_internal/extension/xtab/node/xtabUtils.ts +0 -62
- package/src/_internal/platform/authentication/common/authentication.ts +0 -309
- package/src/_internal/platform/authentication/common/copilotToken.ts +0 -300
- package/src/_internal/platform/authentication/common/copilotTokenManager.ts +0 -59
- package/src/_internal/platform/authentication/common/copilotTokenStore.ts +0 -40
- package/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.ts +0 -96
- package/src/_internal/platform/authentication/node/copilotTokenManager.ts +0 -303
- package/src/_internal/platform/chat/common/chatMLFetcher.ts +0 -124
- package/src/_internal/platform/chat/common/chatQuotaService.ts +0 -63
- package/src/_internal/platform/chat/common/chatQuotaServiceImpl.ts +0 -96
- package/src/_internal/platform/chat/common/commonTypes.ts +0 -353
- package/src/_internal/platform/chat/common/conversationOptions.ts +0 -16
- package/src/_internal/platform/chat/common/globalStringUtils.ts +0 -54
- package/src/_internal/platform/chat/common/interactionService.ts +0 -35
- package/src/_internal/platform/configuration/common/configurationService.ts +0 -803
- package/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.ts +0 -39
- package/src/_internal/platform/configuration/common/jsonSchema.ts +0 -139
- package/src/_internal/platform/configuration/common/validator.ts +0 -242
- package/src/_internal/platform/diff/common/diffService.ts +0 -41
- package/src/_internal/platform/diff/common/diffWorker.ts +0 -83
- package/src/_internal/platform/diff/node/diffServiceImpl.ts +0 -85
- package/src/_internal/platform/editing/common/abstractText.ts +0 -177
- package/src/_internal/platform/editing/common/notebookDocumentSnapshot.ts +0 -122
- package/src/_internal/platform/editing/common/positionOffsetTransformer.ts +0 -202
- package/src/_internal/platform/editing/common/textDocumentSnapshot.ts +0 -274
- package/src/_internal/platform/endpoint/common/capiClient.ts +0 -37
- package/src/_internal/platform/endpoint/common/chatModelCapabilities.ts +0 -115
- package/src/_internal/platform/endpoint/common/domainService.ts +0 -27
- package/src/_internal/platform/endpoint/common/endpointProvider.ts +0 -104
- package/src/_internal/platform/endpoint/common/endpointTypes.ts +0 -12
- package/src/_internal/platform/endpoint/common/licenseAgreement.ts +0 -11
- package/src/_internal/platform/endpoint/common/statefulMarkerContainer.tsx +0 -85
- package/src/_internal/platform/endpoint/common/thinkingDataContainer.tsx +0 -44
- package/src/_internal/platform/endpoint/node/capiClientImpl.ts +0 -18
- package/src/_internal/platform/endpoint/node/chatEndpoint.ts +0 -435
- package/src/_internal/platform/endpoint/node/domainServiceImpl.ts +0 -80
- package/src/_internal/platform/endpoint/node/proxyXtabEndpoint.ts +0 -43
- package/src/_internal/platform/endpoint/node/responsesApi.ts +0 -326
- package/src/_internal/platform/env/common/envService.ts +0 -134
- package/src/_internal/platform/env/common/nullEnvService.ts +0 -68
- package/src/_internal/platform/env/common/packagejson.ts +0 -49
- package/src/_internal/platform/git/common/gitExtensionService.ts +0 -21
- package/src/_internal/platform/git/common/nullGitExtensionService.ts +0 -20
- package/src/_internal/platform/git/vscode/git.d.ts +0 -414
- package/src/_internal/platform/github/common/githubAPI.ts +0 -44
- package/src/_internal/platform/github/common/githubService.ts +0 -87
- package/src/_internal/platform/github/common/nullOctokitServiceImpl.ts +0 -21
- package/src/_internal/platform/ignore/common/ignoreService.ts +0 -72
- package/src/_internal/platform/inlineCompletions/common/api.ts +0 -198
- package/src/_internal/platform/inlineEdits/common/dataTypes/diagnosticData.ts +0 -32
- package/src/_internal/platform/inlineEdits/common/dataTypes/documentId.ts +0 -52
- package/src/_internal/platform/inlineEdits/common/dataTypes/edit.ts +0 -165
- package/src/_internal/platform/inlineEdits/common/dataTypes/editUtils.ts +0 -74
- package/src/_internal/platform/inlineEdits/common/dataTypes/fetchCancellationError.ts +0 -14
- package/src/_internal/platform/inlineEdits/common/dataTypes/languageContext.ts +0 -107
- package/src/_internal/platform/inlineEdits/common/dataTypes/languageId.ts +0 -14
- package/src/_internal/platform/inlineEdits/common/dataTypes/permutation.ts +0 -69
- package/src/_internal/platform/inlineEdits/common/dataTypes/rootedLineEdit.ts +0 -49
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLength.ts +0 -74
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/combineTextEditInfos.ts +0 -132
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.ts +0 -184
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/textEditInfo.ts +0 -32
- package/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts +0 -89
- package/src/_internal/platform/inlineEdits/common/debugRecorderBookmark.ts +0 -10
- package/src/_internal/platform/inlineEdits/common/editReason.ts +0 -134
- package/src/_internal/platform/inlineEdits/common/inlineEditLogContext.ts +0 -490
- package/src/_internal/platform/inlineEdits/common/observableGit.ts +0 -49
- package/src/_internal/platform/inlineEdits/common/observableWorkspace.ts +0 -239
- package/src/_internal/platform/inlineEdits/common/responseProcessor.ts +0 -249
- package/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.ts +0 -468
- package/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.ts +0 -59
- package/src/_internal/platform/inlineEdits/common/utils/observable.ts +0 -54
- package/src/_internal/platform/inlineEdits/common/utils/stringifyChatMessages.ts +0 -29
- package/src/_internal/platform/inlineEdits/common/utils/utils.ts +0 -56
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/historyContextProvider.ts +0 -60
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesHistoryContextProvider.ts +0 -353
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesXtabHistoryTracker.ts +0 -176
- package/src/_internal/platform/languageContextProvider/common/languageContextProviderService.ts +0 -25
- package/src/_internal/platform/languageContextProvider/common/nullLanguageContextProviderService.ts +0 -38
- package/src/_internal/platform/languageServer/common/languageContextService.ts +0 -186
- package/src/_internal/platform/languages/common/languageDiagnosticsService.ts +0 -67
- package/src/_internal/platform/languages/common/testLanguageDiagnosticsService.ts +0 -28
- package/src/_internal/platform/log/common/logService.ts +0 -232
- package/src/_internal/platform/nesFetch/common/completionsAPI.ts +0 -78
- package/src/_internal/platform/nesFetch/common/completionsFetchService.ts +0 -118
- package/src/_internal/platform/nesFetch/common/responseStream.ts +0 -151
- package/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.ts +0 -236
- package/src/_internal/platform/nesFetch/node/streamTransformer.ts +0 -95
- package/src/_internal/platform/networking/common/fetch.ts +0 -349
- package/src/_internal/platform/networking/common/fetcherService.ts +0 -84
- package/src/_internal/platform/networking/common/networking.ts +0 -442
- package/src/_internal/platform/networking/common/openai.ts +0 -273
- package/src/_internal/platform/networking/node/chatStream.ts +0 -137
- package/src/_internal/platform/networking/node/stream.ts +0 -749
- package/src/_internal/platform/notebook/common/alternativeContent.ts +0 -89
- package/src/_internal/platform/notebook/common/alternativeContentFormat.ts +0 -10
- package/src/_internal/platform/notebook/common/alternativeContentProvider.json.ts +0 -262
- package/src/_internal/platform/notebook/common/alternativeContentProvider.text.ts +0 -243
- package/src/_internal/platform/notebook/common/alternativeContentProvider.ts +0 -41
- package/src/_internal/platform/notebook/common/alternativeContentProvider.xml.ts +0 -205
- package/src/_internal/platform/notebook/common/alternativeNotebookDocument.ts +0 -155
- package/src/_internal/platform/notebook/common/helpers.ts +0 -212
- package/src/_internal/platform/notebook/common/notebookService.ts +0 -43
- package/src/_internal/platform/openai/node/fetch.ts +0 -596
- package/src/_internal/platform/parser/node/nodes.ts +0 -190
- package/src/_internal/platform/requestLogger/node/nullRequestLogger.ts +0 -26
- package/src/_internal/platform/requestLogger/node/requestLogger.ts +0 -383
- package/src/_internal/platform/simulationTestContext/common/simulationTestContext.ts +0 -29
- package/src/_internal/platform/snippy/common/snippyService.ts +0 -25
- package/src/_internal/platform/telemetry/common/nullExperimentationService.ts +0 -64
- package/src/_internal/platform/telemetry/common/nullTelemetryService.ts +0 -53
- package/src/_internal/platform/telemetry/common/telemetry.ts +0 -215
- package/src/_internal/platform/telemetry/common/telemetryData.ts +0 -205
- package/src/_internal/platform/thinking/common/thinking.ts +0 -61
- package/src/_internal/platform/thinking/common/thinkingUtils.ts +0 -57
- package/src/_internal/platform/tokenizer/node/parseTikTokens.ts +0 -23
- package/src/_internal/platform/tokenizer/node/tikTokenizerImpl.ts +0 -74
- package/src/_internal/platform/tokenizer/node/tikTokenizerWorker.ts +0 -24
- package/src/_internal/platform/tokenizer/node/tokenizer.ts +0 -357
- package/src/_internal/platform/workspace/common/workspaceService.ts +0 -226
- package/src/_internal/platform/workspaceRecorder/common/workspaceLog.ts +0 -118
- package/src/_internal/util/common/anomalyDetection.ts +0 -112
- package/src/_internal/util/common/arrays.ts +0 -81
- package/src/_internal/util/common/async.ts +0 -155
- package/src/_internal/util/common/cache.ts +0 -183
- package/src/_internal/util/common/crypto.ts +0 -41
- package/src/_internal/util/common/errors.ts +0 -22
- package/src/_internal/util/common/globals.d.ts +0 -12
- package/src/_internal/util/common/imageUtils.ts +0 -154
- package/src/_internal/util/common/languages.ts +0 -940
- package/src/_internal/util/common/notebooks.ts +0 -286
- package/src/_internal/util/common/result.ts +0 -71
- package/src/_internal/util/common/services.ts +0 -43
- package/src/_internal/util/common/test/shims/chatTypes.ts +0 -448
- package/src/_internal/util/common/test/shims/editing.ts +0 -233
- package/src/_internal/util/common/test/shims/enums.ts +0 -61
- package/src/_internal/util/common/test/shims/l10n.ts +0 -37
- package/src/_internal/util/common/test/shims/newSymbolName.ts +0 -23
- package/src/_internal/util/common/test/shims/terminal.ts +0 -33
- package/src/_internal/util/common/test/shims/vscodeTypesShim.ts +0 -115
- package/src/_internal/util/common/time.ts +0 -31
- package/src/_internal/util/common/tokenizer.ts +0 -30
- package/src/_internal/util/common/tracing.ts +0 -52
- package/src/_internal/util/common/types.ts +0 -33
- package/src/_internal/util/common/variableLengthQuantity.ts +0 -40
- package/src/_internal/util/node/worker.ts +0 -130
- package/src/_internal/util/vs/base/common/arrays.ts +0 -926
- package/src/_internal/util/vs/base/common/arraysFind.ts +0 -206
- package/src/_internal/util/vs/base/common/assert.ts +0 -89
- package/src/_internal/util/vs/base/common/async.ts +0 -2582
- package/src/_internal/util/vs/base/common/buffer.ts +0 -501
- package/src/_internal/util/vs/base/common/cache.ts +0 -122
- package/src/_internal/util/vs/base/common/cancellation.ts +0 -150
- package/src/_internal/util/vs/base/common/charCode.ts +0 -452
- package/src/_internal/util/vs/base/common/codicons.ts +0 -66
- package/src/_internal/util/vs/base/common/codiconsLibrary.ts +0 -618
- package/src/_internal/util/vs/base/common/codiconsUtil.ts +0 -30
- package/src/_internal/util/vs/base/common/collections.ts +0 -156
- package/src/_internal/util/vs/base/common/diff/diff.ts +0 -1317
- package/src/_internal/util/vs/base/common/diff/diffChange.ts +0 -62
- package/src/_internal/util/vs/base/common/equals.ts +0 -148
- package/src/_internal/util/vs/base/common/errors.ts +0 -342
- package/src/_internal/util/vs/base/common/event.ts +0 -1782
- package/src/_internal/util/vs/base/common/extpath.ts +0 -425
- package/src/_internal/util/vs/base/common/filters.ts +0 -928
- package/src/_internal/util/vs/base/common/functional.ts +0 -34
- package/src/_internal/util/vs/base/common/glob.ts +0 -839
- package/src/_internal/util/vs/base/common/hash.ts +0 -326
- package/src/_internal/util/vs/base/common/htmlContent.ts +0 -212
- package/src/_internal/util/vs/base/common/iconLabels.ts +0 -118
- package/src/_internal/util/vs/base/common/iterator.ts +0 -196
- package/src/_internal/util/vs/base/common/lazy.ts +0 -59
- package/src/_internal/util/vs/base/common/lifecycle.ts +0 -845
- package/src/_internal/util/vs/base/common/linkedList.ts +0 -144
- package/src/_internal/util/vs/base/common/map.ts +0 -954
- package/src/_internal/util/vs/base/common/marshallingIds.ts +0 -35
- package/src/_internal/util/vs/base/common/mime.ts +0 -136
- package/src/_internal/util/vs/base/common/naturalLanguage/korean.ts +0 -425
- package/src/_internal/util/vs/base/common/network.ts +0 -429
- package/src/_internal/util/vs/base/common/numbers.ts +0 -166
- package/src/_internal/util/vs/base/common/objects.ts +0 -242
- package/src/_internal/util/vs/base/common/observable.ts +0 -10
- package/src/_internal/util/vs/base/common/observableInternal/base.ts +0 -208
- package/src/_internal/util/vs/base/common/observableInternal/changeTracker.ts +0 -96
- package/src/_internal/util/vs/base/common/observableInternal/commonFacade/cancellation.ts +0 -9
- package/src/_internal/util/vs/base/common/observableInternal/commonFacade/deps.ts +0 -12
- package/src/_internal/util/vs/base/common/observableInternal/debugLocation.ts +0 -88
- package/src/_internal/util/vs/base/common/observableInternal/debugName.ts +0 -150
- package/src/_internal/util/vs/base/common/observableInternal/experimental/utils.ts +0 -62
- package/src/_internal/util/vs/base/common/observableInternal/index.ts +0 -61
- package/src/_internal/util/vs/base/common/observableInternal/logging/consoleObservableLogger.ts +0 -388
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerApi.d.ts +0 -154
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerRpc.ts +0 -80
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/devToolsLogger.ts +0 -485
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/rpc.ts +0 -103
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/utils.ts +0 -69
- package/src/_internal/util/vs/base/common/observableInternal/logging/logging.ts +0 -133
- package/src/_internal/util/vs/base/common/observableInternal/map.ts +0 -81
- package/src/_internal/util/vs/base/common/observableInternal/observables/baseObservable.ts +0 -172
- package/src/_internal/util/vs/base/common/observableInternal/observables/constObservable.ts +0 -44
- package/src/_internal/util/vs/base/common/observableInternal/observables/derived.ts +0 -190
- package/src/_internal/util/vs/base/common/observableInternal/observables/derivedImpl.ts +0 -445
- package/src/_internal/util/vs/base/common/observableInternal/observables/lazyObservableValue.ts +0 -154
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableFromEvent.ts +0 -174
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignal.ts +0 -67
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignalFromEvent.ts +0 -62
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableValue.ts +0 -131
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableValueOpts.ts +0 -37
- package/src/_internal/util/vs/base/common/observableInternal/reactions/autorun.ts +0 -188
- package/src/_internal/util/vs/base/common/observableInternal/reactions/autorunImpl.ts +0 -256
- package/src/_internal/util/vs/base/common/observableInternal/set.ts +0 -78
- package/src/_internal/util/vs/base/common/observableInternal/transaction.ts +0 -115
- package/src/_internal/util/vs/base/common/observableInternal/utils/promise.ts +0 -129
- package/src/_internal/util/vs/base/common/observableInternal/utils/runOnChange.ts +0 -65
- package/src/_internal/util/vs/base/common/observableInternal/utils/utils.ts +0 -281
- package/src/_internal/util/vs/base/common/observableInternal/utils/utilsCancellation.ts +0 -101
- package/src/_internal/util/vs/base/common/observableInternal/utils/valueWithChangeEvent.ts +0 -31
- package/src/_internal/util/vs/base/common/path.ts +0 -1591
- package/src/_internal/util/vs/base/common/platform.ts +0 -282
- package/src/_internal/util/vs/base/common/process.ts +0 -78
- package/src/_internal/util/vs/base/common/resources.ts +0 -446
- package/src/_internal/util/vs/base/common/sequence.ts +0 -36
- package/src/_internal/util/vs/base/common/sseParser.ts +0 -247
- package/src/_internal/util/vs/base/common/stopwatch.ts +0 -43
- package/src/_internal/util/vs/base/common/stream.ts +0 -792
- package/src/_internal/util/vs/base/common/strings.ts +0 -1364
- package/src/_internal/util/vs/base/common/symbols.ts +0 -11
- package/src/_internal/util/vs/base/common/themables.ts +0 -106
- package/src/_internal/util/vs/base/common/types.ts +0 -345
- package/src/_internal/util/vs/base/common/uint.ts +0 -61
- package/src/_internal/util/vs/base/common/uri.ts +0 -752
- package/src/_internal/util/vs/base/common/uuid.ts +0 -72
- package/src/_internal/util/vs/base-common.d.ts +0 -42
- package/src/_internal/util/vs/editor/common/core/editOperation.ts +0 -62
- package/src/_internal/util/vs/editor/common/core/edits/edit.ts +0 -399
- package/src/_internal/util/vs/editor/common/core/edits/lineEdit.ts +0 -414
- package/src/_internal/util/vs/editor/common/core/edits/stringEdit.ts +0 -568
- package/src/_internal/util/vs/editor/common/core/edits/textEdit.ts +0 -411
- package/src/_internal/util/vs/editor/common/core/position.ts +0 -186
- package/src/_internal/util/vs/editor/common/core/range.ts +0 -519
- package/src/_internal/util/vs/editor/common/core/ranges/lineRange.ts +0 -416
- package/src/_internal/util/vs/editor/common/core/ranges/offsetRange.ts +0 -275
- package/src/_internal/util/vs/editor/common/core/text/abstractText.ts +0 -127
- package/src/_internal/util/vs/editor/common/core/text/positionToOffset.ts +0 -26
- package/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.ts +0 -144
- package/src/_internal/util/vs/editor/common/core/text/textLength.ts +0 -150
- package/src/_internal/util/vs/editor/common/core/wordHelper.ts +0 -177
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts +0 -210
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts +0 -109
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts +0 -178
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts +0 -331
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts +0 -273
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts +0 -475
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts +0 -47
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts +0 -248
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts +0 -76
- package/src/_internal/util/vs/editor/common/diff/legacyLinesDiffComputer.ts +0 -693
- package/src/_internal/util/vs/editor/common/diff/linesDiffComputer.ts +0 -61
- package/src/_internal/util/vs/editor/common/diff/rangeMapping.ts +0 -418
- package/src/_internal/util/vs/editor/common/model/prefixSumComputer.ts +0 -304
- package/src/_internal/util/vs/nls.messages.ts +0 -21
- package/src/_internal/util/vs/nls.ts +0 -243
- package/src/_internal/util/vs/platform/instantiation/common/descriptors.ts +0 -23
- package/src/_internal/util/vs/platform/instantiation/common/graph.ts +0 -113
- package/src/_internal/util/vs/platform/instantiation/common/instantiation.ts +0 -127
- package/src/_internal/util/vs/platform/instantiation/common/instantiationService.ts +0 -483
- package/src/_internal/util/vs/platform/instantiation/common/serviceCollection.ts +0 -34
- package/src/_internal/util/vs/vscode-globals-nls.d.ts +0 -42
- package/src/_internal/util/vs/vscode-globals-product.d.ts +0 -35
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/diagnostic.ts +0 -109
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/es5ClassCompat.ts +0 -34
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/location.ts +0 -51
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/markdownString.ts +0 -83
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/notebooks.ts +0 -296
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/position.ts +0 -195
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/range.ts +0 -167
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/selection.ts +0 -94
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetString.ts +0 -103
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetTextEdit.ts +0 -44
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/symbolInformation.ts +0 -89
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/textEdit.ts +0 -99
- package/src/_internal/vscodeTypes.ts +0 -100
- package/src/main.ts +0 -207
- package/src/package.json +0 -4063
|
@@ -1,69 +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 { illegalArgument } from '../../../../util/vs/base/common/errors';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Represents a re-arrangement of items in an array.
|
|
10
|
-
*/
|
|
11
|
-
export class Permutation {
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The index map describes the index in the original array.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const arr = [20, 10, 30];
|
|
19
|
-
*
|
|
20
|
-
* const arrSortedPermutation = new Permutation([1, 0, 2]);
|
|
21
|
-
* // though consider using `Permutation.createSortPermutation(arr, (a, b) => a - b)` for sorting permutations
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
constructor(private readonly _indexMap: readonly number[]) { }
|
|
25
|
-
|
|
26
|
-
get arrayLength() {
|
|
27
|
-
return this._indexMap.length;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Returns a permutation that sorts the given array according to the given compare function.
|
|
32
|
-
*/
|
|
33
|
-
public static createSortPermutation<T>(arr: readonly T[], compareFn: (a: T, b: T) => number): Permutation {
|
|
34
|
-
const sortIndices = Array.from(arr.keys()).sort((index1, index2) => compareFn(arr[index1], arr[index2]));
|
|
35
|
-
return new Permutation(sortIndices);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Returns a new array with the elements of the given array re-arranged according to this permutation.
|
|
40
|
-
*/
|
|
41
|
-
apply<T>(arr: readonly T[]): T[] {
|
|
42
|
-
if (arr.length !== this.arrayLength) {
|
|
43
|
-
throw illegalArgument(`Permutation must be applied on an array of same length. Received length: ${arr.length}. Expected length: ${this.arrayLength}`);
|
|
44
|
-
}
|
|
45
|
-
return arr.map((_, index) => arr[this._indexMap[index]]);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Given an index after permutation is, returns the index in the original array.
|
|
50
|
-
*/
|
|
51
|
-
mapIndexBack(indexAfterShuffling: number): number {
|
|
52
|
-
const originalArrIdx = this._indexMap.at(indexAfterShuffling);
|
|
53
|
-
if (originalArrIdx === undefined) {
|
|
54
|
-
throw illegalArgument(`Given index must be within original array length. Received: ${indexAfterShuffling}. Expected: 0 <= x < ${this.arrayLength}`);
|
|
55
|
-
}
|
|
56
|
-
return originalArrIdx;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Returns a new permutation that undoes the re-arrangement of this permutation.
|
|
61
|
-
*/
|
|
62
|
-
inverse(): Permutation {
|
|
63
|
-
const inverseIndexMap = this._indexMap.slice();
|
|
64
|
-
for (let i = 0; i < this._indexMap.length; i++) {
|
|
65
|
-
inverseIndexMap[this._indexMap[i]] = i;
|
|
66
|
-
}
|
|
67
|
-
return new Permutation(inverseIndexMap);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -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 { LineEdit, LineReplacement } from '../../../../util/vs/editor/common/core/edits/lineEdit';
|
|
7
|
-
import { BaseStringEdit, StringEdit } from '../../../../util/vs/editor/common/core/edits/stringEdit';
|
|
8
|
-
import { StringText } from '../../../../util/vs/editor/common/core/text/abstractText';
|
|
9
|
-
import { ensureDependenciesAreSet } from '../../../../util/vs/editor/common/core/text/positionToOffset';
|
|
10
|
-
import { RootedEdit } from './edit';
|
|
11
|
-
|
|
12
|
-
ensureDependenciesAreSet();
|
|
13
|
-
|
|
14
|
-
export class RootedLineEdit {
|
|
15
|
-
public static fromEdit<TEdit extends BaseStringEdit>(edit: RootedEdit<TEdit>): RootedLineEdit {
|
|
16
|
-
const lineEdit = LineEdit.fromEdit(edit.edit as BaseStringEdit as StringEdit, edit.base);
|
|
17
|
-
return new RootedLineEdit(edit.base, lineEdit);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
constructor(
|
|
21
|
-
public readonly base: StringText,
|
|
22
|
-
public readonly edit: LineEdit,
|
|
23
|
-
) { }
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
public toString(): string {
|
|
27
|
-
return this.edit.humanReadablePatch(this.base.getLines());
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public toEdit(): StringEdit {
|
|
31
|
-
return this.edit.toEdit(this.base);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public toRootedEdit(): RootedEdit {
|
|
35
|
-
return new RootedEdit(this.base, this.toEdit());
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public getEditedState(): string[] {
|
|
39
|
-
const lines = this.base.getLines();
|
|
40
|
-
const newLines = this.edit.apply(lines);
|
|
41
|
-
return newLines;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public removeCommonSuffixPrefixLines(): RootedLineEdit {
|
|
45
|
-
const isNotEmptyEdit = (edit: LineReplacement) => !edit.lineRange.isEmpty || edit.newLines.length > 0;
|
|
46
|
-
const newEdit = this.edit.replacements.map(e => e.removeCommonSuffixPrefixLines(this.base)).filter(e => isNotEmptyEdit(e));
|
|
47
|
-
return new RootedLineEdit(this.base, new LineEdit(newEdit));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,74 +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 { TextEdit } from '../../../../util/vs/editor/common/core/edits/textEdit';
|
|
7
|
-
import { Range } from '../../../../util/vs/editor/common/core/range';
|
|
8
|
-
import { TextLength } from '../../../../util/vs/editor/common/core/text/textLength';
|
|
9
|
-
import { combineTextEditInfos } from './textEditLengthHelper/combineTextEditInfos';
|
|
10
|
-
import { lengthsToRange, lengthToObj, toLength } from './textEditLengthHelper/length';
|
|
11
|
-
import { TextEditInfo } from './textEditLengthHelper/textEditInfo';
|
|
12
|
-
|
|
13
|
-
export class TextLengthEdit {
|
|
14
|
-
public static readonly empty = new TextLengthEdit([]);
|
|
15
|
-
|
|
16
|
-
public static fromTextEdit(textEdit: TextEdit): TextLengthEdit {
|
|
17
|
-
const edits = textEdit.replacements.map(e => new SingleTextEditLength(e.range, TextLength.ofText(e.text)));
|
|
18
|
-
return new TextLengthEdit(edits);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
private static _fromTextEditInfo(info: TextEditInfo[]): TextLengthEdit {
|
|
22
|
-
const edits = info.map(e => {
|
|
23
|
-
const newLen = lengthToObj(e.newLength);
|
|
24
|
-
return new SingleTextEditLength(
|
|
25
|
-
lengthsToRange(e.startOffset, e.endOffset),
|
|
26
|
-
new TextLength(newLen.lineCount, newLen.columnCount),
|
|
27
|
-
);
|
|
28
|
-
});
|
|
29
|
-
return new TextLengthEdit(edits);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
constructor(
|
|
33
|
-
public readonly edits: readonly SingleTextEditLength[],
|
|
34
|
-
) { }
|
|
35
|
-
|
|
36
|
-
private _toTextEditInfo(): TextEditInfo[] {
|
|
37
|
-
return this.edits.map(e => new TextEditInfo(
|
|
38
|
-
toLength(e.range.startLineNumber - 1, e.range.startColumn - 1),
|
|
39
|
-
toLength(e.range.endLineNumber - 1, e.range.endColumn - 1),
|
|
40
|
-
toLength(e.newLength.lineCount, e.newLength.columnCount),
|
|
41
|
-
));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public compose(other: TextLengthEdit): TextLengthEdit {
|
|
45
|
-
const self = this._toTextEditInfo();
|
|
46
|
-
const o = other._toTextEditInfo();
|
|
47
|
-
|
|
48
|
-
const result = combineTextEditInfos(self, o);
|
|
49
|
-
return TextLengthEdit._fromTextEditInfo(result);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Returns the range of the edit, or undefined if the edit is empty.
|
|
54
|
-
*/
|
|
55
|
-
public getRange(): Range | undefined {
|
|
56
|
-
if (this.edits.length === 0) { return undefined; }
|
|
57
|
-
return Range.fromPositions(this.edits[0].range.getStartPosition(), this.edits.at(-1)!.range.getEndPosition());
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public toString() {
|
|
61
|
-
return `[${this.edits.join(', ')}]`;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export class SingleTextEditLength {
|
|
66
|
-
constructor(
|
|
67
|
-
public readonly range: Range,
|
|
68
|
-
public readonly newLength: TextLength,
|
|
69
|
-
) { }
|
|
70
|
-
|
|
71
|
-
toString() {
|
|
72
|
-
return `{ range: ${this.range}, newLength: ${this.newLength} }`;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,132 +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 { ArrayQueue } from '../../../../../util/vs/base/common/arrays.js';
|
|
7
|
-
import { Length, lengthAdd, lengthDiffNonNegative, lengthEquals, lengthIsZero, lengthToObj, lengthZero, sumLengths } from './length.js';
|
|
8
|
-
import { TextEditInfo } from './textEditInfo.js';
|
|
9
|
-
|
|
10
|
-
export function combineTextEditInfos(textEditInfoFirst: TextEditInfo[], textEditInfoSecond: TextEditInfo[]): TextEditInfo[] {
|
|
11
|
-
if (textEditInfoFirst.length === 0) {
|
|
12
|
-
return textEditInfoSecond;
|
|
13
|
-
}
|
|
14
|
-
if (textEditInfoSecond.length === 0) {
|
|
15
|
-
return textEditInfoFirst;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// s0: State before any edits
|
|
19
|
-
const s0ToS1Map = new ArrayQueue(toLengthMapping(textEditInfoFirst));
|
|
20
|
-
// s1: State after first edit, but before second edit
|
|
21
|
-
const s1ToS2Map = toLengthMapping(textEditInfoSecond) as (LengthMapping | { lengthBefore: undefined; lengthAfter: undefined; modified: false })[];
|
|
22
|
-
s1ToS2Map.push({ modified: false, lengthBefore: undefined, lengthAfter: undefined }); // Copy everything from old to new
|
|
23
|
-
// s2: State after both edits
|
|
24
|
-
|
|
25
|
-
let curItem: LengthMapping | undefined = s0ToS1Map.dequeue();
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @param s1Length Use undefined for length "infinity"
|
|
29
|
-
*/
|
|
30
|
-
function nextS0ToS1MapWithS1LengthOf(s1Length: Length | undefined): LengthMapping[] {
|
|
31
|
-
if (s1Length === undefined) {
|
|
32
|
-
const arr = s0ToS1Map.takeWhile(v => true) || [];
|
|
33
|
-
if (curItem) {
|
|
34
|
-
arr.unshift(curItem);
|
|
35
|
-
}
|
|
36
|
-
return arr;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const result: LengthMapping[] = [];
|
|
40
|
-
while (curItem && !lengthIsZero(s1Length)) {
|
|
41
|
-
const [item, remainingItem] = curItem.splitAt(s1Length);
|
|
42
|
-
result.push(item);
|
|
43
|
-
s1Length = lengthDiffNonNegative(item.lengthAfter, s1Length);
|
|
44
|
-
curItem = remainingItem ?? s0ToS1Map.dequeue();
|
|
45
|
-
}
|
|
46
|
-
if (!lengthIsZero(s1Length)) {
|
|
47
|
-
result.push(new LengthMapping(false, s1Length, s1Length));
|
|
48
|
-
}
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const result: TextEditInfo[] = [];
|
|
53
|
-
|
|
54
|
-
function pushEdit(startOffset: Length, endOffset: Length, newLength: Length): void {
|
|
55
|
-
if (result.length > 0 && lengthEquals(result[result.length - 1].endOffset, startOffset)) {
|
|
56
|
-
const lastResult = result[result.length - 1];
|
|
57
|
-
result[result.length - 1] = new TextEditInfo(lastResult.startOffset, endOffset, lengthAdd(lastResult.newLength, newLength));
|
|
58
|
-
} else {
|
|
59
|
-
result.push({ startOffset, endOffset, newLength });
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let s0offset = lengthZero;
|
|
64
|
-
for (const s1ToS2 of s1ToS2Map) {
|
|
65
|
-
const s0ToS1Map = nextS0ToS1MapWithS1LengthOf(s1ToS2.lengthBefore);
|
|
66
|
-
if (s1ToS2.modified) {
|
|
67
|
-
const s0Length = sumLengths(s0ToS1Map, s => s.lengthBefore);
|
|
68
|
-
const s0EndOffset = lengthAdd(s0offset, s0Length);
|
|
69
|
-
pushEdit(s0offset, s0EndOffset, s1ToS2.lengthAfter);
|
|
70
|
-
s0offset = s0EndOffset;
|
|
71
|
-
} else {
|
|
72
|
-
for (const s1 of s0ToS1Map) {
|
|
73
|
-
const s0startOffset = s0offset;
|
|
74
|
-
s0offset = lengthAdd(s0offset, s1.lengthBefore);
|
|
75
|
-
if (s1.modified) {
|
|
76
|
-
pushEdit(s0startOffset, s0offset, s1.lengthAfter);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return result;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
class LengthMapping {
|
|
86
|
-
constructor(
|
|
87
|
-
/**
|
|
88
|
-
* If false, length before and length after equal.
|
|
89
|
-
*/
|
|
90
|
-
public readonly modified: boolean,
|
|
91
|
-
public readonly lengthBefore: Length,
|
|
92
|
-
public readonly lengthAfter: Length,
|
|
93
|
-
) {
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
splitAt(lengthAfter: Length): [LengthMapping, LengthMapping | undefined] {
|
|
97
|
-
const remainingLengthAfter = lengthDiffNonNegative(lengthAfter, this.lengthAfter);
|
|
98
|
-
if (lengthEquals(remainingLengthAfter, lengthZero)) {
|
|
99
|
-
return [this, undefined];
|
|
100
|
-
} else if (this.modified) {
|
|
101
|
-
return [
|
|
102
|
-
new LengthMapping(this.modified, this.lengthBefore, lengthAfter),
|
|
103
|
-
new LengthMapping(this.modified, lengthZero, remainingLengthAfter)
|
|
104
|
-
];
|
|
105
|
-
} else {
|
|
106
|
-
return [
|
|
107
|
-
new LengthMapping(this.modified, lengthAfter, lengthAfter),
|
|
108
|
-
new LengthMapping(this.modified, remainingLengthAfter, remainingLengthAfter)
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
toString(): string {
|
|
114
|
-
return `${this.modified ? 'M' : 'U'}:${lengthToObj(this.lengthBefore)} -> ${lengthToObj(this.lengthAfter)}`;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function toLengthMapping(textEditInfos: TextEditInfo[]): LengthMapping[] {
|
|
119
|
-
const result: LengthMapping[] = [];
|
|
120
|
-
let lastOffset = lengthZero;
|
|
121
|
-
for (const textEditInfo of textEditInfos) {
|
|
122
|
-
const spaceLength = lengthDiffNonNegative(lastOffset, textEditInfo.startOffset);
|
|
123
|
-
if (!lengthIsZero(spaceLength)) {
|
|
124
|
-
result.push(new LengthMapping(false, spaceLength, spaceLength));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const lengthBefore = lengthDiffNonNegative(textEditInfo.startOffset, textEditInfo.endOffset);
|
|
128
|
-
result.push(new LengthMapping(true, lengthBefore, textEditInfo.newLength));
|
|
129
|
-
lastOffset = textEditInfo.endOffset;
|
|
130
|
-
}
|
|
131
|
-
return result;
|
|
132
|
-
}
|
|
@@ -1,184 +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 { splitLines } from '../../../../../util/vs/base/common/strings';
|
|
7
|
-
import { Position } from '../../../../../util/vs/editor/common/core/position';
|
|
8
|
-
import { Range } from '../../../../../util/vs/editor/common/core/range';
|
|
9
|
-
import { TextLength } from '../../../../../util/vs/editor/common/core/text/textLength';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The end must be greater than or equal to the start.
|
|
13
|
-
*/
|
|
14
|
-
export function lengthDiff(startLineCount: number, startColumnCount: number, endLineCount: number, endColumnCount: number): Length {
|
|
15
|
-
return (startLineCount !== endLineCount)
|
|
16
|
-
? toLength(endLineCount - startLineCount, endColumnCount)
|
|
17
|
-
: toLength(0, endColumnCount - startColumnCount);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Represents a non-negative length in terms of line and column count.
|
|
22
|
-
* Does not allocate.
|
|
23
|
-
*/
|
|
24
|
-
export type Length = { _brand: 'Length' };
|
|
25
|
-
|
|
26
|
-
export const lengthZero = 0 as any as Length;
|
|
27
|
-
|
|
28
|
-
export function lengthIsZero(length: Length): boolean {
|
|
29
|
-
return length as any as number === 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/*
|
|
33
|
-
* We have 52 bits available in a JS number.
|
|
34
|
-
* We use the upper 26 bits to store the line and the lower 26 bits to store the column.
|
|
35
|
-
*/
|
|
36
|
-
///*
|
|
37
|
-
const factor = 2 ** 26;
|
|
38
|
-
/*/
|
|
39
|
-
const factor = 1000000;
|
|
40
|
-
// */
|
|
41
|
-
|
|
42
|
-
export function toLength(lineCount: number, columnCount: number): Length {
|
|
43
|
-
// llllllllllllllllllllllllllcccccccccccccccccccccccccc (52 bits)
|
|
44
|
-
// line count (26 bits) column count (26 bits)
|
|
45
|
-
|
|
46
|
-
// If there is no overflow (all values/sums below 2^26 = 67108864),
|
|
47
|
-
// we have `toLength(lns1, cols1) + toLength(lns2, cols2) = toLength(lns1 + lns2, cols1 + cols2)`.
|
|
48
|
-
|
|
49
|
-
return (lineCount * factor + columnCount) as any as Length;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function lengthToObj(length: Length): TextLength {
|
|
53
|
-
const l = length as any as number;
|
|
54
|
-
const lineCount = Math.floor(l / factor);
|
|
55
|
-
const columnCount = l - lineCount * factor;
|
|
56
|
-
return new TextLength(lineCount, columnCount);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function lengthGetLineCount(length: Length): number {
|
|
60
|
-
return Math.floor(length as any as number / factor);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Returns the amount of columns of the given length, assuming that it does not span any line.
|
|
65
|
-
*/
|
|
66
|
-
export function lengthGetColumnCountIfZeroLineCount(length: Length): number {
|
|
67
|
-
return length as any as number;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// [10 lines, 5 cols] + [ 0 lines, 3 cols] = [10 lines, 8 cols]
|
|
72
|
-
// [10 lines, 5 cols] + [20 lines, 3 cols] = [30 lines, 3 cols]
|
|
73
|
-
export function lengthAdd(length1: Length, length2: Length): Length;
|
|
74
|
-
export function lengthAdd(l1: any, l2: any): Length {
|
|
75
|
-
let r = l1 + l2;
|
|
76
|
-
if (l2 >= factor) { r = r - (l1 % factor); }
|
|
77
|
-
return r;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function sumLengths<T>(items: readonly T[], lengthFn: (item: T) => Length): Length {
|
|
81
|
-
return items.reduce((a, b) => lengthAdd(a, lengthFn(b)), lengthZero);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function lengthEquals(length1: Length, length2: Length): boolean {
|
|
85
|
-
return length1 === length2;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Returns a non negative length `result` such that `lengthAdd(length1, result) = length2`, or zero if such length does not exist.
|
|
90
|
-
*/
|
|
91
|
-
export function lengthDiffNonNegative(length1: Length, length2: Length): Length {
|
|
92
|
-
const l1 = length1 as any as number;
|
|
93
|
-
const l2 = length2 as any as number;
|
|
94
|
-
|
|
95
|
-
const diff = l2 - l1;
|
|
96
|
-
if (diff <= 0) {
|
|
97
|
-
// line-count of length1 is higher than line-count of length2
|
|
98
|
-
// or they are equal and column-count of length1 is higher than column-count of length2
|
|
99
|
-
return lengthZero;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const lineCount1 = Math.floor(l1 / factor);
|
|
103
|
-
const lineCount2 = Math.floor(l2 / factor);
|
|
104
|
-
|
|
105
|
-
const colCount2 = l2 - lineCount2 * factor;
|
|
106
|
-
|
|
107
|
-
if (lineCount1 === lineCount2) {
|
|
108
|
-
const colCount1 = l1 - lineCount1 * factor;
|
|
109
|
-
return toLength(0, colCount2 - colCount1);
|
|
110
|
-
} else {
|
|
111
|
-
return toLength(lineCount2 - lineCount1, colCount2);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export function lengthLessThan(length1: Length, length2: Length): boolean {
|
|
116
|
-
// First, compare line counts, then column counts.
|
|
117
|
-
return (length1 as any as number) < (length2 as any as number);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export function lengthLessThanEqual(length1: Length, length2: Length): boolean {
|
|
121
|
-
return (length1 as any as number) <= (length2 as any as number);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function lengthGreaterThanEqual(length1: Length, length2: Length): boolean {
|
|
125
|
-
return (length1 as any as number) >= (length2 as any as number);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export function lengthToPosition(length: Length): Position {
|
|
129
|
-
const l = length as any as number;
|
|
130
|
-
const lineCount = Math.floor(l / factor);
|
|
131
|
-
const colCount = l - lineCount * factor;
|
|
132
|
-
return new Position(lineCount + 1, colCount + 1);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export function positionToLength(position: Position): Length {
|
|
136
|
-
return toLength(position.lineNumber - 1, position.column - 1);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export function lengthsToRange(lengthStart: Length, lengthEnd: Length): Range {
|
|
140
|
-
const l = lengthStart as any as number;
|
|
141
|
-
const lineCount = Math.floor(l / factor);
|
|
142
|
-
const colCount = l - lineCount * factor;
|
|
143
|
-
|
|
144
|
-
const l2 = lengthEnd as any as number;
|
|
145
|
-
const lineCount2 = Math.floor(l2 / factor);
|
|
146
|
-
const colCount2 = l2 - lineCount2 * factor;
|
|
147
|
-
|
|
148
|
-
return new Range(lineCount + 1, colCount + 1, lineCount2 + 1, colCount2 + 1);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export function lengthOfRange(range: Range): TextLength {
|
|
152
|
-
if (range.startLineNumber === range.endLineNumber) {
|
|
153
|
-
return new TextLength(0, range.endColumn - range.startColumn);
|
|
154
|
-
} else {
|
|
155
|
-
return new TextLength(range.endLineNumber - range.startLineNumber, range.endColumn - 1);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export function lengthCompare(length1: Length, length2: Length): number {
|
|
160
|
-
const l1 = length1 as any as number;
|
|
161
|
-
const l2 = length2 as any as number;
|
|
162
|
-
return l1 - l2;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export function lengthOfString(str: string): Length {
|
|
166
|
-
const lines = splitLines(str);
|
|
167
|
-
return toLength(lines.length - 1, lines[lines.length - 1].length);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export function lengthOfStringObj(str: string): TextLength {
|
|
171
|
-
const lines = splitLines(str);
|
|
172
|
-
return new TextLength(lines.length - 1, lines[lines.length - 1].length);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Computes a numeric hash of the given length.
|
|
177
|
-
*/
|
|
178
|
-
export function lengthHash(length: Length): number {
|
|
179
|
-
return length as any;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export function lengthMax(length1: Length, length2: Length): Length {
|
|
183
|
-
return length1 > length2 ? length1 : length2;
|
|
184
|
-
}
|
package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/textEditInfo.ts
DELETED
|
@@ -1,32 +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 { Length, lengthToObj } from './length';
|
|
7
|
-
|
|
8
|
-
export class TextEditInfo {
|
|
9
|
-
/*public static fromModelContentChanges(changes: IModelContentChange[]): TextEditInfo[] {
|
|
10
|
-
// Must be sorted in ascending order
|
|
11
|
-
const edits = changes.map(c => {
|
|
12
|
-
const range = Range.lift(c.range);
|
|
13
|
-
return new TextEditInfo(
|
|
14
|
-
positionToLength(range.getStartPosition()),
|
|
15
|
-
positionToLength(range.getEndPosition()),
|
|
16
|
-
lengthOfString(c.text)
|
|
17
|
-
);
|
|
18
|
-
}).reverse();
|
|
19
|
-
return edits;
|
|
20
|
-
}*/
|
|
21
|
-
|
|
22
|
-
constructor(
|
|
23
|
-
public readonly startOffset: Length,
|
|
24
|
-
public readonly endOffset: Length,
|
|
25
|
-
public readonly newLength: Length
|
|
26
|
-
) {
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
toString(): string {
|
|
30
|
-
return `[${lengthToObj(this.startOffset)}...${lengthToObj(this.endOffset)}) -> ${lengthToObj(this.newLength)}`;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,89 +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
|
-
export type RecentlyViewedDocumentsOptions = {
|
|
7
|
-
readonly nDocuments: number;
|
|
8
|
-
readonly maxTokens: number;
|
|
9
|
-
readonly includeViewedFiles: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type LanguageContextLanguages = { [languageId: string]: boolean };
|
|
13
|
-
|
|
14
|
-
export type LanguageContextOptions = {
|
|
15
|
-
readonly enabled: boolean;
|
|
16
|
-
readonly maxTokens: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type DiffHistoryOptions = {
|
|
20
|
-
readonly nEntries: number;
|
|
21
|
-
readonly maxTokens: number;
|
|
22
|
-
readonly onlyForDocsInPrompt: boolean;
|
|
23
|
-
readonly useRelativePaths: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type PagedClipping = { pageSize: number };
|
|
27
|
-
|
|
28
|
-
export type CurrentFileOptions = {
|
|
29
|
-
readonly maxTokens: number;
|
|
30
|
-
readonly includeTags: boolean;
|
|
31
|
-
readonly prioritizeAboveCursor: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type PromptOptions = {
|
|
35
|
-
readonly promptingStrategy: PromptingStrategy | undefined /* default */;
|
|
36
|
-
readonly currentFile: CurrentFileOptions;
|
|
37
|
-
readonly pagedClipping: PagedClipping;
|
|
38
|
-
readonly recentlyViewedDocuments: RecentlyViewedDocumentsOptions;
|
|
39
|
-
readonly languageContext: LanguageContextOptions;
|
|
40
|
-
readonly diffHistory: DiffHistoryOptions;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Prompt strategies that tweak prompt in a way that's different from current prod prompting strategy.
|
|
45
|
-
*/
|
|
46
|
-
export enum PromptingStrategy {
|
|
47
|
-
/**
|
|
48
|
-
* Original Xtab unified model prompting strategy.
|
|
49
|
-
*/
|
|
50
|
-
UnifiedModel = 'xtabUnifiedModel',
|
|
51
|
-
Codexv21NesUnified = 'codexv21nesUnified',
|
|
52
|
-
Nes41Miniv3 = 'nes41miniv3',
|
|
53
|
-
SimplifiedSystemPrompt = 'simplifiedSystemPrompt',
|
|
54
|
-
Xtab275 = 'xtab275',
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const DEFAULT_OPTIONS: PromptOptions = {
|
|
58
|
-
promptingStrategy: undefined,
|
|
59
|
-
currentFile: {
|
|
60
|
-
maxTokens: 2000,
|
|
61
|
-
includeTags: true,
|
|
62
|
-
prioritizeAboveCursor: false,
|
|
63
|
-
},
|
|
64
|
-
pagedClipping: {
|
|
65
|
-
pageSize: 10,
|
|
66
|
-
},
|
|
67
|
-
recentlyViewedDocuments: {
|
|
68
|
-
nDocuments: 5,
|
|
69
|
-
maxTokens: 2000,
|
|
70
|
-
includeViewedFiles: false,
|
|
71
|
-
},
|
|
72
|
-
languageContext: {
|
|
73
|
-
enabled: false,
|
|
74
|
-
maxTokens: 2000,
|
|
75
|
-
},
|
|
76
|
-
diffHistory: {
|
|
77
|
-
nEntries: 25,
|
|
78
|
-
maxTokens: 1000,
|
|
79
|
-
onlyForDocsInPrompt: false,
|
|
80
|
-
useRelativePaths: false,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
// TODO: consider a better per language setting/experiment approach
|
|
85
|
-
export const LANGUAGE_CONTEXT_ENABLED_LANGUAGES: LanguageContextLanguages = {
|
|
86
|
-
'prompt': true,
|
|
87
|
-
'instructions': true,
|
|
88
|
-
'chatmode': true,
|
|
89
|
-
};
|
|
@@ -1,10 +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
|
-
export class DebugRecorderBookmark {
|
|
7
|
-
constructor(
|
|
8
|
-
public readonly timeMs: number,
|
|
9
|
-
) { }
|
|
10
|
-
}
|