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

Method updateUserSnippetsPath

src/core/Snippets.ts:83–98  ·  view source on GitHub ↗

* Updates the userSnippetsDir field if it has change, returning a boolean * indicating whether there was an update. If there was an update, resets the * maxSnippetMtime to -1 to ensure snippet update. * @returns Boolean indicating whether path has changed

()

Source from the content-addressed store, hash-verified

81 * @returns Boolean indicating whether path has changed
82 */
83 private updateUserSnippetsPath(): boolean {
84 const newUserSnippetsDir = workspace
85 .getConfiguration("cursorless.experimental")
86 .get<string>("snippetsDir");
87
88 if (newUserSnippetsDir === this.userSnippetsDir) {
89 return false;
90 }
91
92 // Reset mtime to -1 so that next time we'll update the snippets
93 this.maxSnippetMtimeMs = -1;
94
95 this.userSnippetsDir = newUserSnippetsDir;
96
97 return true;
98 }
99
100 async updateUserSnippets() {
101 const snippetFiles = this.userSnippetsDir

Callers 1

constructorMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected