Commit 7adf253
alpsla
feat(snippets): add dynamic language detection for code blocks
✅ Tasks #1 & #2 Complete: Code Snippets + Fix Suggestions
Changes:
- Added getLanguageFromFile() helper method (lines 1641-1665)
- Supports 20+ file extensions (Java, Python, JS/TS, Go, Rust, etc.)
- Returns appropriate language for syntax highlighting
- Updated code snippet display (line 1415)
- Changed from hardcoded 'java' to dynamic language detection
- Proper syntax highlighting for all supported languages
- Updated fix suggestion display (line 1451)
- Changed from hardcoded 'java' to dynamic language detection
- Corrected code shows in proper language syntax
Existing Features (Already Implemented):
- ✅ Code snippets with file location (lines 1402-1419)
- ✅ Fix suggestions with diff format (lines 1421-1463)
- ✅ Before/After comparison with +/- diff syntax
- ✅ Best practices recommendations
- ✅ Clean-up of internal bug tracker references
Language Support:
- Java, Scala, Kotlin, Gradle
- Python
- JavaScript, JSX, TypeScript, TSX
- Go, Rust, Ruby, PHP
- C, C++, C#, Swift
- YAML, JSON, XML, SQL, Bash
Files Modified:
- v9-grouped-report-formatter.ts:
- Lines 1415, 1451: Dynamic language detection
- Lines 1638-1665: getLanguageFromFile() method
Time: ~15 minutes (code was already there, just needed helper method)
Next: Copy remaining report sections (Business Impact, Education, PR Comment, Metadata)1 parent e6f7398 commit 7adf253
1 file changed
Lines changed: 33 additions & 2 deletions
Lines changed: 33 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1412 | 1412 | | |
1413 | 1413 | | |
1414 | 1414 | | |
1415 | | - | |
| 1415 | + | |
| 1416 | + | |
1416 | 1417 | | |
1417 | 1418 | | |
1418 | 1419 | | |
| |||
1447 | 1448 | | |
1448 | 1449 | | |
1449 | 1450 | | |
1450 | | - | |
| 1451 | + | |
| 1452 | + | |
1451 | 1453 | | |
1452 | 1454 | | |
1453 | 1455 | | |
| |||
1633 | 1635 | | |
1634 | 1636 | | |
1635 | 1637 | | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
1636 | 1667 | | |
1637 | 1668 | | |
1638 | 1669 | | |
| |||
0 commit comments