Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

LineShift

Defined in: packages/engine/src/language/DocumentReferences.ts:163

A change to a document’s lines, described in whole lines.

  • insert: count new lines now stand at line to line + count - 1; the line that was at line is now at line + count.
  • delete: the lines that stood at line to line + count - 1 are gone; the line that was at line + count is now at line.

Typing a newline at the end of line 3 inserts a line at 4; at the start of line 3 it inserts one at 3. A split or a merge in the middle of a line has no single right answer for which half is “the same line”, so the host decides by describing it as one of these.

readonly count: number;

Defined in: packages/engine/src/language/DocumentReferences.ts:169

How many lines, at least 1.


readonly kind: "insert" | "delete";

Defined in: packages/engine/src/language/DocumentReferences.ts:165

Whether lines were inserted or deleted.


readonly line: number;

Defined in: packages/engine/src/language/DocumentReferences.ts:167

The first line inserted (numbered in the new document) or deleted (numbered in the old).