MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / skipTo

Method skipTo

Extension/src/Utility/Process/streams.ts:114–134  ·  view source on GitHub ↗

* Advances the iterator to the point where we find the line.

(expression: string | RegExp)

Source from the content-addressed store, hash-verified

112 * Advances the iterator to the point where we find the line.
113 */
114 async skipTo(expression: string | RegExp) {
115 this.stopExpression = undefined;
116 do {
117 let line = this.lineBuffer.at(this.current);
118 while (line === undefined) {
119 await this.lineBuffer.changed;
120 line = this.lineBuffer.at(this.current);
121 if (this.lineBuffer.completed) {
122 return this;
123 }
124 }
125 this.advance();
126 if (
127 expression instanceof RegExp
128 ? expression.test(line)
129 : expression === line
130 ) {
131 return this;
132 }
133 } while (true);
134 }
135
136 /**
137 * gets the current line, and advances the position.

Callers 1

fromMethod · 0.80

Calls 2

advanceMethod · 0.95
atMethod · 0.80

Tested by

no test coverage detected