MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / isDefinitionLine

Function isDefinitionLine

src/tools/semantic-identifiers.ts:126–133  ·  view source on GitHub ↗
(line: string, symbolName: string)

Source from the content-addressed store, hash-verified

124}
125
126function isDefinitionLine(line: string, symbolName: string): boolean {
127 const escaped = escapeRegex(symbolName);
128 const patterns = [
129 new RegExp(`(?:function|class|enum|interface|struct|type|trait|fn|def|func)\\s+${escaped}`),
130 new RegExp(`(?:const|let|var|pub|export)\\s+(?:async\\s+)?(?:function\\s+)?${escaped}`),
131 ];
132 return patterns.some((pattern) => pattern.test(line));
133}
134
135function normalizeKinds(kinds?: string[]): Set<string> | null {
136 if (!kinds || kinds.length === 0) return null;

Callers 1

rankCallSitesFunction · 0.70

Calls 1

escapeRegexFunction · 0.70

Tested by

no test coverage detected