MCPcopy
hub / github.com/colbymchenry/codegraph / stripCommentsForRegex

Function stripCommentsForRegex

src/resolution/strip-comments.ts:40–63  ·  view source on GitHub ↗
(content: string, lang: CommentLang)

Source from the content-addressed store, hash-verified

38 | 'cpp';
39
40export function stripCommentsForRegex(content: string, lang: CommentLang): string {
41 switch (lang) {
42 case 'python':
43 return stripPython(content);
44 case 'ruby':
45 return stripRuby(content);
46 case 'rust':
47 return stripRust(content);
48 case 'php':
49 return stripPhp(content);
50 case 'go':
51 return stripGo(content);
52 case 'javascript':
53 case 'typescript':
54 case 'java':
55 case 'csharp':
56 case 'swift':
57 case 'c':
58 case 'cpp':
59 return stripCStyle(content, /* allowSingleQuoteStrings */ lang === 'javascript' || lang === 'typescript');
60 default:
61 return content;
62 }
63}
64
65/**
66 * Replace every char in a slice with spaces, but keep newlines so line

Callers 15

ginMiddlewareChainEdgesFunction · 0.90
reduxThunkEdgesFunction · 0.90
objectRegistryEdgesFunction · 0.90
piniaStoreEdgesFunction · 0.90
vuexDispatchEdgesFunction · 0.90
celeryDispatchEdgesFunction · 0.90
springEventEdgesFunction · 0.90
mediatrDispatchEdgesFunction · 0.90
sidekiqDispatchEdgesFunction · 0.90
laravelEventEdgesFunction · 0.90
srcFunction · 0.90
extractFunction · 0.90

Calls 6

stripPythonFunction · 0.85
stripRubyFunction · 0.85
stripRustFunction · 0.85
stripPhpFunction · 0.85
stripGoFunction · 0.85
stripCStyleFunction · 0.85

Tested by

no test coverage detected