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

Function getMaxPlaceholderIndex

src/actions/WrapWithSnippet.ts:148–157  ·  view source on GitHub ↗
(parsedSnippet: TextmateSnippet)

Source from the content-addressed store, hash-verified

146}
147
148function getMaxPlaceholderIndex(parsedSnippet: TextmateSnippet) {
149 var placeholderIndex = 0;
150 parsedSnippet.walk((candidate) => {
151 if (candidate instanceof Placeholder) {
152 placeholderIndex = Math.max(placeholderIndex, candidate.index);
153 }
154 return true;
155 });
156 return placeholderIndex;
157}
158
159function parseSnippetLocation(snippetLocation: string): [string, string] {
160 const [snippetName, placeholderName] = snippetLocation.split(".");

Callers 1

Calls 1

walkMethod · 0.65

Tested by

no test coverage detected