MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / init

Method init

src/core/Snippets.ts:63–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61 }
62
63 async init() {
64 const extensionPath = this.graph.extensionContext.extensionPath;
65 const snippetsDir = join(extensionPath, "cursorless-snippets");
66 const snippetFiles = await walkFiles(snippetsDir);
67 this.coreSnippets = mergeStrict(
68 ...(await Promise.all(
69 snippetFiles.map(async (path) =>
70 JSON.parse(await readFile(path, "utf8"))
71 )
72 ))
73 );
74 await this.updateUserSnippets();
75 }
76
77 /**
78 * Updates the userSnippetsDir field if it has change, returning a boolean

Callers

nothing calls this directly

Calls 3

updateUserSnippetsMethod · 0.95
walkFilesFunction · 0.90
mergeStrictFunction · 0.90

Tested by

no test coverage detected