feat: Add GDScript (.gd) language support for Godot projects
**Problem:** Godot projects with 267 GDScript files were only analyzing 13 C# files, missing 95%+ of the codebase. **Changes:** 1. Added `.gd` → "GDScript" to LANGUAGE_EXTENSIONS mapping 2. Added GDScript support to code_analyzer.py (uses Python AST parser) 3. Added GDScript support to dependency_analyzer.py (uses Python import extraction) **Known Limitation:** GDScript has syntax differences from Python (extends, @export, signals, etc.) so Python AST parser may fail on some files. Future enhancement needed: - Create GDScript-specific regex-based parser - Handle Godot-specific keywords (extends, signal, @export, preload, etc.) **Test Results:** Before: 13 files analyzed (C# only) After: 280 files detected (13 C# + 267 GDScript) Status: GDScript files detected but analysis may fail due to syntax differences Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -105,6 +105,9 @@ class CodeAnalyzer:
|
||||
try:
|
||||
if language == "Python":
|
||||
return self._analyze_python(content, file_path)
|
||||
elif language == "GDScript":
|
||||
# GDScript is Python-like, use Python analyzer
|
||||
return self._analyze_python(content, file_path)
|
||||
elif language in ["JavaScript", "TypeScript"]:
|
||||
return self._analyze_javascript(content, file_path)
|
||||
elif language in ["C", "C++"]:
|
||||
|
||||
@@ -68,6 +68,7 @@ LANGUAGE_EXTENSIONS = {
|
||||
".hxx": "C++",
|
||||
".c": "C",
|
||||
".cs": "C#",
|
||||
".gd": "GDScript", # Godot scripting language
|
||||
".go": "Go",
|
||||
".rs": "Rust",
|
||||
".java": "Java",
|
||||
|
||||
@@ -108,6 +108,9 @@ class DependencyAnalyzer:
|
||||
"""
|
||||
if language == "Python":
|
||||
deps = self._extract_python_imports(content, file_path)
|
||||
elif language == "GDScript":
|
||||
# GDScript is Python-like, uses similar import syntax
|
||||
deps = self._extract_python_imports(content, file_path)
|
||||
elif language in ("JavaScript", "TypeScript"):
|
||||
deps = self._extract_js_imports(content, file_path)
|
||||
elif language in ("C++", "C"):
|
||||
|
||||
Reference in New Issue
Block a user