(filePath: string)
| 226 | } |
| 227 | |
| 228 | export function getLanguageOfFile(filePath: string): string { |
| 229 | const extension = filePath.split(".").pop()?.toLowerCase(); |
| 230 | const languages: Record<string, string> = { |
| 231 | js: "javascript", |
| 232 | ts: "typescript", |
| 233 | tsx: "typescript", |
| 234 | jsx: "javascript", |
| 235 | py: "python", |
| 236 | html: "html", |
| 237 | css: "css", |
| 238 | json: "json", |
| 239 | md: "markdown", |
| 240 | sql: "sql", |
| 241 | sh: "shell", |
| 242 | yaml: "yaml", |
| 243 | yml: "yaml", |
| 244 | }; |
| 245 | return languages[extension || ""] || "plaintext"; |
| 246 | } |
| 247 | |
| 248 | export function getMonacoLanguage(language: string): string { |
| 249 | const map: Record<string, string> = { |
nothing calls this directly
no outgoing calls
no test coverage detected