@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,304 +0,0 @@
|
|
|
1
|
-
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
|
|
2
|
-
|
|
3
|
-
/*---------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
-
*--------------------------------------------------------------------------------------------*/
|
|
7
|
-
|
|
8
|
-
import { arrayInsert } from '../../../base/common/arrays';
|
|
9
|
-
import { toUint32 } from '../../../base/common/uint';
|
|
10
|
-
|
|
11
|
-
export class PrefixSumComputer {
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* values[i] is the value at index i
|
|
15
|
-
*/
|
|
16
|
-
private values: Uint32Array;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* prefixSum[i] = SUM(heights[j]), 0 <= j <= i
|
|
20
|
-
*/
|
|
21
|
-
private prefixSum: Uint32Array;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* prefixSum[i], 0 <= i <= prefixSumValidIndex can be trusted
|
|
25
|
-
*/
|
|
26
|
-
private readonly prefixSumValidIndex: Int32Array;
|
|
27
|
-
|
|
28
|
-
constructor(values: Uint32Array) {
|
|
29
|
-
this.values = values;
|
|
30
|
-
this.prefixSum = new Uint32Array(values.length);
|
|
31
|
-
this.prefixSumValidIndex = new Int32Array(1);
|
|
32
|
-
this.prefixSumValidIndex[0] = -1;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public getCount(): number {
|
|
36
|
-
return this.values.length;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public insertValues(insertIndex: number, insertValues: Uint32Array): boolean {
|
|
40
|
-
insertIndex = toUint32(insertIndex);
|
|
41
|
-
const oldValues = this.values;
|
|
42
|
-
const oldPrefixSum = this.prefixSum;
|
|
43
|
-
const insertValuesLen = insertValues.length;
|
|
44
|
-
|
|
45
|
-
if (insertValuesLen === 0) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
this.values = new Uint32Array(oldValues.length + insertValuesLen);
|
|
50
|
-
this.values.set(oldValues.subarray(0, insertIndex), 0);
|
|
51
|
-
this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);
|
|
52
|
-
this.values.set(insertValues, insertIndex);
|
|
53
|
-
|
|
54
|
-
if (insertIndex - 1 < this.prefixSumValidIndex[0]) {
|
|
55
|
-
this.prefixSumValidIndex[0] = insertIndex - 1;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
this.prefixSum = new Uint32Array(this.values.length);
|
|
59
|
-
if (this.prefixSumValidIndex[0] >= 0) {
|
|
60
|
-
this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
|
|
61
|
-
}
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
public setValue(index: number, value: number): boolean {
|
|
66
|
-
index = toUint32(index);
|
|
67
|
-
value = toUint32(value);
|
|
68
|
-
|
|
69
|
-
if (this.values[index] === value) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
this.values[index] = value;
|
|
73
|
-
if (index - 1 < this.prefixSumValidIndex[0]) {
|
|
74
|
-
this.prefixSumValidIndex[0] = index - 1;
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public removeValues(startIndex: number, count: number): boolean {
|
|
80
|
-
startIndex = toUint32(startIndex);
|
|
81
|
-
count = toUint32(count);
|
|
82
|
-
|
|
83
|
-
const oldValues = this.values;
|
|
84
|
-
const oldPrefixSum = this.prefixSum;
|
|
85
|
-
|
|
86
|
-
if (startIndex >= oldValues.length) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const maxCount = oldValues.length - startIndex;
|
|
91
|
-
if (count >= maxCount) {
|
|
92
|
-
count = maxCount;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (count === 0) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
this.values = new Uint32Array(oldValues.length - count);
|
|
100
|
-
this.values.set(oldValues.subarray(0, startIndex), 0);
|
|
101
|
-
this.values.set(oldValues.subarray(startIndex + count), startIndex);
|
|
102
|
-
|
|
103
|
-
this.prefixSum = new Uint32Array(this.values.length);
|
|
104
|
-
if (startIndex - 1 < this.prefixSumValidIndex[0]) {
|
|
105
|
-
this.prefixSumValidIndex[0] = startIndex - 1;
|
|
106
|
-
}
|
|
107
|
-
if (this.prefixSumValidIndex[0] >= 0) {
|
|
108
|
-
this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
|
|
109
|
-
}
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
public getTotalSum(): number {
|
|
114
|
-
if (this.values.length === 0) {
|
|
115
|
-
return 0;
|
|
116
|
-
}
|
|
117
|
-
return this._getPrefixSum(this.values.length - 1);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Returns the sum of the first `index + 1` many items.
|
|
122
|
-
* @returns `SUM(0 <= j <= index, values[j])`.
|
|
123
|
-
*/
|
|
124
|
-
public getPrefixSum(index: number): number {
|
|
125
|
-
if (index < 0) {
|
|
126
|
-
return 0;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
index = toUint32(index);
|
|
130
|
-
return this._getPrefixSum(index);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
private _getPrefixSum(index: number): number {
|
|
134
|
-
if (index <= this.prefixSumValidIndex[0]) {
|
|
135
|
-
return this.prefixSum[index];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
let startIndex = this.prefixSumValidIndex[0] + 1;
|
|
139
|
-
if (startIndex === 0) {
|
|
140
|
-
this.prefixSum[0] = this.values[0];
|
|
141
|
-
startIndex++;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (index >= this.values.length) {
|
|
145
|
-
index = this.values.length - 1;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
for (let i = startIndex; i <= index; i++) {
|
|
149
|
-
this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];
|
|
150
|
-
}
|
|
151
|
-
this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);
|
|
152
|
-
return this.prefixSum[index];
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
public getIndexOf(sum: number): PrefixSumIndexOfResult {
|
|
156
|
-
sum = Math.floor(sum);
|
|
157
|
-
|
|
158
|
-
// Compute all sums (to get a fully valid prefixSum)
|
|
159
|
-
this.getTotalSum();
|
|
160
|
-
|
|
161
|
-
let low = 0;
|
|
162
|
-
let high = this.values.length - 1;
|
|
163
|
-
let mid = 0;
|
|
164
|
-
let midStop = 0;
|
|
165
|
-
let midStart = 0;
|
|
166
|
-
|
|
167
|
-
while (low <= high) {
|
|
168
|
-
mid = low + ((high - low) / 2) | 0;
|
|
169
|
-
|
|
170
|
-
midStop = this.prefixSum[mid];
|
|
171
|
-
midStart = midStop - this.values[mid];
|
|
172
|
-
|
|
173
|
-
if (sum < midStart) {
|
|
174
|
-
high = mid - 1;
|
|
175
|
-
} else if (sum >= midStop) {
|
|
176
|
-
low = mid + 1;
|
|
177
|
-
} else {
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return new PrefixSumIndexOfResult(mid, sum - midStart);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* {@link getIndexOf} has an amortized runtime complexity of O(1).
|
|
188
|
-
*
|
|
189
|
-
* ({@link PrefixSumComputer.getIndexOf} is just O(log n))
|
|
190
|
-
*/
|
|
191
|
-
export class ConstantTimePrefixSumComputer {
|
|
192
|
-
private _values: number[];
|
|
193
|
-
private _isValid: boolean;
|
|
194
|
-
private _validEndIndex: number;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* _prefixSum[i] = SUM(values[j]), 0 <= j <= i
|
|
198
|
-
*/
|
|
199
|
-
private _prefixSum: number[];
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* _indexBySum[sum] = idx => _prefixSum[idx - 1] <= sum < _prefixSum[idx]
|
|
203
|
-
*/
|
|
204
|
-
private _indexBySum: number[];
|
|
205
|
-
|
|
206
|
-
constructor(values: number[]) {
|
|
207
|
-
this._values = values;
|
|
208
|
-
this._isValid = false;
|
|
209
|
-
this._validEndIndex = -1;
|
|
210
|
-
this._prefixSum = [];
|
|
211
|
-
this._indexBySum = [];
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* @returns SUM(0 <= j < values.length, values[j])
|
|
216
|
-
*/
|
|
217
|
-
public getTotalSum(): number {
|
|
218
|
-
this._ensureValid();
|
|
219
|
-
return this._indexBySum.length;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Returns the sum of the first `count` many items.
|
|
224
|
-
* @returns `SUM(0 <= j < count, values[j])`.
|
|
225
|
-
*/
|
|
226
|
-
public getPrefixSum(count: number): number {
|
|
227
|
-
this._ensureValid();
|
|
228
|
-
if (count === 0) {
|
|
229
|
-
return 0;
|
|
230
|
-
}
|
|
231
|
-
return this._prefixSum[count - 1];
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* @returns `result`, such that `getPrefixSum(result.index) + result.remainder = sum`
|
|
236
|
-
*/
|
|
237
|
-
public getIndexOf(sum: number): PrefixSumIndexOfResult {
|
|
238
|
-
this._ensureValid();
|
|
239
|
-
const idx = this._indexBySum[sum];
|
|
240
|
-
const viewLinesAbove = idx > 0 ? this._prefixSum[idx - 1] : 0;
|
|
241
|
-
return new PrefixSumIndexOfResult(idx, sum - viewLinesAbove);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
public removeValues(start: number, deleteCount: number): void {
|
|
245
|
-
this._values.splice(start, deleteCount);
|
|
246
|
-
this._invalidate(start);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
public insertValues(insertIndex: number, insertArr: number[]): void {
|
|
250
|
-
this._values = arrayInsert(this._values, insertIndex, insertArr);
|
|
251
|
-
this._invalidate(insertIndex);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
private _invalidate(index: number): void {
|
|
255
|
-
this._isValid = false;
|
|
256
|
-
this._validEndIndex = Math.min(this._validEndIndex, index - 1);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
private _ensureValid(): void {
|
|
260
|
-
if (this._isValid) {
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
for (let i = this._validEndIndex + 1, len = this._values.length; i < len; i++) {
|
|
265
|
-
const value = this._values[i];
|
|
266
|
-
const sumAbove = i > 0 ? this._prefixSum[i - 1] : 0;
|
|
267
|
-
|
|
268
|
-
this._prefixSum[i] = sumAbove + value;
|
|
269
|
-
for (let j = 0; j < value; j++) {
|
|
270
|
-
this._indexBySum[sumAbove + j] = i;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// trim things
|
|
275
|
-
this._prefixSum.length = this._values.length;
|
|
276
|
-
this._indexBySum.length = this._prefixSum[this._prefixSum.length - 1];
|
|
277
|
-
|
|
278
|
-
// mark as valid
|
|
279
|
-
this._isValid = true;
|
|
280
|
-
this._validEndIndex = this._values.length - 1;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
public setValue(index: number, value: number): void {
|
|
284
|
-
if (this._values[index] === value) {
|
|
285
|
-
// no change
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
this._values[index] = value;
|
|
289
|
-
this._invalidate(index);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
export class PrefixSumIndexOfResult {
|
|
295
|
-
_prefixSumIndexOfResultBrand: void = undefined;
|
|
296
|
-
|
|
297
|
-
constructor(
|
|
298
|
-
public readonly index: number,
|
|
299
|
-
public readonly remainder: number
|
|
300
|
-
) {
|
|
301
|
-
this.index = index;
|
|
302
|
-
this.remainder = remainder;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
|
|
2
|
-
|
|
3
|
-
/*---------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
-
*--------------------------------------------------------------------------------------------*/
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* This module exists so that the AMD build of the monaco editor can replace this with an async loader plugin.
|
|
10
|
-
* If you add new functions to this module make sure that they are also provided in the AMD build of the monaco editor.
|
|
11
|
-
*
|
|
12
|
-
* TODO@esm remove me once we no longer ship an AMD build.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export function getNLSMessages(): string[] {
|
|
16
|
-
return globalThis._VSCODE_NLS_MESSAGES;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function getNLSLanguage(): string | undefined {
|
|
20
|
-
return globalThis._VSCODE_NLS_LANGUAGE;
|
|
21
|
-
}
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
|
|
2
|
-
|
|
3
|
-
/*---------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
-
*--------------------------------------------------------------------------------------------*/
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line local/code-import-patterns
|
|
9
|
-
import { getNLSLanguage, getNLSMessages } from './nls.messages';
|
|
10
|
-
// eslint-disable-next-line local/code-import-patterns
|
|
11
|
-
export { getNLSLanguage, getNLSMessages } from './nls.messages';
|
|
12
|
-
|
|
13
|
-
declare const document: { location?: { hash?: string } } | undefined;
|
|
14
|
-
const isPseudo = getNLSLanguage() === 'pseudo' || (typeof document !== 'undefined' && document.location && typeof document.location.hash === 'string' && document.location.hash.indexOf('pseudo=true') >= 0);
|
|
15
|
-
|
|
16
|
-
export interface ILocalizeInfo {
|
|
17
|
-
key: string;
|
|
18
|
-
comment: string[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ILocalizedString {
|
|
22
|
-
original: string;
|
|
23
|
-
value: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function _format(message: string, args: (string | number | boolean | undefined | null)[]): string {
|
|
27
|
-
let result: string;
|
|
28
|
-
|
|
29
|
-
if (args.length === 0) {
|
|
30
|
-
result = message;
|
|
31
|
-
} else {
|
|
32
|
-
result = message.replace(/\{(\d+)\}/g, (match, rest) => {
|
|
33
|
-
const index = rest[0];
|
|
34
|
-
const arg = args[index];
|
|
35
|
-
let result = match;
|
|
36
|
-
if (typeof arg === 'string') {
|
|
37
|
-
result = arg;
|
|
38
|
-
} else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {
|
|
39
|
-
result = String(arg);
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (isPseudo) {
|
|
46
|
-
// FF3B and FF3D is the Unicode zenkaku representation for [ and ]
|
|
47
|
-
result = '\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\uFF3D';
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Marks a string to be localized. Returns the localized string.
|
|
55
|
-
*
|
|
56
|
-
* @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.
|
|
57
|
-
* @param message The string to localize
|
|
58
|
-
* @param args The arguments to the string
|
|
59
|
-
*
|
|
60
|
-
* @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
|
|
61
|
-
* @example `localize({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`
|
|
62
|
-
*
|
|
63
|
-
* @returns string The localized string.
|
|
64
|
-
*/
|
|
65
|
-
export function localize(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Marks a string to be localized. Returns the localized string.
|
|
69
|
-
*
|
|
70
|
-
* @param key The key to use for localizing the string
|
|
71
|
-
* @param message The string to localize
|
|
72
|
-
* @param args The arguments to the string
|
|
73
|
-
*
|
|
74
|
-
* @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
|
|
75
|
-
* @example For example, `localize('sayHello', 'hello {0}', name)`
|
|
76
|
-
*
|
|
77
|
-
* @returns string The localized string.
|
|
78
|
-
*/
|
|
79
|
-
export function localize(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @skipMangle
|
|
83
|
-
*/
|
|
84
|
-
export function localize(data: ILocalizeInfo | string /* | number when built */, message: string /* | null when built */, ...args: (string | number | boolean | undefined | null)[]): string {
|
|
85
|
-
if (typeof data === 'number') {
|
|
86
|
-
return _format(lookupMessage(data, message), args);
|
|
87
|
-
}
|
|
88
|
-
return _format(message, args);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Only used when built: Looks up the message in the global NLS table.
|
|
93
|
-
* This table is being made available as a global through bootstrapping
|
|
94
|
-
* depending on the target context.
|
|
95
|
-
*/
|
|
96
|
-
function lookupMessage(index: number, fallback: string | null): string {
|
|
97
|
-
const message = getNLSMessages()?.[index];
|
|
98
|
-
if (typeof message !== 'string') {
|
|
99
|
-
if (typeof fallback === 'string') {
|
|
100
|
-
return fallback;
|
|
101
|
-
}
|
|
102
|
-
throw new Error(`!!! NLS MISSING: ${index} !!!`);
|
|
103
|
-
}
|
|
104
|
-
return message;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Marks a string to be localized. Returns an {@linkcode ILocalizedString}
|
|
109
|
-
* which contains the localized string and the original string.
|
|
110
|
-
*
|
|
111
|
-
* @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.
|
|
112
|
-
* @param message The string to localize
|
|
113
|
-
* @param args The arguments to the string
|
|
114
|
-
*
|
|
115
|
-
* @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
|
|
116
|
-
* @example `localize2({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`
|
|
117
|
-
*
|
|
118
|
-
* @returns ILocalizedString which contains the localized string and the original string.
|
|
119
|
-
*/
|
|
120
|
-
export function localize2(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Marks a string to be localized. Returns an {@linkcode ILocalizedString}
|
|
124
|
-
* which contains the localized string and the original string.
|
|
125
|
-
*
|
|
126
|
-
* @param key The key to use for localizing the string
|
|
127
|
-
* @param message The string to localize
|
|
128
|
-
* @param args The arguments to the string
|
|
129
|
-
*
|
|
130
|
-
* @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
|
|
131
|
-
* @example `localize('sayHello', 'hello {0}', name)`
|
|
132
|
-
*
|
|
133
|
-
* @returns ILocalizedString which contains the localized string and the original string.
|
|
134
|
-
*/
|
|
135
|
-
export function localize2(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @skipMangle
|
|
139
|
-
*/
|
|
140
|
-
export function localize2(data: ILocalizeInfo | string /* | number when built */, originalMessage: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString {
|
|
141
|
-
let message: string;
|
|
142
|
-
if (typeof data === 'number') {
|
|
143
|
-
message = lookupMessage(data, originalMessage);
|
|
144
|
-
} else {
|
|
145
|
-
message = originalMessage;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const value = _format(message, args);
|
|
149
|
-
|
|
150
|
-
return {
|
|
151
|
-
value,
|
|
152
|
-
original: originalMessage === message ? value : _format(originalMessage, args)
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface INLSLanguagePackConfiguration {
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* The path to the translations config file that contains pointers to
|
|
160
|
-
* all message bundles for `main` and extensions.
|
|
161
|
-
*/
|
|
162
|
-
readonly translationsConfigFile: string;
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* The path to the file containing the translations for this language
|
|
166
|
-
* pack as flat string array.
|
|
167
|
-
*/
|
|
168
|
-
readonly messagesFile: string;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* The path to the file that can be used to signal a corrupt language
|
|
172
|
-
* pack, for example when reading the `messagesFile` fails. This will
|
|
173
|
-
* instruct the application to re-create the cache on next startup.
|
|
174
|
-
*/
|
|
175
|
-
readonly corruptMarkerFile: string;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export interface INLSConfiguration {
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Locale as defined in `argv.json` or `app.getLocale()`.
|
|
182
|
-
*/
|
|
183
|
-
readonly userLocale: string;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Locale as defined by the OS (e.g. `app.getPreferredSystemLanguages()`).
|
|
187
|
-
*/
|
|
188
|
-
readonly osLocale: string;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* The actual language of the UI that ends up being used considering `userLocale`
|
|
192
|
-
* and `osLocale`.
|
|
193
|
-
*/
|
|
194
|
-
readonly resolvedLanguage: string;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Defined if a language pack is used that is not the
|
|
198
|
-
* default english language pack. This requires a language
|
|
199
|
-
* pack to be installed as extension.
|
|
200
|
-
*/
|
|
201
|
-
readonly languagePack?: INLSLanguagePackConfiguration;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* The path to the file containing the default english messages
|
|
205
|
-
* as flat string array. The file is only present in built
|
|
206
|
-
* versions of the application.
|
|
207
|
-
*/
|
|
208
|
-
readonly defaultMessagesFile: string;
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Below properties are deprecated and only there to continue support
|
|
212
|
-
* for `vscode-nls` module that depends on them.
|
|
213
|
-
* Refs https://github.com/microsoft/vscode-nls/blob/main/src/node/main.ts#L36-L46
|
|
214
|
-
*/
|
|
215
|
-
/** @deprecated */
|
|
216
|
-
readonly locale: string;
|
|
217
|
-
/** @deprecated */
|
|
218
|
-
readonly availableLanguages: Record<string, string>;
|
|
219
|
-
/** @deprecated */
|
|
220
|
-
readonly _languagePackSupport?: boolean;
|
|
221
|
-
/** @deprecated */
|
|
222
|
-
readonly _languagePackId?: string;
|
|
223
|
-
/** @deprecated */
|
|
224
|
-
readonly _translationsConfigFile?: string;
|
|
225
|
-
/** @deprecated */
|
|
226
|
-
readonly _cacheRoot?: string;
|
|
227
|
-
/** @deprecated */
|
|
228
|
-
readonly _resolvedLanguagePackCoreLocation?: string;
|
|
229
|
-
/** @deprecated */
|
|
230
|
-
readonly _corruptedFile?: string;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export interface ILanguagePack {
|
|
234
|
-
readonly hash: string;
|
|
235
|
-
readonly label: string | undefined;
|
|
236
|
-
readonly extensions: {
|
|
237
|
-
readonly extensionIdentifier: { readonly id: string; readonly uuid?: string };
|
|
238
|
-
readonly version: string;
|
|
239
|
-
}[];
|
|
240
|
-
readonly translations: Record<string, string | undefined>;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export type ILanguagePacks = Record<string, ILanguagePack | undefined>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
|
|
2
|
-
|
|
3
|
-
/*---------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
-
*--------------------------------------------------------------------------------------------*/
|
|
7
|
-
|
|
8
|
-
export class SyncDescriptor<T> {
|
|
9
|
-
|
|
10
|
-
readonly ctor: any;
|
|
11
|
-
readonly staticArguments: any[];
|
|
12
|
-
readonly supportsDelayedInstantiation: boolean;
|
|
13
|
-
|
|
14
|
-
constructor(ctor: new (...args: any[]) => T, staticArguments: any[] = [], supportsDelayedInstantiation: boolean = false) {
|
|
15
|
-
this.ctor = ctor;
|
|
16
|
-
this.staticArguments = staticArguments;
|
|
17
|
-
this.supportsDelayedInstantiation = supportsDelayedInstantiation;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface SyncDescriptor0<T> {
|
|
22
|
-
readonly ctor: new () => T;
|
|
23
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
|
|
2
|
-
|
|
3
|
-
/*---------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
-
*--------------------------------------------------------------------------------------------*/
|
|
7
|
-
|
|
8
|
-
export class Node<T> {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly incoming = new Map<string, Node<T>>();
|
|
12
|
-
readonly outgoing = new Map<string, Node<T>>();
|
|
13
|
-
|
|
14
|
-
constructor(
|
|
15
|
-
readonly key: string,
|
|
16
|
-
readonly data: T
|
|
17
|
-
) { }
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class Graph<T> {
|
|
21
|
-
|
|
22
|
-
private readonly _nodes = new Map<string, Node<T>>();
|
|
23
|
-
|
|
24
|
-
constructor(private readonly _hashFn: (element: T) => string) {
|
|
25
|
-
// empty
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
roots(): Node<T>[] {
|
|
29
|
-
const ret: Node<T>[] = [];
|
|
30
|
-
for (const node of this._nodes.values()) {
|
|
31
|
-
if (node.outgoing.size === 0) {
|
|
32
|
-
ret.push(node);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return ret;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
insertEdge(from: T, to: T): void {
|
|
39
|
-
const fromNode = this.lookupOrInsertNode(from);
|
|
40
|
-
const toNode = this.lookupOrInsertNode(to);
|
|
41
|
-
|
|
42
|
-
fromNode.outgoing.set(toNode.key, toNode);
|
|
43
|
-
toNode.incoming.set(fromNode.key, fromNode);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
removeNode(data: T): void {
|
|
47
|
-
const key = this._hashFn(data);
|
|
48
|
-
this._nodes.delete(key);
|
|
49
|
-
for (const node of this._nodes.values()) {
|
|
50
|
-
node.outgoing.delete(key);
|
|
51
|
-
node.incoming.delete(key);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
lookupOrInsertNode(data: T): Node<T> {
|
|
56
|
-
const key = this._hashFn(data);
|
|
57
|
-
let node = this._nodes.get(key);
|
|
58
|
-
|
|
59
|
-
if (!node) {
|
|
60
|
-
node = new Node(key, data);
|
|
61
|
-
this._nodes.set(key, node);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return node;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
lookup(data: T): Node<T> | undefined {
|
|
68
|
-
return this._nodes.get(this._hashFn(data));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
isEmpty(): boolean {
|
|
72
|
-
return this._nodes.size === 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
toString(): string {
|
|
76
|
-
const data: string[] = [];
|
|
77
|
-
for (const [key, value] of this._nodes) {
|
|
78
|
-
data.push(`${key}\n\t(-> incoming)[${[...value.incoming.keys()].join(', ')}]\n\t(outgoing ->)[${[...value.outgoing.keys()].join(',')}]\n`);
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
return data.join('\n');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* This is brute force and slow and **only** be used
|
|
86
|
-
* to trouble shoot.
|
|
87
|
-
*/
|
|
88
|
-
findCycleSlow() {
|
|
89
|
-
for (const [id, node] of this._nodes) {
|
|
90
|
-
const seen = new Set<string>([id]);
|
|
91
|
-
const res = this._findCycle(node, seen);
|
|
92
|
-
if (res) {
|
|
93
|
-
return res;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
private _findCycle(node: Node<T>, seen: Set<string>): string | undefined {
|
|
100
|
-
for (const [id, outgoing] of node.outgoing) {
|
|
101
|
-
if (seen.has(id)) {
|
|
102
|
-
return [...seen, id].join(' -> ');
|
|
103
|
-
}
|
|
104
|
-
seen.add(id);
|
|
105
|
-
const value = this._findCycle(outgoing, seen);
|
|
106
|
-
if (value) {
|
|
107
|
-
return value;
|
|
108
|
-
}
|
|
109
|
-
seen.delete(id);
|
|
110
|
-
}
|
|
111
|
-
return undefined;
|
|
112
|
-
}
|
|
113
|
-
}
|