Path: blob/main/extensions/copilot/src/platform/diff/common/diffService.ts
13400 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { createServiceIdentifier } from '../../../util/common/services';6import { ILinesDiffComputerOptions, MovedText } from '../../../util/vs/editor/common/diff/linesDiffComputer';7import { DetailedLineRangeMapping } from '../../../util/vs/editor/common/diff/rangeMapping';8910export const IDiffService = createServiceIdentifier<IDiffService>('IDiffService');1112export interface IDiffService {1314readonly _serviceBrand: undefined;1516computeDiff(original: string, modified: string, options: ILinesDiffComputerOptions): Promise<IDocumentDiff>;17}1819export interface IDocumentDiff {20/**21* If true, both text models are identical (byte-wise).22*/23readonly identical: boolean;2425/**26* If true, the diff computation timed out and the diff might not be accurate.27*/28readonly quitEarly: boolean;2930/**31* Maps all modified line ranges in the original to the corresponding line ranges in the modified text model.32*/33readonly changes: readonly DetailedLineRangeMapping[];3435/**36* Sorted by original line ranges.37* The original line ranges and the modified line ranges must be disjoint (but can be touching).38*/39readonly moves: readonly MovedText[];40}414243