Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ codewiki generate --github-pages --create-branch

## What is CodeWiki?

CodeWiki is an open-source framework for **automated repository-level documentation** across seven programming languages. It generates holistic, architecture-aware documentation that captures not only individual functions but also their cross-file, cross-module, and system-level interactions.
CodeWiki is an open-source framework for **automated repository-level documentation** across eight programming languages. It generates holistic, architecture-aware documentation that captures not only individual functions but also their cross-file, cross-module, and system-level interactions.

### Key Innovations

Expand All @@ -88,7 +88,7 @@ CodeWiki is an open-source framework for **automated repository-level documentat

### Supported Languages

**🐍 Python** • **☕ Java** • **🟨 JavaScript** • **🔷 TypeScript** • **⚙️ C** • **🔧 C++** • **🪟 C#**
**🐍 Python** • **☕ Java** • **🟨 JavaScript** • **🔷 TypeScript** • **⚙️ C** • **🔧 C++** • **🪟 C#** • **🎯 Kotlin**

---

Expand Down
2 changes: 2 additions & 0 deletions codewiki/cli/utils/repo_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
'.php', # PHP
'.phtml', # PHP templates
'.inc', # PHP includes
'.kt', # Kotlin
'.kts', # Kotlin Scripts
}


Expand Down
1 change: 1 addition & 0 deletions codewiki/cli/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def detect_supported_languages(directory: Path) -> List[Tuple[str, int]]:
'C++': ['.cpp', '.hpp', '.cc', '.hh', '.cxx', '.hxx'],
'C#': ['.cs'],
'PHP': ['.php', '.phtml', '.inc'],
'Kotlin': ['.kt', '.kts'],
}

# Directories to exclude from counting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def _filter_supported_languages(self, code_files: List[Dict]) -> List[Dict]:
"php",
"go",
"rust",
"kotlin",
}

return [
Expand All @@ -320,7 +321,7 @@ def _filter_supported_languages(self, code_files: List[Dict]) -> List[Dict]:

def _get_supported_languages(self) -> List[str]:
"""Get list of currently supported languages for analysis."""
return ["python", "javascript", "typescript", "java", "csharp", "c", "cpp", "php"]
return ["python", "javascript", "typescript", "java", "csharp", "c", "cpp", "php", "kotlin"]

def _cleanup_repository(self, temp_dir: str):
"""Clean up cloned repository."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def _analyze_code_file(self, repo_dir: str, file_info: Dict):
self._analyze_typescript_file(file_path, content, repo_dir)
elif language == "java":
self._analyze_java_file(file_path, content, repo_dir)
elif language == "kotlin":
self._analyze_kotlin_file(file_path, content, repo_dir)
elif language == "csharp":
self._analyze_csharp_file(file_path, content, repo_dir)
elif language == "c":
Expand Down Expand Up @@ -280,6 +282,27 @@ def _analyze_java_file(self, file_path: str, content: str, repo_dir: str):
except Exception as e:
logger.error(f"Failed to analyze Java file {file_path}: {e}", exc_info=True)

def _analyze_kotlin_file(self, file_path: str, content: str, repo_dir: str):
"""
Analyze Kotlin file using tree-sitter based analyzer.

Args:
file_path: Relative path to the Kotlin file
content: File content string
repo_dir: Repository base directory
"""
from codewiki.src.be.dependency_analyzer.analyzers.kotlin import analyze_kotlin_file

try:
functions, relationships = analyze_kotlin_file(file_path, content, repo_path=repo_dir)
for func in functions:
func_id = func.id if func.id else f"{file_path}:{func.name}"
self.functions[func_id] = func

self.call_relationships.extend(relationships)
except Exception as e:
logger.error(f"Failed to analyze Kotlin file {file_path}: {e}", exc_info=True)

def _analyze_csharp_file(self, file_path: str, content: str, repo_dir: str):
"""
Analyze C# file using tree-sitter based analyzer.
Expand Down Expand Up @@ -408,6 +431,8 @@ def _generate_visualization_data(self) -> Dict:
node_classes.append("lang-c")
elif file_ext in [".cpp", ".cc", ".cxx", ".hpp", ".hxx"]:
node_classes.append("lang-cpp")
elif file_ext in [".kt", ".kts"]:
node_classes.append("lang-kotlin")
elif file_ext in [".php", ".phtml", ".inc"]:
node_classes.append("lang-php")

Expand Down
Loading