Path: blob/main/extensions/copilot/src/util/vs/base/common/diff/diffChange.ts
13406 views
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'12/*---------------------------------------------------------------------------------------------3* Copyright (c) Microsoft Corporation. All rights reserved.4* Licensed under the MIT License. See License.txt in the project root for license information.5*--------------------------------------------------------------------------------------------*/67/**8* Represents information about a specific difference between two sequences.9*/10export class DiffChange {1112/**13* The position of the first element in the original sequence which14* this change affects.15*/16public originalStart: number;1718/**19* The number of elements from the original sequence which were20* affected.21*/22public originalLength: number;2324/**25* The position of the first element in the modified sequence which26* this change affects.27*/28public modifiedStart: number;2930/**31* The number of elements from the modified sequence which were32* affected (added).33*/34public modifiedLength: number;3536/**37* Constructs a new DiffChange with the given sequence information38* and content.39*/40constructor(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number) {41//Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0");42this.originalStart = originalStart;43this.originalLength = originalLength;44this.modifiedStart = modifiedStart;45this.modifiedLength = modifiedLength;46}4748/**49* The end point (exclusive) of the change in the original sequence.50*/51public getOriginalEnd() {52return this.originalStart + this.originalLength;53}5455/**56* The end point (exclusive) of the change in the modified sequence.57*/58public getModifiedEnd() {59return this.modifiedStart + this.modifiedLength;60}61}626364