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

Function commentLang

src/mcp/dynamic-boundaries.ts:189–220  ·  view source on GitHub ↗

Map a Node.language to the comment-stripper's language set.

(language: string)

Source from the content-addressed store, hash-verified

187
188/** Map a Node.language to the comment-stripper's language set. */
189function commentLang(language: string): CommentLang | null {
190 switch (language) {
191 case 'python': return 'python';
192 case 'ruby': return 'ruby';
193 case 'rust': return 'rust';
194 case 'php': return 'php';
195 case 'go': return 'go';
196 case 'javascript':
197 case 'jsx':
198 return 'javascript';
199 case 'typescript':
200 case 'tsx':
201 case 'vue':
202 case 'svelte':
203 case 'astro':
204 case 'arkts':
205 return 'typescript';
206 case 'java':
207 case 'kotlin':
208 case 'scala':
209 case 'dart':
210 return 'java';
211 case 'csharp': return 'csharp';
212 case 'swift': return 'swift';
213 case 'c':
214 case 'cpp':
215 case 'objc':
216 case 'objcpp':
217 return 'java'; // C-style comments + double-quoted strings — close enough for blanking
218 default: return null;
219 }
220}
221
222const MAX_MATCHES_PER_BODY = 3;
223const MAX_BODY_CHARS = 60_000; // a god-function tail is still scannable; beyond this, truncate

Callers 1

scanDynamicDispatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected