@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,693 +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 { CharCode } from '../../../base/common/charCode';
|
|
9
|
-
import { IDiffChange, ISequence, LcsDiff, IDiffResult } from '../../../base/common/diff/diff';
|
|
10
|
-
import { ILinesDiffComputer, ILinesDiffComputerOptions, LinesDiff } from './linesDiffComputer';
|
|
11
|
-
import { RangeMapping, DetailedLineRangeMapping } from './rangeMapping';
|
|
12
|
-
import * as strings from '../../../base/common/strings';
|
|
13
|
-
import { Range } from '../core/range';
|
|
14
|
-
import { assertFn, checkAdjacentItems } from '../../../base/common/assert';
|
|
15
|
-
import { LineRange } from '../core/ranges/lineRange';
|
|
16
|
-
|
|
17
|
-
const MINIMUM_MATCHING_CHARACTER_LENGTH = 3;
|
|
18
|
-
|
|
19
|
-
export class LegacyLinesDiffComputer implements ILinesDiffComputer {
|
|
20
|
-
computeDiff(originalLines: string[], modifiedLines: string[], options: ILinesDiffComputerOptions): LinesDiff {
|
|
21
|
-
const diffComputer = new DiffComputer(originalLines, modifiedLines, {
|
|
22
|
-
maxComputationTime: options.maxComputationTimeMs,
|
|
23
|
-
shouldIgnoreTrimWhitespace: options.ignoreTrimWhitespace,
|
|
24
|
-
shouldComputeCharChanges: true,
|
|
25
|
-
shouldMakePrettyDiff: true,
|
|
26
|
-
shouldPostProcessCharChanges: true,
|
|
27
|
-
});
|
|
28
|
-
const result = diffComputer.computeDiff();
|
|
29
|
-
const changes: DetailedLineRangeMapping[] = [];
|
|
30
|
-
let lastChange: DetailedLineRangeMapping | null = null;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
for (const c of result.changes) {
|
|
34
|
-
let originalRange: LineRange;
|
|
35
|
-
if (c.originalEndLineNumber === 0) {
|
|
36
|
-
// Insertion
|
|
37
|
-
originalRange = new LineRange(c.originalStartLineNumber + 1, c.originalStartLineNumber + 1);
|
|
38
|
-
} else {
|
|
39
|
-
originalRange = new LineRange(c.originalStartLineNumber, c.originalEndLineNumber + 1);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let modifiedRange: LineRange;
|
|
43
|
-
if (c.modifiedEndLineNumber === 0) {
|
|
44
|
-
// Deletion
|
|
45
|
-
modifiedRange = new LineRange(c.modifiedStartLineNumber + 1, c.modifiedStartLineNumber + 1);
|
|
46
|
-
} else {
|
|
47
|
-
modifiedRange = new LineRange(c.modifiedStartLineNumber, c.modifiedEndLineNumber + 1);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
let change = new DetailedLineRangeMapping(originalRange, modifiedRange, c.charChanges?.map(c => new RangeMapping(
|
|
51
|
-
new Range(c.originalStartLineNumber, c.originalStartColumn, c.originalEndLineNumber, c.originalEndColumn),
|
|
52
|
-
new Range(c.modifiedStartLineNumber, c.modifiedStartColumn, c.modifiedEndLineNumber, c.modifiedEndColumn),
|
|
53
|
-
)));
|
|
54
|
-
if (lastChange) {
|
|
55
|
-
if (lastChange.modified.endLineNumberExclusive === change.modified.startLineNumber
|
|
56
|
-
|| lastChange.original.endLineNumberExclusive === change.original.startLineNumber) {
|
|
57
|
-
// join touching diffs. Probably moving diffs up/down in the algorithm causes touching diffs.
|
|
58
|
-
change = new DetailedLineRangeMapping(
|
|
59
|
-
lastChange.original.join(change.original),
|
|
60
|
-
lastChange.modified.join(change.modified),
|
|
61
|
-
lastChange.innerChanges && change.innerChanges ?
|
|
62
|
-
lastChange.innerChanges.concat(change.innerChanges) : undefined
|
|
63
|
-
);
|
|
64
|
-
changes.pop();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
changes.push(change);
|
|
69
|
-
lastChange = change;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
assertFn(() => {
|
|
73
|
-
return checkAdjacentItems(changes,
|
|
74
|
-
(m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive &&
|
|
75
|
-
// There has to be an unchanged line in between (otherwise both diffs should have been joined)
|
|
76
|
-
m1.original.endLineNumberExclusive < m2.original.startLineNumber &&
|
|
77
|
-
m1.modified.endLineNumberExclusive < m2.modified.startLineNumber,
|
|
78
|
-
);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
return new LinesDiff(changes, [], result.quitEarly);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface IDiffComputationResult {
|
|
86
|
-
quitEarly: boolean;
|
|
87
|
-
identical: boolean;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* The changes as (legacy) line change array.
|
|
91
|
-
* @deprecated Use `changes2` instead.
|
|
92
|
-
*/
|
|
93
|
-
changes: ILineChange[];
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* The changes as (modern) line range mapping array.
|
|
97
|
-
*/
|
|
98
|
-
changes2: readonly DetailedLineRangeMapping[];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* A change
|
|
103
|
-
*/
|
|
104
|
-
export interface IChange {
|
|
105
|
-
readonly originalStartLineNumber: number;
|
|
106
|
-
readonly originalEndLineNumber: number;
|
|
107
|
-
readonly modifiedStartLineNumber: number;
|
|
108
|
-
readonly modifiedEndLineNumber: number;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* A character level change.
|
|
113
|
-
*/
|
|
114
|
-
export interface ICharChange extends IChange {
|
|
115
|
-
readonly originalStartColumn: number;
|
|
116
|
-
readonly originalEndColumn: number;
|
|
117
|
-
readonly modifiedStartColumn: number;
|
|
118
|
-
readonly modifiedEndColumn: number;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* A line change
|
|
123
|
-
*/
|
|
124
|
-
export interface ILineChange extends IChange {
|
|
125
|
-
readonly charChanges: ICharChange[] | undefined;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface IDiffComputerResult {
|
|
129
|
-
quitEarly: boolean;
|
|
130
|
-
changes: ILineChange[];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function computeDiff(originalSequence: ISequence, modifiedSequence: ISequence, continueProcessingPredicate: () => boolean, pretty: boolean): IDiffResult {
|
|
134
|
-
const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);
|
|
135
|
-
return diffAlgo.ComputeDiff(pretty);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
class LineSequence implements ISequence {
|
|
139
|
-
|
|
140
|
-
public readonly lines: string[];
|
|
141
|
-
private readonly _startColumns: number[];
|
|
142
|
-
private readonly _endColumns: number[];
|
|
143
|
-
|
|
144
|
-
constructor(lines: string[]) {
|
|
145
|
-
const startColumns: number[] = [];
|
|
146
|
-
const endColumns: number[] = [];
|
|
147
|
-
for (let i = 0, length = lines.length; i < length; i++) {
|
|
148
|
-
startColumns[i] = getFirstNonBlankColumn(lines[i], 1);
|
|
149
|
-
endColumns[i] = getLastNonBlankColumn(lines[i], 1);
|
|
150
|
-
}
|
|
151
|
-
this.lines = lines;
|
|
152
|
-
this._startColumns = startColumns;
|
|
153
|
-
this._endColumns = endColumns;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
public getElements(): Int32Array | number[] | string[] {
|
|
157
|
-
const elements: string[] = [];
|
|
158
|
-
for (let i = 0, len = this.lines.length; i < len; i++) {
|
|
159
|
-
elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);
|
|
160
|
-
}
|
|
161
|
-
return elements;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
public getStrictElement(index: number): string {
|
|
165
|
-
return this.lines[index];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
public getStartLineNumber(i: number): number {
|
|
169
|
-
return i + 1;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
public getEndLineNumber(i: number): number {
|
|
173
|
-
return i + 1;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
public createCharSequence(shouldIgnoreTrimWhitespace: boolean, startIndex: number, endIndex: number): CharSequence {
|
|
177
|
-
const charCodes: number[] = [];
|
|
178
|
-
const lineNumbers: number[] = [];
|
|
179
|
-
const columns: number[] = [];
|
|
180
|
-
let len = 0;
|
|
181
|
-
for (let index = startIndex; index <= endIndex; index++) {
|
|
182
|
-
const lineContent = this.lines[index];
|
|
183
|
-
const startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1);
|
|
184
|
-
const endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1);
|
|
185
|
-
for (let col = startColumn; col < endColumn; col++) {
|
|
186
|
-
charCodes[len] = lineContent.charCodeAt(col - 1);
|
|
187
|
-
lineNumbers[len] = index + 1;
|
|
188
|
-
columns[len] = col;
|
|
189
|
-
len++;
|
|
190
|
-
}
|
|
191
|
-
if (!shouldIgnoreTrimWhitespace && index < endIndex) {
|
|
192
|
-
// Add \n if trim whitespace is not ignored
|
|
193
|
-
charCodes[len] = CharCode.LineFeed;
|
|
194
|
-
lineNumbers[len] = index + 1;
|
|
195
|
-
columns[len] = lineContent.length + 1;
|
|
196
|
-
len++;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return new CharSequence(charCodes, lineNumbers, columns);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
class CharSequence implements ISequence {
|
|
204
|
-
|
|
205
|
-
private readonly _charCodes: number[];
|
|
206
|
-
private readonly _lineNumbers: number[];
|
|
207
|
-
private readonly _columns: number[];
|
|
208
|
-
|
|
209
|
-
constructor(charCodes: number[], lineNumbers: number[], columns: number[]) {
|
|
210
|
-
this._charCodes = charCodes;
|
|
211
|
-
this._lineNumbers = lineNumbers;
|
|
212
|
-
this._columns = columns;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
public toString() {
|
|
216
|
-
return (
|
|
217
|
-
'[' + this._charCodes.map((s, idx) => (s === CharCode.LineFeed ? '\\n' : String.fromCharCode(s)) + `-(${this._lineNumbers[idx]},${this._columns[idx]})`).join(', ') + ']'
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
private _assertIndex(index: number, arr: number[]): void {
|
|
222
|
-
if (index < 0 || index >= arr.length) {
|
|
223
|
-
throw new Error(`Illegal index`);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
public getElements(): Int32Array | number[] | string[] {
|
|
228
|
-
return this._charCodes;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
public getStartLineNumber(i: number): number {
|
|
232
|
-
if (i > 0 && i === this._lineNumbers.length) {
|
|
233
|
-
// the start line number of the element after the last element
|
|
234
|
-
// is the end line number of the last element
|
|
235
|
-
return this.getEndLineNumber(i - 1);
|
|
236
|
-
}
|
|
237
|
-
this._assertIndex(i, this._lineNumbers);
|
|
238
|
-
|
|
239
|
-
return this._lineNumbers[i];
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
public getEndLineNumber(i: number): number {
|
|
243
|
-
if (i === -1) {
|
|
244
|
-
// the end line number of the element before the first element
|
|
245
|
-
// is the start line number of the first element
|
|
246
|
-
return this.getStartLineNumber(i + 1);
|
|
247
|
-
}
|
|
248
|
-
this._assertIndex(i, this._lineNumbers);
|
|
249
|
-
|
|
250
|
-
if (this._charCodes[i] === CharCode.LineFeed) {
|
|
251
|
-
return this._lineNumbers[i] + 1;
|
|
252
|
-
}
|
|
253
|
-
return this._lineNumbers[i];
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
public getStartColumn(i: number): number {
|
|
257
|
-
if (i > 0 && i === this._columns.length) {
|
|
258
|
-
// the start column of the element after the last element
|
|
259
|
-
// is the end column of the last element
|
|
260
|
-
return this.getEndColumn(i - 1);
|
|
261
|
-
}
|
|
262
|
-
this._assertIndex(i, this._columns);
|
|
263
|
-
return this._columns[i];
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
public getEndColumn(i: number): number {
|
|
267
|
-
if (i === -1) {
|
|
268
|
-
// the end column of the element before the first element
|
|
269
|
-
// is the start column of the first element
|
|
270
|
-
return this.getStartColumn(i + 1);
|
|
271
|
-
}
|
|
272
|
-
this._assertIndex(i, this._columns);
|
|
273
|
-
|
|
274
|
-
if (this._charCodes[i] === CharCode.LineFeed) {
|
|
275
|
-
return 1;
|
|
276
|
-
}
|
|
277
|
-
return this._columns[i] + 1;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
class CharChange implements ICharChange {
|
|
282
|
-
|
|
283
|
-
public originalStartLineNumber: number;
|
|
284
|
-
public originalStartColumn: number;
|
|
285
|
-
public originalEndLineNumber: number;
|
|
286
|
-
public originalEndColumn: number;
|
|
287
|
-
|
|
288
|
-
public modifiedStartLineNumber: number;
|
|
289
|
-
public modifiedStartColumn: number;
|
|
290
|
-
public modifiedEndLineNumber: number;
|
|
291
|
-
public modifiedEndColumn: number;
|
|
292
|
-
|
|
293
|
-
constructor(
|
|
294
|
-
originalStartLineNumber: number,
|
|
295
|
-
originalStartColumn: number,
|
|
296
|
-
originalEndLineNumber: number,
|
|
297
|
-
originalEndColumn: number,
|
|
298
|
-
modifiedStartLineNumber: number,
|
|
299
|
-
modifiedStartColumn: number,
|
|
300
|
-
modifiedEndLineNumber: number,
|
|
301
|
-
modifiedEndColumn: number
|
|
302
|
-
) {
|
|
303
|
-
this.originalStartLineNumber = originalStartLineNumber;
|
|
304
|
-
this.originalStartColumn = originalStartColumn;
|
|
305
|
-
this.originalEndLineNumber = originalEndLineNumber;
|
|
306
|
-
this.originalEndColumn = originalEndColumn;
|
|
307
|
-
this.modifiedStartLineNumber = modifiedStartLineNumber;
|
|
308
|
-
this.modifiedStartColumn = modifiedStartColumn;
|
|
309
|
-
this.modifiedEndLineNumber = modifiedEndLineNumber;
|
|
310
|
-
this.modifiedEndColumn = modifiedEndColumn;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
public static createFromDiffChange(diffChange: IDiffChange, originalCharSequence: CharSequence, modifiedCharSequence: CharSequence): CharChange {
|
|
314
|
-
const originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);
|
|
315
|
-
const originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);
|
|
316
|
-
const originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
|
|
317
|
-
const originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);
|
|
318
|
-
|
|
319
|
-
const modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);
|
|
320
|
-
const modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);
|
|
321
|
-
const modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
|
|
322
|
-
const modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);
|
|
323
|
-
|
|
324
|
-
return new CharChange(
|
|
325
|
-
originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn,
|
|
326
|
-
modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn,
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
function postProcessCharChanges(rawChanges: IDiffChange[]): IDiffChange[] {
|
|
332
|
-
if (rawChanges.length <= 1) {
|
|
333
|
-
return rawChanges;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const result = [rawChanges[0]];
|
|
337
|
-
let prevChange = result[0];
|
|
338
|
-
|
|
339
|
-
for (let i = 1, len = rawChanges.length; i < len; i++) {
|
|
340
|
-
const currChange = rawChanges[i];
|
|
341
|
-
|
|
342
|
-
const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);
|
|
343
|
-
const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);
|
|
344
|
-
// Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true
|
|
345
|
-
const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);
|
|
346
|
-
|
|
347
|
-
if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {
|
|
348
|
-
// Merge the current change into the previous one
|
|
349
|
-
prevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart;
|
|
350
|
-
prevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart;
|
|
351
|
-
} else {
|
|
352
|
-
// Add the current change
|
|
353
|
-
result.push(currChange);
|
|
354
|
-
prevChange = currChange;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
return result;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
class LineChange implements ILineChange {
|
|
362
|
-
public originalStartLineNumber: number;
|
|
363
|
-
public originalEndLineNumber: number;
|
|
364
|
-
public modifiedStartLineNumber: number;
|
|
365
|
-
public modifiedEndLineNumber: number;
|
|
366
|
-
public charChanges: CharChange[] | undefined;
|
|
367
|
-
|
|
368
|
-
constructor(
|
|
369
|
-
originalStartLineNumber: number,
|
|
370
|
-
originalEndLineNumber: number,
|
|
371
|
-
modifiedStartLineNumber: number,
|
|
372
|
-
modifiedEndLineNumber: number,
|
|
373
|
-
charChanges: CharChange[] | undefined
|
|
374
|
-
) {
|
|
375
|
-
this.originalStartLineNumber = originalStartLineNumber;
|
|
376
|
-
this.originalEndLineNumber = originalEndLineNumber;
|
|
377
|
-
this.modifiedStartLineNumber = modifiedStartLineNumber;
|
|
378
|
-
this.modifiedEndLineNumber = modifiedEndLineNumber;
|
|
379
|
-
this.charChanges = charChanges;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
public static createFromDiffResult(shouldIgnoreTrimWhitespace: boolean, diffChange: IDiffChange, originalLineSequence: LineSequence, modifiedLineSequence: LineSequence, continueCharDiff: () => boolean, shouldComputeCharChanges: boolean, shouldPostProcessCharChanges: boolean): LineChange {
|
|
383
|
-
let originalStartLineNumber: number;
|
|
384
|
-
let originalEndLineNumber: number;
|
|
385
|
-
let modifiedStartLineNumber: number;
|
|
386
|
-
let modifiedEndLineNumber: number;
|
|
387
|
-
let charChanges: CharChange[] | undefined = undefined;
|
|
388
|
-
|
|
389
|
-
if (diffChange.originalLength === 0) {
|
|
390
|
-
originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;
|
|
391
|
-
originalEndLineNumber = 0;
|
|
392
|
-
} else {
|
|
393
|
-
originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);
|
|
394
|
-
originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
if (diffChange.modifiedLength === 0) {
|
|
398
|
-
modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;
|
|
399
|
-
modifiedEndLineNumber = 0;
|
|
400
|
-
} else {
|
|
401
|
-
modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);
|
|
402
|
-
modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {
|
|
406
|
-
// Compute character changes for diff chunks of at most 20 lines...
|
|
407
|
-
const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);
|
|
408
|
-
const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);
|
|
409
|
-
|
|
410
|
-
if (originalCharSequence.getElements().length > 0 && modifiedCharSequence.getElements().length > 0) {
|
|
411
|
-
let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;
|
|
412
|
-
|
|
413
|
-
if (shouldPostProcessCharChanges) {
|
|
414
|
-
rawChanges = postProcessCharChanges(rawChanges);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
charChanges = [];
|
|
418
|
-
for (let i = 0, length = rawChanges.length; i < length; i++) {
|
|
419
|
-
charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
export interface IDiffComputerOpts {
|
|
429
|
-
shouldComputeCharChanges: boolean;
|
|
430
|
-
shouldPostProcessCharChanges: boolean;
|
|
431
|
-
shouldIgnoreTrimWhitespace: boolean;
|
|
432
|
-
shouldMakePrettyDiff: boolean;
|
|
433
|
-
maxComputationTime: number;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
export class DiffComputer {
|
|
437
|
-
|
|
438
|
-
private readonly shouldComputeCharChanges: boolean;
|
|
439
|
-
private readonly shouldPostProcessCharChanges: boolean;
|
|
440
|
-
private readonly shouldIgnoreTrimWhitespace: boolean;
|
|
441
|
-
private readonly shouldMakePrettyDiff: boolean;
|
|
442
|
-
private readonly originalLines: string[];
|
|
443
|
-
private readonly modifiedLines: string[];
|
|
444
|
-
private readonly original: LineSequence;
|
|
445
|
-
private readonly modified: LineSequence;
|
|
446
|
-
private readonly continueLineDiff: () => boolean;
|
|
447
|
-
private readonly continueCharDiff: () => boolean;
|
|
448
|
-
|
|
449
|
-
constructor(originalLines: string[], modifiedLines: string[], opts: IDiffComputerOpts) {
|
|
450
|
-
this.shouldComputeCharChanges = opts.shouldComputeCharChanges;
|
|
451
|
-
this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;
|
|
452
|
-
this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;
|
|
453
|
-
this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;
|
|
454
|
-
this.originalLines = originalLines;
|
|
455
|
-
this.modifiedLines = modifiedLines;
|
|
456
|
-
this.original = new LineSequence(originalLines);
|
|
457
|
-
this.modified = new LineSequence(modifiedLines);
|
|
458
|
-
|
|
459
|
-
this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);
|
|
460
|
-
this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes...
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
public computeDiff(): IDiffComputerResult {
|
|
464
|
-
|
|
465
|
-
if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {
|
|
466
|
-
// empty original => fast path
|
|
467
|
-
if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
|
|
468
|
-
return {
|
|
469
|
-
quitEarly: false,
|
|
470
|
-
changes: []
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
return {
|
|
475
|
-
quitEarly: false,
|
|
476
|
-
changes: [{
|
|
477
|
-
originalStartLineNumber: 1,
|
|
478
|
-
originalEndLineNumber: 1,
|
|
479
|
-
modifiedStartLineNumber: 1,
|
|
480
|
-
modifiedEndLineNumber: this.modified.lines.length,
|
|
481
|
-
charChanges: undefined
|
|
482
|
-
}]
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
|
|
487
|
-
// empty modified => fast path
|
|
488
|
-
return {
|
|
489
|
-
quitEarly: false,
|
|
490
|
-
changes: [{
|
|
491
|
-
originalStartLineNumber: 1,
|
|
492
|
-
originalEndLineNumber: this.original.lines.length,
|
|
493
|
-
modifiedStartLineNumber: 1,
|
|
494
|
-
modifiedEndLineNumber: 1,
|
|
495
|
-
charChanges: undefined
|
|
496
|
-
}]
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);
|
|
501
|
-
const rawChanges = diffResult.changes;
|
|
502
|
-
const quitEarly = diffResult.quitEarly;
|
|
503
|
-
|
|
504
|
-
// The diff is always computed with ignoring trim whitespace
|
|
505
|
-
// This ensures we get the prettiest diff
|
|
506
|
-
|
|
507
|
-
if (this.shouldIgnoreTrimWhitespace) {
|
|
508
|
-
const lineChanges: LineChange[] = [];
|
|
509
|
-
for (let i = 0, length = rawChanges.length; i < length; i++) {
|
|
510
|
-
lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
|
|
511
|
-
}
|
|
512
|
-
return {
|
|
513
|
-
quitEarly: quitEarly,
|
|
514
|
-
changes: lineChanges
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
// Need to post-process and introduce changes where the trim whitespace is different
|
|
519
|
-
// Note that we are looping starting at -1 to also cover the lines before the first change
|
|
520
|
-
const result: LineChange[] = [];
|
|
521
|
-
|
|
522
|
-
let originalLineIndex = 0;
|
|
523
|
-
let modifiedLineIndex = 0;
|
|
524
|
-
for (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {
|
|
525
|
-
const nextChange = (i + 1 < len ? rawChanges[i + 1] : null);
|
|
526
|
-
const originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);
|
|
527
|
-
const modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);
|
|
528
|
-
|
|
529
|
-
while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {
|
|
530
|
-
const originalLine = this.originalLines[originalLineIndex];
|
|
531
|
-
const modifiedLine = this.modifiedLines[modifiedLineIndex];
|
|
532
|
-
|
|
533
|
-
if (originalLine !== modifiedLine) {
|
|
534
|
-
// These lines differ only in trim whitespace
|
|
535
|
-
|
|
536
|
-
// Check the leading whitespace
|
|
537
|
-
{
|
|
538
|
-
let originalStartColumn = getFirstNonBlankColumn(originalLine, 1);
|
|
539
|
-
let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);
|
|
540
|
-
while (originalStartColumn > 1 && modifiedStartColumn > 1) {
|
|
541
|
-
const originalChar = originalLine.charCodeAt(originalStartColumn - 2);
|
|
542
|
-
const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);
|
|
543
|
-
if (originalChar !== modifiedChar) {
|
|
544
|
-
break;
|
|
545
|
-
}
|
|
546
|
-
originalStartColumn--;
|
|
547
|
-
modifiedStartColumn--;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
if (originalStartColumn > 1 || modifiedStartColumn > 1) {
|
|
551
|
-
this._pushTrimWhitespaceCharChange(result,
|
|
552
|
-
originalLineIndex + 1, 1, originalStartColumn,
|
|
553
|
-
modifiedLineIndex + 1, 1, modifiedStartColumn
|
|
554
|
-
);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
// Check the trailing whitespace
|
|
559
|
-
{
|
|
560
|
-
let originalEndColumn = getLastNonBlankColumn(originalLine, 1);
|
|
561
|
-
let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);
|
|
562
|
-
const originalMaxColumn = originalLine.length + 1;
|
|
563
|
-
const modifiedMaxColumn = modifiedLine.length + 1;
|
|
564
|
-
while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {
|
|
565
|
-
const originalChar = originalLine.charCodeAt(originalEndColumn - 1);
|
|
566
|
-
const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);
|
|
567
|
-
if (originalChar !== modifiedChar) {
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
originalEndColumn++;
|
|
571
|
-
modifiedEndColumn++;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {
|
|
575
|
-
this._pushTrimWhitespaceCharChange(result,
|
|
576
|
-
originalLineIndex + 1, originalEndColumn, originalMaxColumn,
|
|
577
|
-
modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn
|
|
578
|
-
);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
originalLineIndex++;
|
|
583
|
-
modifiedLineIndex++;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
if (nextChange) {
|
|
587
|
-
// Emit the actual change
|
|
588
|
-
result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
|
|
589
|
-
|
|
590
|
-
originalLineIndex += nextChange.originalLength;
|
|
591
|
-
modifiedLineIndex += nextChange.modifiedLength;
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
return {
|
|
596
|
-
quitEarly: quitEarly,
|
|
597
|
-
changes: result
|
|
598
|
-
};
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
private _pushTrimWhitespaceCharChange(
|
|
602
|
-
result: LineChange[],
|
|
603
|
-
originalLineNumber: number, originalStartColumn: number, originalEndColumn: number,
|
|
604
|
-
modifiedLineNumber: number, modifiedStartColumn: number, modifiedEndColumn: number
|
|
605
|
-
): void {
|
|
606
|
-
if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {
|
|
607
|
-
// Merged into previous
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
let charChanges: CharChange[] | undefined = undefined;
|
|
612
|
-
if (this.shouldComputeCharChanges) {
|
|
613
|
-
charChanges = [new CharChange(
|
|
614
|
-
originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,
|
|
615
|
-
modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn
|
|
616
|
-
)];
|
|
617
|
-
}
|
|
618
|
-
result.push(new LineChange(
|
|
619
|
-
originalLineNumber, originalLineNumber,
|
|
620
|
-
modifiedLineNumber, modifiedLineNumber,
|
|
621
|
-
charChanges
|
|
622
|
-
));
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
private _mergeTrimWhitespaceCharChange(
|
|
626
|
-
result: LineChange[],
|
|
627
|
-
originalLineNumber: number, originalStartColumn: number, originalEndColumn: number,
|
|
628
|
-
modifiedLineNumber: number, modifiedStartColumn: number, modifiedEndColumn: number
|
|
629
|
-
): boolean {
|
|
630
|
-
const len = result.length;
|
|
631
|
-
if (len === 0) {
|
|
632
|
-
return false;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
const prevChange = result[len - 1];
|
|
636
|
-
|
|
637
|
-
if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {
|
|
638
|
-
// Don't merge with inserts/deletes
|
|
639
|
-
return false;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
if (prevChange.originalEndLineNumber === originalLineNumber && prevChange.modifiedEndLineNumber === modifiedLineNumber) {
|
|
643
|
-
if (this.shouldComputeCharChanges && prevChange.charChanges) {
|
|
644
|
-
prevChange.charChanges.push(new CharChange(
|
|
645
|
-
originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,
|
|
646
|
-
modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn
|
|
647
|
-
));
|
|
648
|
-
}
|
|
649
|
-
return true;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {
|
|
653
|
-
prevChange.originalEndLineNumber = originalLineNumber;
|
|
654
|
-
prevChange.modifiedEndLineNumber = modifiedLineNumber;
|
|
655
|
-
if (this.shouldComputeCharChanges && prevChange.charChanges) {
|
|
656
|
-
prevChange.charChanges.push(new CharChange(
|
|
657
|
-
originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,
|
|
658
|
-
modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn
|
|
659
|
-
));
|
|
660
|
-
}
|
|
661
|
-
return true;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
return false;
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
function getFirstNonBlankColumn(txt: string, defaultValue: number): number {
|
|
669
|
-
const r = strings.firstNonWhitespaceIndex(txt);
|
|
670
|
-
if (r === -1) {
|
|
671
|
-
return defaultValue;
|
|
672
|
-
}
|
|
673
|
-
return r + 1;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
function getLastNonBlankColumn(txt: string, defaultValue: number): number {
|
|
677
|
-
const r = strings.lastNonWhitespaceIndex(txt);
|
|
678
|
-
if (r === -1) {
|
|
679
|
-
return defaultValue;
|
|
680
|
-
}
|
|
681
|
-
return r + 2;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
function createContinueProcessingPredicate(maximumRuntime: number): () => boolean {
|
|
685
|
-
if (maximumRuntime === 0) {
|
|
686
|
-
return () => true;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
const startTime = Date.now();
|
|
690
|
-
return () => {
|
|
691
|
-
return Date.now() - startTime < maximumRuntime;
|
|
692
|
-
};
|
|
693
|
-
}
|