MCPcopy Index your code
hub / github.com/continuedev/continue / writeToStream

Method writeToStream

core/util/generateRepoMap.ts:157–171  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

155 }
156
157 private async writeToStream(content: string): Promise<void> {
158 const tokens = this.llm.countTokens(content);
159
160 if (this.contentTokens + tokens > this.maxRepoMapTokens) {
161 content = pruneLinesFromTop(
162 content,
163 this.maxRepoMapTokens - this.contentTokens,
164 this.llm.model,
165 );
166 }
167
168 this.contentTokens += this.llm.countTokens(content);
169
170 await new Promise((resolve) => this.writeStream.write(content, resolve));
171 }
172
173 private indentMultilineString(str: string) {
174 return str

Callers 1

generateMethod · 0.95

Calls 2

pruneLinesFromTopFunction · 0.90
countTokensMethod · 0.80

Tested by

no test coverage detected