UNPKG

monaco-editor

Version:
24 lines 1.38 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { LineReplacement } from '../../../../../common/core/edits/lineEdit.js'; import { LineRange } from '../../../../../common/core/ranges/lineRange.js'; export class InlineEditWithChanges { get lineEdit() { return LineReplacement.fromSingleTextEdit(this.edit.toReplacement(this.originalText), this.originalText); } get originalLineRange() { return this.lineEdit.lineRange; } get modifiedLineRange() { return this.lineEdit.toLineEdit().getNewLineRanges()[0]; } get displayRange() { return this.originalText.lineRange.intersect(this.originalLineRange.join(LineRange.ofLength(this.originalLineRange.startLineNumber, this.lineEdit.newLines.length))); } constructor(originalText, edit, cursorPosition, commands, inlineCompletion) { this.originalText = originalText; this.edit = edit; this.cursorPosition = cursorPosition; this.commands = commands; this.inlineCompletion = inlineCompletion; } } //# sourceMappingURL=inlineEditWithChanges.js.map