MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / trim

Method trim

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

* Trim elements from the front of the buffer. * @param count the number of elements to trim (defaults to trimming the whole buffer.)

(keepMaxLines = 0)

Source from the content-addressed store, hash-verified

390 * @param count the number of elements to trim (defaults to trimming the whole buffer.)
391 */
392 trim(keepMaxLines = 0) {
393 // figure out where the new head should be
394 const newHead = Math.max(this.head, this.last - keepMaxLines);
395
396 // if we are actually trimming (and the head should move forward), then fill the elements with undefined
397 if (newHead > 0) {
398 this.#buffer.fill(undefined as unknown as string, this.head, newHead);
399
400 // set the new head position
401 this.#head = newHead;
402 }
403 }
404
405 /** returns a copy of the entire line buffer */
406 all() {

Callers 15

clearMethod · 0.95
waitForResultFileValueFunction · 0.80
getVcpkgRootFunction · 0.80
resolveCachePathFunction · 0.80
spawnChildProcessImplFunction · 0.80
extractArgsFunction · 0.80
onDataMethod · 0.80
onDataMethod · 0.80
onDataMethod · 0.80
generateFilterFnFunction · 0.80

Calls

no outgoing calls

Tested by 1

waitForResultFileValueFunction · 0.64