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

Function readFileText

Extension/src/common.ts:643–653  ·  view source on GitHub ↗
(filePath: string, encoding: BufferEncoding = "utf8")

Source from the content-addressed store, hash-verified

641
642/** Reads the content of a text file */
643export function readFileText(filePath: string, encoding: BufferEncoding = "utf8"): Promise<string> {
644 return new Promise<string>((resolve, reject) => {
645 fs.readFile(filePath, { encoding }, (err: any, data: any) => {
646 if (err) {
647 reject(err);
648 } else {
649 resolve(data);
650 }
651 });
652 });
653}
654
655/** Writes content to a text file */
656export function writeFileText(filePath: string, content: string, encoding: BufferEncoding = "utf8"): Promise<void> {

Callers 1

getRawJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected