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

Method constructor

src/core/Snippets.ts:37–61  ·  view source on GitHub ↗
(private graph: Graph)

Source from the content-addressed store, hash-verified

35 private maxSnippetMtimeMs: number = -1;
36
37 constructor(private graph: Graph) {
38 this.updateUserSnippetsPath();
39
40 this.updateUserSnippets = this.updateUserSnippets.bind(this);
41 this.registerThirdPartySnippets =
42 this.registerThirdPartySnippets.bind(this);
43
44 const timer = setInterval(
45 this.updateUserSnippets,
46 SNIPPET_DIR_REFRESH_INTERVAL_MS
47 );
48
49 graph.extensionContext.subscriptions.push(
50 workspace.onDidChangeConfiguration(() => {
51 if (this.updateUserSnippetsPath()) {
52 this.updateUserSnippets();
53 }
54 }),
55 {
56 dispose() {
57 clearInterval(timer);
58 },
59 }
60 );
61 }
62
63 async init() {
64 const extensionPath = this.graph.extensionContext.extensionPath;

Callers

nothing calls this directly

Calls 2

updateUserSnippetsMethod · 0.95

Tested by

no test coverage detected