MCPcopy Create free account
hub / github.com/codeaashu/claude-code / getLanguageFromPath

Function getLanguageFromPath

web/components/tools/SyntaxHighlight.tsx:86–91  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

84};
85
86export function getLanguageFromPath(filePath: string): string {
87 const name = filePath.split("/").pop() ?? "";
88 if (name.toLowerCase() === "dockerfile") return "dockerfile";
89 const ext = name.split(".").pop()?.toLowerCase() ?? "";
90 return EXT_TO_LANG[ext] ?? "text";
91}
92
93interface UseHighlightedCodeOptions {
94 code: string;

Callers 3

ToolFileReadFunction · 0.90
ToolFileEditFunction · 0.90
ToolFileWriteFunction · 0.90

Calls 1

popMethod · 0.80

Tested by

no test coverage detected