refactor: optimize ;run command and expand its judge0 language alias map#34
Conversation
Summary by BeetleThis PR refactors the 📁 File Changes Summary (Consolidated across all commits):
Total Changes: 1 file changed, +85 additions, -42 deletions 🗺️ Walkthrough:graph TD
A["User invokes ;run command"] --> B["Parse code block and language"]
B --> C["Clean input: lowercase, remove special chars"]
C --> D{"Check ALIAS_MAP"}
D -->|"Found"| E["Map to canonical name"]
D -->|"Not found"| F["Use input as-is"]
E --> G["Search Judge0 languages"]
F --> G
G --> H{"Exact match?"}
H -->|"Yes"| I["Return language ID"]
H -->|"No"| J["Fuzzy match search"]
J --> K{"Fuzzy match found?"}
K -->|"Yes"| I
K -->|"No"| L["Return null"]
I --> M["Execute code via Judge0 API"]
M --> N["Display results with embed"]
CANON["CANONICAL_GROUPS: 40+ languages Each with multiple aliases Example: python → py, py2, py3, pyml"]
D -.-> CANON
🎯 Key Changes:
📊 Impact Assessment:
⚙️ SettingsSeverity Threshold: 📖 User Guide
|
;run command and expand its judge0 language alia…;run command and expand its judge0 language alias map
|
✅ You're good to merge this PR! No issues found. Great job! Settings⚙️ SettingsSeverity Threshold: 📖 User Guide
|
|
Note Linting checks passed successfully 🎉 All formatting and code quality checks are clean. You're good to merge 🚀 |
…s map