()
| 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 |
nothing calls this directly
no test coverage detected