Skip to content

Commit

Permalink
Document VscodeFilesystem.readFileUtf8FromRoot.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Jaspan committed Jan 23, 2024
1 parent 9f6a30f commit 7d9cb22
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export class VscodeFileSystem implements FileSystem {
return path.substring(0, path.lastIndexOf("/"));
}

/**
* Reads a file under the extensionUri of the extensionContext passed to
* the constructor.
*
* @param path path to read
* @returns the contents of path, decoded as UTF-8
*/
public async readFileUtf8FromRoot(path: string): Promise<string> {
return this.decoder.decode(
await vscode.workspace.fs.readFile(
Expand Down

0 comments on commit 7d9cb22

Please sign in to comment.