@vscode/chat-lib 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts +2 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js +70 -28
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts +4 -3
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js +85 -109
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js +14 -6
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js.map +1 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js +6 -5
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts +1 -0
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js +44 -42
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js.map +1 -1
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.d.ts.map +1 -1
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js +8 -4
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +8 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +11 -3
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/capiClient.d.ts +1 -1
- package/dist/src/_internal/platform/endpoint/common/capiClient.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/capiClient.js +2 -2
- package/dist/src/_internal/platform/endpoint/common/capiClient.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts +4 -0
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js +7 -0
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/capiClientImpl.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/capiClientImpl.js +1 -1
- package/dist/src/_internal/platform/endpoint/node/capiClientImpl.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js +10 -4
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js.map +1 -1
- package/dist/src/_internal/platform/env/common/envService.d.ts +5 -0
- package/dist/src/_internal/platform/env/common/envService.d.ts.map +1 -1
- package/dist/src/_internal/platform/env/common/envService.js +2 -1
- package/dist/src/_internal/platform/env/common/envService.js.map +1 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.d.ts +3 -0
- package/dist/src/_internal/platform/env/common/nullEnvService.d.ts.map +1 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.js +8 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.js.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.d.ts +3 -3
- package/dist/src/_internal/platform/github/common/githubService.d.ts.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts +0 -3
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js +0 -5
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.d.ts +2 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.js.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts +7 -0
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js +1 -0
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/telemetry.d.ts +1 -0
- package/dist/src/_internal/platform/telemetry/common/telemetry.d.ts.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/telemetry.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts +8 -0
- package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.js +19 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/enums.d.ts +6 -0
- package/dist/src/_internal/util/common/test/shims/enums.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/enums.js +8 -1
- package/dist/src/_internal/util/common/test/shims/enums.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js +9 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js.map +1 -1
- package/dist/src/_internal/vscodeTypes.d.ts +5 -0
- package/dist/src/_internal/vscodeTypes.d.ts.map +1 -1
- package/dist/src/_internal/vscodeTypes.js +6 -1
- package/dist/src/_internal/vscodeTypes.js.map +1 -1
- package/dist/src/main.d.ts +15 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +73 -13
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +70 -31
- package/package.json +7 -9
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.d.ts +0 -42
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.d.ts.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.js +0 -125
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.js.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.d.ts +0 -60
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.d.ts.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.js +0 -416
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.js.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.d.ts +0 -30
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.d.ts.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.js +0 -64
- package/dist/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.js.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/visualization.d.ts +0 -26
- package/dist/src/_internal/extension/prompts/node/inline/visualization.d.ts.map +0 -1
- package/dist/src/_internal/extension/prompts/node/inline/visualization.js +0 -41
- package/dist/src/_internal/extension/prompts/node/inline/visualization.js.map +0 -1
- package/dist/src/_internal/platform/editing/common/abstractText.d.ts +0 -58
- package/dist/src/_internal/platform/editing/common/abstractText.d.ts.map +0 -1
- package/dist/src/_internal/platform/editing/common/abstractText.js +0 -129
- package/dist/src/_internal/platform/editing/common/abstractText.js.map +0 -1
- package/dist/src/_internal/platform/parser/node/nodes.d.ts +0 -93
- package/dist/src/_internal/platform/parser/node/nodes.d.ts.map +0 -1
- package/dist/src/_internal/platform/parser/node/nodes.js +0 -133
- package/dist/src/_internal/platform/parser/node/nodes.js.map +0 -1
- package/dist/src/_internal/platform/telemetry/common/nullTelemetryService.d.ts +0 -18
- package/dist/src/_internal/platform/telemetry/common/nullTelemetryService.d.ts.map +0 -1
- package/dist/src/_internal/platform/telemetry/common/nullTelemetryService.js +0 -50
- package/dist/src/_internal/platform/telemetry/common/nullTelemetryService.js.map +0 -1
- package/dist/src/_internal/util/common/arrays.d.ts +0 -18
- package/dist/src/_internal/util/common/arrays.d.ts.map +0 -1
- package/dist/src/_internal/util/common/arrays.js +0 -80
- package/dist/src/_internal/util/common/arrays.js.map +0 -1
- package/src/_internal/extension/byok/node/openAIEndpoint.ts +0 -171
- package/src/_internal/extension/common/constants.ts +0 -90
- package/src/_internal/extension/inlineEdits/common/delayer.ts +0 -108
- package/src/_internal/extension/inlineEdits/common/editRebase.ts +0 -268
- package/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx +0 -163
- package/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.ts +0 -225
- package/src/_internal/extension/inlineEdits/common/rejectionCollector.ts +0 -164
- package/src/_internal/extension/inlineEdits/node/debugRecorder.ts +0 -205
- package/src/_internal/extension/inlineEdits/node/importFiltering.ts +0 -25
- package/src/_internal/extension/inlineEdits/node/nesConfigs.ts +0 -12
- package/src/_internal/extension/inlineEdits/node/nextEditCache.ts +0 -278
- package/src/_internal/extension/inlineEdits/node/nextEditProvider.ts +0 -778
- package/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.ts +0 -983
- package/src/_internal/extension/inlineEdits/node/nextEditResult.ts +0 -40
- package/src/_internal/extension/prompt/common/importStatement.ts +0 -25
- package/src/_internal/extension/prompt/node/chatMLFetcher.ts +0 -706
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.ts +0 -146
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.ts +0 -527
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.ts +0 -76
- package/src/_internal/extension/prompts/node/inline/visualization.ts +0 -65
- package/src/_internal/extension/vscode.proposed.activeComment.d.ts +0 -23
- package/src/_internal/extension/vscode.proposed.aiRelatedInformation.d.ts +0 -49
- package/src/_internal/extension/vscode.proposed.aiSettingsSearch.d.ts +0 -31
- package/src/_internal/extension/vscode.proposed.aiTextSearchProvider.d.ts +0 -41
- package/src/_internal/extension/vscode.proposed.authLearnMore.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.chatBinaryReferenceData.d.ts +0 -41
- package/src/_internal/extension/vscode.proposed.chatEditing.d.ts +0 -29
- package/src/_internal/extension/vscode.proposed.chatParticipantAdditions.d.ts +0 -636
- package/src/_internal/extension/vscode.proposed.chatParticipantPrivate.d.ts +0 -276
- package/src/_internal/extension/vscode.proposed.chatProvider.d.ts +0 -62
- package/src/_internal/extension/vscode.proposed.chatReadonlyPromptReference.d.ts +0 -17
- package/src/_internal/extension/vscode.proposed.chatReferenceDiagnostic.d.ts +0 -23
- package/src/_internal/extension/vscode.proposed.chatSessionsProvider.d.ts +0 -218
- package/src/_internal/extension/vscode.proposed.chatStatusItem.d.ts +0 -61
- package/src/_internal/extension/vscode.proposed.codeActionAI.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.commentReveal.d.ts +0 -32
- package/src/_internal/extension/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts +0 -8
- package/src/_internal/extension/vscode.proposed.contribCommentsViewThreadMenus.d.ts +0 -6
- package/src/_internal/extension/vscode.proposed.contribSourceControlInputBoxMenu.d.ts +0 -7
- package/src/_internal/extension/vscode.proposed.dataChannels.d.ts +0 -19
- package/src/_internal/extension/vscode.proposed.defaultChatParticipant.d.ts +0 -52
- package/src/_internal/extension/vscode.proposed.documentFiltersExclusive.d.ts +0 -13
- package/src/_internal/extension/vscode.proposed.embeddings.d.ts +0 -33
- package/src/_internal/extension/vscode.proposed.extensionsAny.d.ts +0 -40
- package/src/_internal/extension/vscode.proposed.findFiles2.d.ts +0 -125
- package/src/_internal/extension/vscode.proposed.findTextInFiles.d.ts +0 -104
- package/src/_internal/extension/vscode.proposed.findTextInFiles2.d.ts +0 -144
- package/src/_internal/extension/vscode.proposed.inlineCompletionsAdditions.d.ts +0 -202
- package/src/_internal/extension/vscode.proposed.interactive.d.ts +0 -11
- package/src/_internal/extension/vscode.proposed.languageModelCapabilities.d.ts +0 -25
- package/src/_internal/extension/vscode.proposed.languageModelDataPart.d.ts +0 -163
- package/src/_internal/extension/vscode.proposed.languageModelSystem.d.ts +0 -17
- package/src/_internal/extension/vscode.proposed.languageModelThinkingPart.d.ts +0 -49
- package/src/_internal/extension/vscode.proposed.languageModelToolResultAudience.d.ts +0 -36
- package/src/_internal/extension/vscode.proposed.mappedEditsProvider.d.ts +0 -110
- package/src/_internal/extension/vscode.proposed.newSymbolNamesProvider.d.ts +0 -47
- package/src/_internal/extension/vscode.proposed.readonlyMessage.d.ts +0 -14
- package/src/_internal/extension/vscode.proposed.resolvers.d.ts +0 -475
- package/src/_internal/extension/vscode.proposed.scmInputBoxValueProvider.d.ts +0 -25
- package/src/_internal/extension/vscode.proposed.taskProblemMatcherStatus.d.ts +0 -42
- package/src/_internal/extension/vscode.proposed.terminalDataWriteEvent.d.ts +0 -32
- package/src/_internal/extension/vscode.proposed.terminalExecuteCommandEvent.d.ts +0 -48
- package/src/_internal/extension/vscode.proposed.terminalQuickFixProvider.d.ts +0 -87
- package/src/_internal/extension/vscode.proposed.terminalSelection.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.testObserver.d.ts +0 -199
- package/src/_internal/extension/vscode.proposed.textDocumentChangeReason.d.ts +0 -30
- package/src/_internal/extension/vscode.proposed.textSearchProvider.d.ts +0 -281
- package/src/_internal/extension/vscode.proposed.textSearchProvider2.d.ts +0 -297
- package/src/_internal/extension/xtab/common/promptCrafting.ts +0 -670
- package/src/_internal/extension/xtab/node/xtabEndpoint.ts +0 -102
- package/src/_internal/extension/xtab/node/xtabProvider.ts +0 -976
- package/src/_internal/extension/xtab/node/xtabUtils.ts +0 -62
- package/src/_internal/platform/authentication/common/authentication.ts +0 -309
- package/src/_internal/platform/authentication/common/copilotToken.ts +0 -300
- package/src/_internal/platform/authentication/common/copilotTokenManager.ts +0 -59
- package/src/_internal/platform/authentication/common/copilotTokenStore.ts +0 -40
- package/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.ts +0 -96
- package/src/_internal/platform/authentication/node/copilotTokenManager.ts +0 -303
- package/src/_internal/platform/chat/common/chatMLFetcher.ts +0 -124
- package/src/_internal/platform/chat/common/chatQuotaService.ts +0 -63
- package/src/_internal/platform/chat/common/chatQuotaServiceImpl.ts +0 -96
- package/src/_internal/platform/chat/common/commonTypes.ts +0 -353
- package/src/_internal/platform/chat/common/conversationOptions.ts +0 -16
- package/src/_internal/platform/chat/common/globalStringUtils.ts +0 -54
- package/src/_internal/platform/chat/common/interactionService.ts +0 -35
- package/src/_internal/platform/configuration/common/configurationService.ts +0 -803
- package/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.ts +0 -39
- package/src/_internal/platform/configuration/common/jsonSchema.ts +0 -139
- package/src/_internal/platform/configuration/common/validator.ts +0 -242
- package/src/_internal/platform/diff/common/diffService.ts +0 -41
- package/src/_internal/platform/diff/common/diffWorker.ts +0 -83
- package/src/_internal/platform/diff/node/diffServiceImpl.ts +0 -85
- package/src/_internal/platform/editing/common/abstractText.ts +0 -177
- package/src/_internal/platform/editing/common/notebookDocumentSnapshot.ts +0 -122
- package/src/_internal/platform/editing/common/positionOffsetTransformer.ts +0 -202
- package/src/_internal/platform/editing/common/textDocumentSnapshot.ts +0 -274
- package/src/_internal/platform/endpoint/common/capiClient.ts +0 -37
- package/src/_internal/platform/endpoint/common/chatModelCapabilities.ts +0 -115
- package/src/_internal/platform/endpoint/common/domainService.ts +0 -27
- package/src/_internal/platform/endpoint/common/endpointProvider.ts +0 -104
- package/src/_internal/platform/endpoint/common/endpointTypes.ts +0 -12
- package/src/_internal/platform/endpoint/common/licenseAgreement.ts +0 -11
- package/src/_internal/platform/endpoint/common/statefulMarkerContainer.tsx +0 -85
- package/src/_internal/platform/endpoint/common/thinkingDataContainer.tsx +0 -44
- package/src/_internal/platform/endpoint/node/capiClientImpl.ts +0 -18
- package/src/_internal/platform/endpoint/node/chatEndpoint.ts +0 -435
- package/src/_internal/platform/endpoint/node/domainServiceImpl.ts +0 -80
- package/src/_internal/platform/endpoint/node/proxyXtabEndpoint.ts +0 -43
- package/src/_internal/platform/endpoint/node/responsesApi.ts +0 -326
- package/src/_internal/platform/env/common/envService.ts +0 -134
- package/src/_internal/platform/env/common/nullEnvService.ts +0 -68
- package/src/_internal/platform/env/common/packagejson.ts +0 -49
- package/src/_internal/platform/git/common/gitExtensionService.ts +0 -21
- package/src/_internal/platform/git/common/nullGitExtensionService.ts +0 -20
- package/src/_internal/platform/git/vscode/git.d.ts +0 -414
- package/src/_internal/platform/github/common/githubAPI.ts +0 -44
- package/src/_internal/platform/github/common/githubService.ts +0 -87
- package/src/_internal/platform/github/common/nullOctokitServiceImpl.ts +0 -21
- package/src/_internal/platform/ignore/common/ignoreService.ts +0 -72
- package/src/_internal/platform/inlineCompletions/common/api.ts +0 -198
- package/src/_internal/platform/inlineEdits/common/dataTypes/diagnosticData.ts +0 -32
- package/src/_internal/platform/inlineEdits/common/dataTypes/documentId.ts +0 -52
- package/src/_internal/platform/inlineEdits/common/dataTypes/edit.ts +0 -165
- package/src/_internal/platform/inlineEdits/common/dataTypes/editUtils.ts +0 -74
- package/src/_internal/platform/inlineEdits/common/dataTypes/fetchCancellationError.ts +0 -14
- package/src/_internal/platform/inlineEdits/common/dataTypes/languageContext.ts +0 -107
- package/src/_internal/platform/inlineEdits/common/dataTypes/languageId.ts +0 -14
- package/src/_internal/platform/inlineEdits/common/dataTypes/permutation.ts +0 -69
- package/src/_internal/platform/inlineEdits/common/dataTypes/rootedLineEdit.ts +0 -49
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLength.ts +0 -74
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/combineTextEditInfos.ts +0 -132
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.ts +0 -184
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/textEditInfo.ts +0 -32
- package/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts +0 -89
- package/src/_internal/platform/inlineEdits/common/debugRecorderBookmark.ts +0 -10
- package/src/_internal/platform/inlineEdits/common/editReason.ts +0 -134
- package/src/_internal/platform/inlineEdits/common/inlineEditLogContext.ts +0 -490
- package/src/_internal/platform/inlineEdits/common/observableGit.ts +0 -49
- package/src/_internal/platform/inlineEdits/common/observableWorkspace.ts +0 -239
- package/src/_internal/platform/inlineEdits/common/responseProcessor.ts +0 -249
- package/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.ts +0 -468
- package/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.ts +0 -59
- package/src/_internal/platform/inlineEdits/common/utils/observable.ts +0 -54
- package/src/_internal/platform/inlineEdits/common/utils/stringifyChatMessages.ts +0 -29
- package/src/_internal/platform/inlineEdits/common/utils/utils.ts +0 -56
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/historyContextProvider.ts +0 -60
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesHistoryContextProvider.ts +0 -353
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesXtabHistoryTracker.ts +0 -176
- package/src/_internal/platform/languageContextProvider/common/languageContextProviderService.ts +0 -25
- package/src/_internal/platform/languageContextProvider/common/nullLanguageContextProviderService.ts +0 -38
- package/src/_internal/platform/languageServer/common/languageContextService.ts +0 -186
- package/src/_internal/platform/languages/common/languageDiagnosticsService.ts +0 -67
- package/src/_internal/platform/languages/common/testLanguageDiagnosticsService.ts +0 -28
- package/src/_internal/platform/log/common/logService.ts +0 -232
- package/src/_internal/platform/nesFetch/common/completionsAPI.ts +0 -78
- package/src/_internal/platform/nesFetch/common/completionsFetchService.ts +0 -118
- package/src/_internal/platform/nesFetch/common/responseStream.ts +0 -151
- package/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.ts +0 -236
- package/src/_internal/platform/nesFetch/node/streamTransformer.ts +0 -95
- package/src/_internal/platform/networking/common/fetch.ts +0 -349
- package/src/_internal/platform/networking/common/fetcherService.ts +0 -84
- package/src/_internal/platform/networking/common/networking.ts +0 -442
- package/src/_internal/platform/networking/common/openai.ts +0 -273
- package/src/_internal/platform/networking/node/chatStream.ts +0 -137
- package/src/_internal/platform/networking/node/stream.ts +0 -749
- package/src/_internal/platform/notebook/common/alternativeContent.ts +0 -89
- package/src/_internal/platform/notebook/common/alternativeContentFormat.ts +0 -10
- package/src/_internal/platform/notebook/common/alternativeContentProvider.json.ts +0 -262
- package/src/_internal/platform/notebook/common/alternativeContentProvider.text.ts +0 -243
- package/src/_internal/platform/notebook/common/alternativeContentProvider.ts +0 -41
- package/src/_internal/platform/notebook/common/alternativeContentProvider.xml.ts +0 -205
- package/src/_internal/platform/notebook/common/alternativeNotebookDocument.ts +0 -155
- package/src/_internal/platform/notebook/common/helpers.ts +0 -212
- package/src/_internal/platform/notebook/common/notebookService.ts +0 -43
- package/src/_internal/platform/openai/node/fetch.ts +0 -596
- package/src/_internal/platform/parser/node/nodes.ts +0 -190
- package/src/_internal/platform/requestLogger/node/nullRequestLogger.ts +0 -26
- package/src/_internal/platform/requestLogger/node/requestLogger.ts +0 -383
- package/src/_internal/platform/simulationTestContext/common/simulationTestContext.ts +0 -29
- package/src/_internal/platform/snippy/common/snippyService.ts +0 -25
- package/src/_internal/platform/telemetry/common/nullExperimentationService.ts +0 -64
- package/src/_internal/platform/telemetry/common/nullTelemetryService.ts +0 -53
- package/src/_internal/platform/telemetry/common/telemetry.ts +0 -215
- package/src/_internal/platform/telemetry/common/telemetryData.ts +0 -205
- package/src/_internal/platform/thinking/common/thinking.ts +0 -61
- package/src/_internal/platform/thinking/common/thinkingUtils.ts +0 -57
- package/src/_internal/platform/tokenizer/node/parseTikTokens.ts +0 -23
- package/src/_internal/platform/tokenizer/node/tikTokenizerImpl.ts +0 -74
- package/src/_internal/platform/tokenizer/node/tikTokenizerWorker.ts +0 -24
- package/src/_internal/platform/tokenizer/node/tokenizer.ts +0 -357
- package/src/_internal/platform/workspace/common/workspaceService.ts +0 -226
- package/src/_internal/platform/workspaceRecorder/common/workspaceLog.ts +0 -118
- package/src/_internal/util/common/anomalyDetection.ts +0 -112
- package/src/_internal/util/common/arrays.ts +0 -81
- package/src/_internal/util/common/async.ts +0 -155
- package/src/_internal/util/common/cache.ts +0 -183
- package/src/_internal/util/common/crypto.ts +0 -41
- package/src/_internal/util/common/errors.ts +0 -22
- package/src/_internal/util/common/globals.d.ts +0 -12
- package/src/_internal/util/common/imageUtils.ts +0 -154
- package/src/_internal/util/common/languages.ts +0 -940
- package/src/_internal/util/common/notebooks.ts +0 -286
- package/src/_internal/util/common/result.ts +0 -71
- package/src/_internal/util/common/services.ts +0 -43
- package/src/_internal/util/common/test/shims/chatTypes.ts +0 -448
- package/src/_internal/util/common/test/shims/editing.ts +0 -233
- package/src/_internal/util/common/test/shims/enums.ts +0 -61
- package/src/_internal/util/common/test/shims/l10n.ts +0 -37
- package/src/_internal/util/common/test/shims/newSymbolName.ts +0 -23
- package/src/_internal/util/common/test/shims/terminal.ts +0 -33
- package/src/_internal/util/common/test/shims/vscodeTypesShim.ts +0 -115
- package/src/_internal/util/common/time.ts +0 -31
- package/src/_internal/util/common/tokenizer.ts +0 -30
- package/src/_internal/util/common/tracing.ts +0 -52
- package/src/_internal/util/common/types.ts +0 -33
- package/src/_internal/util/common/variableLengthQuantity.ts +0 -40
- package/src/_internal/util/node/worker.ts +0 -130
- package/src/_internal/util/vs/base/common/arrays.ts +0 -926
- package/src/_internal/util/vs/base/common/arraysFind.ts +0 -206
- package/src/_internal/util/vs/base/common/assert.ts +0 -89
- package/src/_internal/util/vs/base/common/async.ts +0 -2582
- package/src/_internal/util/vs/base/common/buffer.ts +0 -501
- package/src/_internal/util/vs/base/common/cache.ts +0 -122
- package/src/_internal/util/vs/base/common/cancellation.ts +0 -150
- package/src/_internal/util/vs/base/common/charCode.ts +0 -452
- package/src/_internal/util/vs/base/common/codicons.ts +0 -66
- package/src/_internal/util/vs/base/common/codiconsLibrary.ts +0 -618
- package/src/_internal/util/vs/base/common/codiconsUtil.ts +0 -30
- package/src/_internal/util/vs/base/common/collections.ts +0 -156
- package/src/_internal/util/vs/base/common/diff/diff.ts +0 -1317
- package/src/_internal/util/vs/base/common/diff/diffChange.ts +0 -62
- package/src/_internal/util/vs/base/common/equals.ts +0 -148
- package/src/_internal/util/vs/base/common/errors.ts +0 -342
- package/src/_internal/util/vs/base/common/event.ts +0 -1782
- package/src/_internal/util/vs/base/common/extpath.ts +0 -425
- package/src/_internal/util/vs/base/common/filters.ts +0 -928
- package/src/_internal/util/vs/base/common/functional.ts +0 -34
- package/src/_internal/util/vs/base/common/glob.ts +0 -839
- package/src/_internal/util/vs/base/common/hash.ts +0 -326
- package/src/_internal/util/vs/base/common/htmlContent.ts +0 -212
- package/src/_internal/util/vs/base/common/iconLabels.ts +0 -118
- package/src/_internal/util/vs/base/common/iterator.ts +0 -196
- package/src/_internal/util/vs/base/common/lazy.ts +0 -59
- package/src/_internal/util/vs/base/common/lifecycle.ts +0 -845
- package/src/_internal/util/vs/base/common/linkedList.ts +0 -144
- package/src/_internal/util/vs/base/common/map.ts +0 -954
- package/src/_internal/util/vs/base/common/marshallingIds.ts +0 -35
- package/src/_internal/util/vs/base/common/mime.ts +0 -136
- package/src/_internal/util/vs/base/common/naturalLanguage/korean.ts +0 -425
- package/src/_internal/util/vs/base/common/network.ts +0 -429
- package/src/_internal/util/vs/base/common/numbers.ts +0 -166
- package/src/_internal/util/vs/base/common/objects.ts +0 -242
- package/src/_internal/util/vs/base/common/observable.ts +0 -10
- package/src/_internal/util/vs/base/common/observableInternal/base.ts +0 -208
- package/src/_internal/util/vs/base/common/observableInternal/changeTracker.ts +0 -96
- package/src/_internal/util/vs/base/common/observableInternal/commonFacade/cancellation.ts +0 -9
- package/src/_internal/util/vs/base/common/observableInternal/commonFacade/deps.ts +0 -12
- package/src/_internal/util/vs/base/common/observableInternal/debugLocation.ts +0 -88
- package/src/_internal/util/vs/base/common/observableInternal/debugName.ts +0 -150
- package/src/_internal/util/vs/base/common/observableInternal/experimental/utils.ts +0 -62
- package/src/_internal/util/vs/base/common/observableInternal/index.ts +0 -61
- package/src/_internal/util/vs/base/common/observableInternal/logging/consoleObservableLogger.ts +0 -388
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerApi.d.ts +0 -154
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerRpc.ts +0 -80
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/devToolsLogger.ts +0 -485
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/rpc.ts +0 -103
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/utils.ts +0 -69
- package/src/_internal/util/vs/base/common/observableInternal/logging/logging.ts +0 -133
- package/src/_internal/util/vs/base/common/observableInternal/map.ts +0 -81
- package/src/_internal/util/vs/base/common/observableInternal/observables/baseObservable.ts +0 -172
- package/src/_internal/util/vs/base/common/observableInternal/observables/constObservable.ts +0 -44
- package/src/_internal/util/vs/base/common/observableInternal/observables/derived.ts +0 -190
- package/src/_internal/util/vs/base/common/observableInternal/observables/derivedImpl.ts +0 -445
- package/src/_internal/util/vs/base/common/observableInternal/observables/lazyObservableValue.ts +0 -154
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableFromEvent.ts +0 -174
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignal.ts +0 -67
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignalFromEvent.ts +0 -62
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableValue.ts +0 -131
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableValueOpts.ts +0 -37
- package/src/_internal/util/vs/base/common/observableInternal/reactions/autorun.ts +0 -188
- package/src/_internal/util/vs/base/common/observableInternal/reactions/autorunImpl.ts +0 -256
- package/src/_internal/util/vs/base/common/observableInternal/set.ts +0 -78
- package/src/_internal/util/vs/base/common/observableInternal/transaction.ts +0 -115
- package/src/_internal/util/vs/base/common/observableInternal/utils/promise.ts +0 -129
- package/src/_internal/util/vs/base/common/observableInternal/utils/runOnChange.ts +0 -65
- package/src/_internal/util/vs/base/common/observableInternal/utils/utils.ts +0 -281
- package/src/_internal/util/vs/base/common/observableInternal/utils/utilsCancellation.ts +0 -101
- package/src/_internal/util/vs/base/common/observableInternal/utils/valueWithChangeEvent.ts +0 -31
- package/src/_internal/util/vs/base/common/path.ts +0 -1591
- package/src/_internal/util/vs/base/common/platform.ts +0 -282
- package/src/_internal/util/vs/base/common/process.ts +0 -78
- package/src/_internal/util/vs/base/common/resources.ts +0 -446
- package/src/_internal/util/vs/base/common/sequence.ts +0 -36
- package/src/_internal/util/vs/base/common/sseParser.ts +0 -247
- package/src/_internal/util/vs/base/common/stopwatch.ts +0 -43
- package/src/_internal/util/vs/base/common/stream.ts +0 -792
- package/src/_internal/util/vs/base/common/strings.ts +0 -1364
- package/src/_internal/util/vs/base/common/symbols.ts +0 -11
- package/src/_internal/util/vs/base/common/themables.ts +0 -106
- package/src/_internal/util/vs/base/common/types.ts +0 -345
- package/src/_internal/util/vs/base/common/uint.ts +0 -61
- package/src/_internal/util/vs/base/common/uri.ts +0 -752
- package/src/_internal/util/vs/base/common/uuid.ts +0 -72
- package/src/_internal/util/vs/base-common.d.ts +0 -42
- package/src/_internal/util/vs/editor/common/core/editOperation.ts +0 -62
- package/src/_internal/util/vs/editor/common/core/edits/edit.ts +0 -399
- package/src/_internal/util/vs/editor/common/core/edits/lineEdit.ts +0 -414
- package/src/_internal/util/vs/editor/common/core/edits/stringEdit.ts +0 -568
- package/src/_internal/util/vs/editor/common/core/edits/textEdit.ts +0 -411
- package/src/_internal/util/vs/editor/common/core/position.ts +0 -186
- package/src/_internal/util/vs/editor/common/core/range.ts +0 -519
- package/src/_internal/util/vs/editor/common/core/ranges/lineRange.ts +0 -416
- package/src/_internal/util/vs/editor/common/core/ranges/offsetRange.ts +0 -275
- package/src/_internal/util/vs/editor/common/core/text/abstractText.ts +0 -127
- package/src/_internal/util/vs/editor/common/core/text/positionToOffset.ts +0 -26
- package/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.ts +0 -144
- package/src/_internal/util/vs/editor/common/core/text/textLength.ts +0 -150
- package/src/_internal/util/vs/editor/common/core/wordHelper.ts +0 -177
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts +0 -210
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts +0 -109
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts +0 -178
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts +0 -331
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts +0 -273
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts +0 -475
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts +0 -47
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts +0 -248
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts +0 -76
- package/src/_internal/util/vs/editor/common/diff/legacyLinesDiffComputer.ts +0 -693
- package/src/_internal/util/vs/editor/common/diff/linesDiffComputer.ts +0 -61
- package/src/_internal/util/vs/editor/common/diff/rangeMapping.ts +0 -418
- package/src/_internal/util/vs/editor/common/model/prefixSumComputer.ts +0 -304
- package/src/_internal/util/vs/nls.messages.ts +0 -21
- package/src/_internal/util/vs/nls.ts +0 -243
- package/src/_internal/util/vs/platform/instantiation/common/descriptors.ts +0 -23
- package/src/_internal/util/vs/platform/instantiation/common/graph.ts +0 -113
- package/src/_internal/util/vs/platform/instantiation/common/instantiation.ts +0 -127
- package/src/_internal/util/vs/platform/instantiation/common/instantiationService.ts +0 -483
- package/src/_internal/util/vs/platform/instantiation/common/serviceCollection.ts +0 -34
- package/src/_internal/util/vs/vscode-globals-nls.d.ts +0 -42
- package/src/_internal/util/vs/vscode-globals-product.d.ts +0 -35
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/diagnostic.ts +0 -109
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/es5ClassCompat.ts +0 -34
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/location.ts +0 -51
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/markdownString.ts +0 -83
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/notebooks.ts +0 -296
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/position.ts +0 -195
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/range.ts +0 -167
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/selection.ts +0 -94
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetString.ts +0 -103
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetTextEdit.ts +0 -44
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/symbolInformation.ts +0 -89
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/textEdit.ts +0 -99
- package/src/_internal/vscodeTypes.ts +0 -100
- package/src/main.ts +0 -207
- package/src/package.json +0 -4063
|
@@ -1,198 +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
|
-
import type * as vscode from 'vscode';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export namespace Copilot {
|
|
9
|
-
|
|
10
|
-
export type DocumentUri = string;
|
|
11
|
-
|
|
12
|
-
export type Position = {
|
|
13
|
-
line: number;
|
|
14
|
-
character: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type Range = {
|
|
18
|
-
start: Position;
|
|
19
|
-
end: Position;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* The ContextProvider API allows extensions to provide additional context items that
|
|
24
|
-
* Copilot can use in its prompt. This file contains type definitions for the methods
|
|
25
|
-
* and the data structures used by the API.
|
|
26
|
-
*
|
|
27
|
-
* Note: providing context is not enough to ensure that the context will be used in the prompt.
|
|
28
|
-
*
|
|
29
|
-
* The API is exposed as an export of the Copilot extension. To use it, you can cast the
|
|
30
|
-
* exported object to the ContextProviderApiV1 interface.
|
|
31
|
-
*
|
|
32
|
-
* Example:
|
|
33
|
-
* ```
|
|
34
|
-
* const copilot = vscode.extensions.getExtension("github.copilot");
|
|
35
|
-
* const contextProviderAPI = copilot.exports.getContextProviderAPI("v1") as ContextProviderApiV1;
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export interface ContextProviderApiV1 {
|
|
39
|
-
registerContextProvider<T extends SupportedContextItem>(provider: ContextProvider<T>): vscode.Disposable;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Each extension can register a number of context providers, uniquely identified by their ID.
|
|
44
|
-
* In addition, each provider has to provide:
|
|
45
|
-
* - a DocumentSelector, to specify the file types for which the provider is active
|
|
46
|
-
* - a ContextResolver, a function that returns the context items for a given request
|
|
47
|
-
*
|
|
48
|
-
* Example:
|
|
49
|
-
* ```
|
|
50
|
-
* contextProviderAPI.registerContextProvider<Trait>({
|
|
51
|
-
* id: "pythonProvider",
|
|
52
|
-
* selector: [{ language: "python" }],
|
|
53
|
-
* resolver: {
|
|
54
|
-
* resolve: async (request, token) => {
|
|
55
|
-
* return [{name: 'traitName', value: 'traitValue'}];
|
|
56
|
-
* }
|
|
57
|
-
* }
|
|
58
|
-
* });
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export interface ContextProvider<T extends SupportedContextItem> {
|
|
62
|
-
id: string;
|
|
63
|
-
selector: vscode.DocumentSelector;
|
|
64
|
-
resolver: ContextResolver<T>;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface ContextResolver<T extends SupportedContextItem> {
|
|
68
|
-
resolve(request: ResolveRequest, token: vscode.CancellationToken): Promise<T> | Promise<T[]> | AsyncIterable<T>;
|
|
69
|
-
// Optional method to be invoked if the request timed out. This requests additional context items.
|
|
70
|
-
resolveOnTimeout?(request: ResolveRequest): T | readonly T[] | undefined;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* The first argument of the resolve method is a ResolveRequest object, which informs
|
|
75
|
-
* the provider about:
|
|
76
|
-
* - the completionId, a unique identifier for the completion request
|
|
77
|
-
* - the documentContext, which contains information about the document for which the context is requested
|
|
78
|
-
* - the activeExperiments, a map of active experiments and their values
|
|
79
|
-
* - the timeBudget the provider has to provide context items
|
|
80
|
-
* - the previousUsageStatistics, which contains information about the last request to the provider
|
|
81
|
-
*/
|
|
82
|
-
export type Status = 'full' | 'partial' | 'none';
|
|
83
|
-
|
|
84
|
-
export type ContextUsageStatistics = {
|
|
85
|
-
usage: Status;
|
|
86
|
-
resolution: Status;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
interface TextEdit {
|
|
90
|
-
/**
|
|
91
|
-
* The range of the text document to be manipulated. To insert
|
|
92
|
-
* text into a document create a range where start === end.
|
|
93
|
-
*/
|
|
94
|
-
range: Range;
|
|
95
|
-
/**
|
|
96
|
-
* The string to be inserted. For delete operations use an
|
|
97
|
-
* empty string.
|
|
98
|
-
*/
|
|
99
|
-
newText: string;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export type ProposedTextEdit = TextEdit & {
|
|
103
|
-
positionAfterEdit: Position;
|
|
104
|
-
// Indicates whether the edit is suggested by the IDE. Otherwise it's assumed to be speculative
|
|
105
|
-
source?: 'selectedCompletionInfo';
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export interface DocumentContext {
|
|
109
|
-
uri: DocumentUri;
|
|
110
|
-
languageId: string;
|
|
111
|
-
version: number;
|
|
112
|
-
// Position and offset are relative to the provided version of the document.
|
|
113
|
-
// The position after an edit is applied is found in ProposedTextEdit.positionAfterEdit.
|
|
114
|
-
/**
|
|
115
|
-
* @deprecated Use `position` instead.
|
|
116
|
-
*/
|
|
117
|
-
offset: number;
|
|
118
|
-
position?: Position;
|
|
119
|
-
proposedEdits?: ProposedTextEdit[];
|
|
120
|
-
}
|
|
121
|
-
export interface ResolveRequest {
|
|
122
|
-
// A unique ID to correlate the request with the completion request.
|
|
123
|
-
completionId: string;
|
|
124
|
-
// Optional the opportunity ID provided by VS Code core.
|
|
125
|
-
opportunityId?: string;
|
|
126
|
-
|
|
127
|
-
documentContext: DocumentContext;
|
|
128
|
-
|
|
129
|
-
activeExperiments: Map<string, string | number | boolean | string[]>;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* The number of milliseconds for the context provider to provide context items.
|
|
133
|
-
* After the time budget runs out, the request will be cancelled via the CancellationToken.
|
|
134
|
-
* Providers can use this value as a hint when computing context. Providers should expect the
|
|
135
|
-
* request to be cancelled once the time budget runs out.
|
|
136
|
-
*
|
|
137
|
-
* @deprecated Use `timeoutEnd` instead.
|
|
138
|
-
*/
|
|
139
|
-
timeBudget: number;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Unix timestamp representing the exact time the request will be cancelled via the CancellationToken.
|
|
143
|
-
*/
|
|
144
|
-
timeoutEnd: number;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Various statistics about the last completion request. This can be used by the context provider
|
|
148
|
-
* to make decisions about what context to provide for the current call.
|
|
149
|
-
*/
|
|
150
|
-
previousUsageStatistics?: ContextUsageStatistics;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Data from completionItem
|
|
154
|
-
*
|
|
155
|
-
* See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem
|
|
156
|
-
*/
|
|
157
|
-
data?: unknown;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Allows specifying the source of the context item, e.g., 'nes'.
|
|
161
|
-
*
|
|
162
|
-
* @experimental
|
|
163
|
-
*/
|
|
164
|
-
source: string;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* These are the data types that can be provided by a context provider. Any non-conforming
|
|
169
|
-
* context items will be filtered out.
|
|
170
|
-
*/
|
|
171
|
-
interface ContextItem {
|
|
172
|
-
/**
|
|
173
|
-
* Specifies the relative importance with respect to items of the same type.
|
|
174
|
-
* Cross-type comparisons is currently handled by the wishlist.
|
|
175
|
-
* Accepted values are integers in the range [0, 100], where 100 is the highest importance.
|
|
176
|
-
* Items with non-conforming importance values will be filtered out.
|
|
177
|
-
* Default value is 0.
|
|
178
|
-
*/
|
|
179
|
-
importance?: number;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// A key-value pair used for short string snippets.
|
|
183
|
-
export interface Trait extends ContextItem {
|
|
184
|
-
name: string;
|
|
185
|
-
value: string;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Code snippet extracted from a file. The URI is used for content exclusion.
|
|
189
|
-
export interface CodeSnippet extends ContextItem {
|
|
190
|
-
uri: string;
|
|
191
|
-
value: string;
|
|
192
|
-
// Additional URIs that contribute the same code snippet.
|
|
193
|
-
additionalUris?: string[];
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export type SupportedContextItem = Trait | CodeSnippet;
|
|
197
|
-
|
|
198
|
-
}
|
|
@@ -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 { isEqual } from '../../../../util/vs/base/common/resources';
|
|
7
|
-
import { URI } from '../../../../util/vs/base/common/uri';
|
|
8
|
-
import { OffsetRange } from '../../../../util/vs/editor/common/core/ranges/offsetRange';
|
|
9
|
-
|
|
10
|
-
export class DiagnosticData {
|
|
11
|
-
constructor(
|
|
12
|
-
public readonly documentUri: URI,
|
|
13
|
-
public readonly message: string,
|
|
14
|
-
public readonly severity: 'error' | 'warning',
|
|
15
|
-
public readonly range: OffsetRange,
|
|
16
|
-
public readonly code: string | number | undefined,
|
|
17
|
-
public readonly source: string | undefined,
|
|
18
|
-
) { }
|
|
19
|
-
|
|
20
|
-
public toString(): string {
|
|
21
|
-
return `${this.severity.toUpperCase()}: ${this.message} (${this.range})`;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
public equals(other: DiagnosticData): boolean {
|
|
25
|
-
return isEqual(this.documentUri, other.documentUri)
|
|
26
|
-
&& this.message === other.message
|
|
27
|
-
&& this.severity === other.severity
|
|
28
|
-
&& this.range.equals(other.range)
|
|
29
|
-
&& this.code === other.code
|
|
30
|
-
&& this.source === other.source;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,52 +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 { CachedFunction } from '../../../../util/vs/base/common/cache';
|
|
7
|
-
import { basename, extname } from '../../../../util/vs/base/common/path';
|
|
8
|
-
import { URI } from '../../../../util/vs/base/common/uri';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Refers to a document, independent of its content or a point in time.
|
|
12
|
-
* Two document ids are equal if they are triple-equal.
|
|
13
|
-
*/
|
|
14
|
-
export class DocumentId {
|
|
15
|
-
private static readonly _cache = new CachedFunction({ getCacheKey: JSON.stringify }, (arg: { uri: string }) => new DocumentId(arg.uri));
|
|
16
|
-
public static create(uri: string): DocumentId {
|
|
17
|
-
return DocumentId._cache.get({ uri });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
private readonly _uri = URI.parse(this.uri);
|
|
21
|
-
|
|
22
|
-
private constructor(
|
|
23
|
-
public readonly uri: string,
|
|
24
|
-
) {
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public get path(): string {
|
|
28
|
-
return this._uri.path;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public get fragment(): string {
|
|
32
|
-
return this._uri.fragment;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public toString(): string {
|
|
36
|
-
return this.uri;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public get baseName(): string {
|
|
40
|
-
return basename(this.uri);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public get extension(): string {
|
|
44
|
-
return extname(this.uri);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public toUri(): URI {
|
|
48
|
-
return this._uri;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export type SerializedDocumentId = string;
|
|
@@ -1,165 +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 { assertFn } from '../../../../util/vs/base/common/assert';
|
|
7
|
-
import { BaseEdit } from '../../../../util/vs/editor/common/core/edits/edit';
|
|
8
|
-
import { LineEdit } from '../../../../util/vs/editor/common/core/edits/lineEdit';
|
|
9
|
-
import { BaseStringEdit, BaseStringReplacement, StringEdit } from '../../../../util/vs/editor/common/core/edits/stringEdit';
|
|
10
|
-
import { StringText } from '../../../../util/vs/editor/common/core/text/abstractText';
|
|
11
|
-
import { deserializeStringEdit, SerializedEdit, serializeStringEdit } from './editUtils';
|
|
12
|
-
import { RootedLineEdit } from './rootedLineEdit';
|
|
13
|
-
|
|
14
|
-
export class RootedEdit<TEdit extends BaseStringEdit<BaseStringReplacement<any>, any> = StringEdit> {
|
|
15
|
-
|
|
16
|
-
public static toLineEdit(edit: RootedEdit<BaseStringEdit<BaseStringReplacement<any>, any>>): LineEdit {
|
|
17
|
-
return LineEdit.fromEdit(edit.edit as StringEdit, edit.base);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
constructor(
|
|
21
|
-
public readonly base: StringText,
|
|
22
|
-
public readonly edit: TEdit,
|
|
23
|
-
) { }
|
|
24
|
-
|
|
25
|
-
public getEditedState(): StringText {
|
|
26
|
-
return this.edit.applyOnText(this.base);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Creates a rooted edit `r`, such that
|
|
31
|
-
* * `r.initialState.equals(this.initialState.apply(onto))`
|
|
32
|
-
* * `(r.initialState.apply(r.edit)).equals(this.initialState.apply(onto).apply(this.edit))`
|
|
33
|
-
*/
|
|
34
|
-
public rebase(onto: StringEdit): RootedEdit {
|
|
35
|
-
const result: RootedEdit = null!;
|
|
36
|
-
|
|
37
|
-
// TODO implement
|
|
38
|
-
|
|
39
|
-
assertFn(() => result.base.equals(onto.applyOnText(this.base)));
|
|
40
|
-
assertFn(() => result.edit.applyOnText(result.base).equals(this.edit.applyOnText(onto.applyOnText(this.base))));
|
|
41
|
-
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public toString(): string {
|
|
46
|
-
const e = RootedLineEdit.fromEdit(this);
|
|
47
|
-
return e.toString();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* If `r.base.equals(this.base)` and `r.getEditedState().equals(this.getEditedState())`, then `r.normalize().equals(this.normalize())`.
|
|
52
|
-
*/
|
|
53
|
-
public normalize(): RootedEdit {
|
|
54
|
-
return new RootedEdit(this.base, this.edit.normalizeOnSource(this.base.value));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public equals(other: RootedEdit): boolean {
|
|
58
|
-
return this.base.equals(other.base) && this.edit.equals(other.edit);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type TReplacement<TEdit> = TEdit extends BaseEdit<infer TReplacement, any> ? TReplacement : never;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Represents a sequence of single edits.
|
|
66
|
-
*/
|
|
67
|
-
export class SingleEdits<TEdit extends BaseStringEdit<BaseStringReplacement<any>, any> = StringEdit> {
|
|
68
|
-
constructor(
|
|
69
|
-
/**
|
|
70
|
-
* The edits are applied in order and don't have to be sorted.
|
|
71
|
-
*/
|
|
72
|
-
public readonly edits: readonly TEdit['TReplacement'][],
|
|
73
|
-
) { }
|
|
74
|
-
|
|
75
|
-
compose(): StringEdit {
|
|
76
|
-
return StringEdit.compose(this.edits.map(e => e.toEdit()));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
apply(value: string): string {
|
|
80
|
-
return this.compose().apply(value);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
isEmpty(): boolean {
|
|
84
|
-
return this.edits.length === 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
toEdits(): Edits<StringEdit> {
|
|
88
|
-
return new Edits(StringEdit, this.edits.map(e => e.toEdit()));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Represents a sequence of edits.
|
|
94
|
-
*/
|
|
95
|
-
export class Edits<T extends BaseStringEdit<BaseStringReplacement<any>, any> = StringEdit> {
|
|
96
|
-
public static single(edit: StringEdit): Edits {
|
|
97
|
-
return new Edits(StringEdit, [edit]);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
constructor(
|
|
101
|
-
private readonly _editType: new (replacements: readonly TReplacement<T>[]) => T,
|
|
102
|
-
/**
|
|
103
|
-
* The edits are applied in given order and don't have to be sorted.
|
|
104
|
-
* Least to most recent.
|
|
105
|
-
*/
|
|
106
|
-
public readonly edits: readonly T[],
|
|
107
|
-
) { }
|
|
108
|
-
|
|
109
|
-
compose(): T {
|
|
110
|
-
let edit = new this._editType([]);
|
|
111
|
-
for (const e of this.edits) {
|
|
112
|
-
edit = edit.compose(e);
|
|
113
|
-
}
|
|
114
|
-
return edit;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
add(edit: T): Edits<T> {
|
|
118
|
-
return new Edits(this._editType, [...this.edits, edit]);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
apply(value: string): string {
|
|
122
|
-
return this.compose().apply(value);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
isEmpty(): boolean {
|
|
126
|
-
return this.edits.length === 0;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
swap(editFirst: StringEdit): { edits: Edits; editLast: StringEdit } | undefined {
|
|
130
|
-
let eM = editFirst;
|
|
131
|
-
const newEdits: StringEdit[] = [];
|
|
132
|
-
for (const e of this.edits) {
|
|
133
|
-
const e_ = BaseStringEdit.trySwap(eM, e);
|
|
134
|
-
if (!e_) {
|
|
135
|
-
return undefined;
|
|
136
|
-
}
|
|
137
|
-
newEdits.push(e_.e1);
|
|
138
|
-
eM = e_.e2;
|
|
139
|
-
}
|
|
140
|
-
return { edits: new Edits(StringEdit, newEdits), editLast: eM };
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/*mapData<T2 extends IEditData<T2> | void = void>(f: (data: T) => T2): Edits<T2> {
|
|
144
|
-
return new Edits(this.edits.map(e => e.mapData(f)));
|
|
145
|
-
}*/
|
|
146
|
-
|
|
147
|
-
serialize(): SerializedEdit[] {
|
|
148
|
-
return this.edits.map(e => serializeStringEdit(e));
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
public static deserialize(v: SerializedEdit[]): Edits {
|
|
152
|
-
return new Edits(StringEdit, v.map(e => deserializeStringEdit(e)));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
toHumanReadablePatch(base: StringText): string {
|
|
156
|
-
let curBase = base;
|
|
157
|
-
const result: string[] = [];
|
|
158
|
-
for (const edit of this.edits) {
|
|
159
|
-
const lineEdit = RootedEdit.toLineEdit(new RootedEdit(curBase, edit));
|
|
160
|
-
result.push(lineEdit.humanReadablePatch(curBase.getLines()));
|
|
161
|
-
curBase = edit.applyOnText(curBase);
|
|
162
|
-
}
|
|
163
|
-
return result.join('\n---\n');
|
|
164
|
-
}
|
|
165
|
-
}
|
|
@@ -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 { illegalArgument } from '../../../../util/vs/base/common/errors';
|
|
7
|
-
import { BaseStringEdit, BaseStringReplacement, StringEdit, StringReplacement } from '../../../../util/vs/editor/common/core/edits/stringEdit';
|
|
8
|
-
import { OffsetRange } from '../../../../util/vs/editor/common/core/ranges/offsetRange';
|
|
9
|
-
import { SingleEdits } from './edit';
|
|
10
|
-
import { Permutation } from './permutation';
|
|
11
|
-
|
|
12
|
-
export function serializeStringEdit(edit: BaseStringEdit): SerializedEdit {
|
|
13
|
-
return edit.replacements.map(e => serializeSingleEdit(e));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function serializeSingleEdit(edit: BaseStringReplacement): SerializedReplacement {
|
|
17
|
-
return [edit.replaceRange.start, edit.replaceRange.endExclusive, edit.newText];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function deserializeStringEdit(serialized: SerializedEdit): StringEdit {
|
|
21
|
-
return new StringEdit(serialized.map(e => deserializeSingleEdit(e)));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function deserializeSingleEdit(serialized: SerializedReplacement): StringReplacement {
|
|
25
|
-
return new StringReplacement(
|
|
26
|
-
new OffsetRange(serialized[0], serialized[1]),
|
|
27
|
-
serialized[2],
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type SerializedEdit = SerializedReplacement[];
|
|
32
|
-
|
|
33
|
-
export type SerializedReplacement = [startOffset: number, endOffsetEx: number, newText: string];
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* For every single text edit, it creates a new edit.
|
|
37
|
-
* If permutation is not given, decomposed in-order.
|
|
38
|
-
*/
|
|
39
|
-
export function decomposeStringEdit<TEdit extends BaseStringEdit<BaseStringReplacement, TEdit>>(edit: TEdit, permutation?: Permutation): SingleEdits<TEdit> {
|
|
40
|
-
if (permutation === undefined) {
|
|
41
|
-
const result: BaseStringReplacement[] = [];
|
|
42
|
-
let offset = 0;
|
|
43
|
-
for (const e of edit.replacements) {
|
|
44
|
-
result.push(e.delta(offset));
|
|
45
|
-
|
|
46
|
-
offset += e.newText.length - e.replaceRange.length;
|
|
47
|
-
}
|
|
48
|
-
return new SingleEdits(result);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (edit.replacements.length !== permutation.arrayLength) {
|
|
52
|
-
throw illegalArgument(`Number of edits ${edit.replacements.length} does not match ${permutation.arrayLength}`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const result: BaseStringReplacement[] = [];
|
|
56
|
-
const sortedSingleEdits = edit.replacements.slice();
|
|
57
|
-
|
|
58
|
-
for (let i = 0; i < edit.replacements.length; ++i) {
|
|
59
|
-
|
|
60
|
-
const idxInEdits = permutation.mapIndexBack(i);
|
|
61
|
-
const singleEdit = sortedSingleEdits[idxInEdits];
|
|
62
|
-
|
|
63
|
-
result.push(singleEdit);
|
|
64
|
-
|
|
65
|
-
// move all edits that occur after `singleEdit`
|
|
66
|
-
for (let j = idxInEdits; j < sortedSingleEdits.length; ++j) {
|
|
67
|
-
const offsetDelta = singleEdit.newText.length - singleEdit.replaceRange.length;
|
|
68
|
-
const e = sortedSingleEdits[j];
|
|
69
|
-
sortedSingleEdits[j] = e.delta(offsetDelta);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return new SingleEdits(result);
|
|
74
|
-
}
|
|
@@ -1,14 +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 { CancellationError } from '../../../../util/vs/base/common/errors';
|
|
7
|
-
|
|
8
|
-
export class FetchCancellationError extends CancellationError {
|
|
9
|
-
constructor(
|
|
10
|
-
public readonly extraInformation?: string
|
|
11
|
-
) {
|
|
12
|
-
super();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,107 +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 { Diagnostic, Uri } from '../../../../util/common/test/shims/vscodeTypesShim';
|
|
7
|
-
import { ContextItem, ContextKind, SnippetContext, TraitContext } from '../../../languageServer/common/languageContextService';
|
|
8
|
-
|
|
9
|
-
export type LanguageContextEntry = {
|
|
10
|
-
context: ContextItem;
|
|
11
|
-
timeStamp: number;
|
|
12
|
-
onTimeout: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type LanguageContextResponse = {
|
|
16
|
-
start: number;
|
|
17
|
-
end: number;
|
|
18
|
-
items: LanguageContextEntry[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
type SerializedSnippetContext = {
|
|
22
|
-
kind: ContextKind.Snippet;
|
|
23
|
-
priority: number;
|
|
24
|
-
uri: string;
|
|
25
|
-
additionalUris?: string[];
|
|
26
|
-
value: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
type SerializedTraitContext = {
|
|
30
|
-
kind: ContextKind.Trait;
|
|
31
|
-
priority: number;
|
|
32
|
-
name: string;
|
|
33
|
-
value: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
type SerializedContextItem = SerializedSnippetContext | SerializedTraitContext;
|
|
37
|
-
|
|
38
|
-
export type SerializedContextResponse = {
|
|
39
|
-
start: number;
|
|
40
|
-
end: number;
|
|
41
|
-
items: {
|
|
42
|
-
context: SerializedContextItem;
|
|
43
|
-
timeStamp: number;
|
|
44
|
-
}[];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function serializeLanguageContext(response: LanguageContextResponse): SerializedContextResponse {
|
|
48
|
-
return {
|
|
49
|
-
start: response.start,
|
|
50
|
-
end: response.end,
|
|
51
|
-
items: response.items.map(item => ({
|
|
52
|
-
context: serializeLanguageContextItem(item.context),
|
|
53
|
-
timeStamp: item.timeStamp,
|
|
54
|
-
onTimeout: item.onTimeout,
|
|
55
|
-
}))
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function serializeLanguageContextItem(context: ContextItem): SerializedContextItem {
|
|
60
|
-
switch (context.kind) {
|
|
61
|
-
case ContextKind.Snippet:
|
|
62
|
-
return serializeSnippetContext(context);
|
|
63
|
-
case ContextKind.Trait:
|
|
64
|
-
return serializeTraitContext(context);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function serializeSnippetContext(context: SnippetContext): SerializedSnippetContext {
|
|
69
|
-
return {
|
|
70
|
-
kind: context.kind,
|
|
71
|
-
priority: context.priority,
|
|
72
|
-
uri: context.uri.toString(),
|
|
73
|
-
additionalUris: context.additionalUris?.map(uri => uri.toString()),
|
|
74
|
-
value: context.value
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function serializeTraitContext(context: TraitContext): SerializedTraitContext {
|
|
79
|
-
return {
|
|
80
|
-
kind: context.kind,
|
|
81
|
-
priority: context.priority,
|
|
82
|
-
name: context.name,
|
|
83
|
-
value: context.value
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export type SerializedDiagnostic = {
|
|
88
|
-
uri: string;
|
|
89
|
-
severity: number;
|
|
90
|
-
message: string;
|
|
91
|
-
source: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function serializeDiagnostic(diagnostic: Diagnostic, resource: Uri): SerializedDiagnostic {
|
|
95
|
-
return {
|
|
96
|
-
uri: resource.toString(),
|
|
97
|
-
severity: diagnostic.severity,
|
|
98
|
-
message: diagnostic.message,
|
|
99
|
-
source: diagnostic.source || ''
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function serializeFileDiagnostics(diagnostics: [Uri, Diagnostic[]][]): SerializedDiagnostic[] {
|
|
104
|
-
return diagnostics.flatMap(([resource, diags]) =>
|
|
105
|
-
diags.map(diagnostic => serializeDiagnostic(diagnostic, resource))
|
|
106
|
-
);
|
|
107
|
-
}
|
|
@@ -1,14 +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 LanguageId = string & { _brand: 'languageId' };
|
|
7
|
-
|
|
8
|
-
export namespace LanguageId {
|
|
9
|
-
export const PlainText = create('plaintext');
|
|
10
|
-
|
|
11
|
-
export function create(value: string): LanguageId {
|
|
12
|
-
return value as LanguageId;
|
|
13
|
-
}
|
|
14
|
-
}
|