MCPcopy
hub / github.com/VSCodeVim/Vim / parse

Method parse

test/testSimplifier.ts:125–143  ·  view source on GitHub ↗
(lines: string[])

Source from the content-addressed store, hash-verified

123
124class DocState {
125 public static parse(lines: string[]): DocState {
126 lines = [...lines];
127
128 const cursors: Position[] = [];
129 for (let i = 0; i < lines.length; ) {
130 const columnIdx = lines[i].indexOf('|');
131 if (columnIdx >= 0) {
132 lines[i] = lines[i].replace('|', '');
133 cursors.push(new Position(i, columnIdx));
134 } else {
135 i++;
136 }
137 }
138 if (cursors.length === 0) {
139 throw new Error("Missing '|' in test object");
140 }
141
142 return new DocState(cursors, lines);
143 }
144
145 constructor(cursors: Position[], lines: string[]) {
146 this.cursors = cursors;

Callers 4

testItFunction · 0.45
testItWithRemapsFunction · 0.45

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected