Something went wrong. Try again.
Fork of backnotprop/plannotator with reduced surface area
Something went wrong. Try again.
123456789101112131415/** Map file extension to highlight.js language name */export function detectLanguage(filePath: string): string | undefined { const ext = filePath.split('.').pop()?.toLowerCase(); const map: Record<string, string> = { ts: 'typescript', tsx: 'typescript', js: 'javascript', jsx: 'javascript', py: 'python', rb: 'ruby', rs: 'rust', go: 'go', java: 'java', kt: 'kotlin', swift: 'swift', cs: 'csharp', cpp: 'cpp', c: 'c', h: 'c', css: 'css', scss: 'scss', less: 'less', html: 'html', xml: 'xml', json: 'json', yaml: 'yaml', yml: 'yaml', md: 'markdown', sql: 'sql', sh: 'bash', bash: 'bash', zsh: 'bash', dockerfile: 'dockerfile', toml: 'toml', lua: 'lua', php: 'php', }; return ext ? map[ext] : undefined;}