MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / stripCommentsForRegex

Function stripCommentsForRegex

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

Source from the content-addressed store, hash-verified

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

Callers 15

arkuiStateBuildEdgesFunction · 0.90
arkuiEmitterEdgesFunction · 0.90
arkuiRouterEdgesFunction · 0.90
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

Calls 7

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

Tested by

no test coverage detected