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

Function stripCommentsForRegex

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

Source from the content-addressed store, hash-verified

85 | 'erlang';
86
87export function stripCommentsForRegex(content: string, lang: CommentLang): string {
88 switch (lang) {
89 case 'python':
90 return stripPython(content);
91 case 'ruby':
92 return stripRuby(content);
93 case 'rust':
94 return stripRust(content);
95 case 'erlang':
96 return stripErlang(content);
97 case 'php':
98 return stripPhp(content);
99 case 'go':
100 return stripGo(content);
101 case 'javascript':
102 case 'typescript':
103 case 'java':
104 case 'csharp':
105 case 'swift':
106 case 'c':
107 case 'cpp':
108 return stripCStyle(content, /* allowSingleQuoteStrings */ lang === 'javascript' || lang === 'typescript');
109 default:
110 return content;
111 }
112}
113
114/**
115 * Replace every char in a slice with spaces, but keep newlines so line

Callers 15

commonJsRequireRefsFunction · 0.90
extractImportMappingsFunction · 0.90
componentsInFunction · 0.90
hasBridgeEvidenceFunction · 0.90
pythonMemberLinesFunction · 0.90
isSealedModuleFunction · 0.90
javaFileScopeFunction · 0.90
isPythonLocallyBoundFunction · 0.90
kotlinReceiverTypesFunction · 0.90
kotlinBraceFramesFunction · 0.90
csharpNamespaceScopeFunction · 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