bolt.diy/app/utils/getLanguageFromExtension.ts
Toddyclipsgg ab6f5328b4 feat: Add Diff View and File History Tracking
- Implemented a new Diff View in the Workbench to visualize file changes
- Added file history tracking with detailed change information
- Enhanced FileTree and FileModifiedDropdown to show line additions and deletions
- Integrated file history saving and retrieval in ActionRunner
- Updated Workbench view types to include 'diff' option
- Added support for inline and side-by-side diff view modes
2025-02-23 07:55:38 -03:00

24 lines
479 B
TypeScript

export const getLanguageFromExtension = (ext: string): string => {
const map: Record<string, string> = {
js: "javascript",
jsx: "jsx",
ts: "typescript",
tsx: "tsx",
json: "json",
html: "html",
css: "css",
py: "python",
java: "java",
rb: "ruby",
cpp: "cpp",
c: "c",
cs: "csharp",
go: "go",
rs: "rust",
php: "php",
swift: "swift",
md: "plaintext",
sh: "bash",
};
return map[ext] || "typescript";
};