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
9 changes: 9 additions & 0 deletions src/graph_sitter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""
Graph-Sitter with Serena LSP Integration

This package provides comprehensive graph-sitter functionality with
advanced Serena LSP integration for error analysis and code intelligence.
"""

__version__ = "0.1.0"
__all__ = []

Check failure on line 9 in src/graph_sitter/__init__.py

View workflow job for this annotation

GitHub Actions / mypy

error: Need type annotation for "__all__" (hint: "__all__: list[<type>] = ...") [var-annotated]
3 changes: 3 additions & 0 deletions src/graph_sitter/codebase/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Graph-Sitter Codebase Analysis"""

__all__ = []

Check failure on line 3 in src/graph_sitter/codebase/__init__.py

View workflow job for this annotation

GitHub Actions / mypy

error: Need type annotation for "__all__" (hint: "__all__: list[<type>] = ...") [var-annotated]
70 changes: 70 additions & 0 deletions src/graph_sitter/codebase/codebase_analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"""
Graph-Sitter Codebase Analysis Functions

This module provides analysis functions for graph-sitter codebases.
"""

from typing import Dict, Any, Optional


def get_codebase_summary(codebase) -> Dict[str, Any]:
"""Get a summary of the codebase."""
return {
'total_files': 0,
'total_lines': 0,
'languages': [],
'summary': 'Codebase analysis not yet implemented'
}


def get_file_summary(file_path: str) -> Dict[str, Any]:
"""Get a summary of a specific file."""
return {
'file_path': file_path,
'lines': 0,
'functions': 0,
'classes': 0,
'summary': 'File analysis not yet implemented'
}


def get_class_summary(class_name: str, file_path: Optional[str] = None) -> Dict[str, Any]:
"""Get a summary of a specific class."""
return {
'class_name': class_name,
'file_path': file_path,
'methods': 0,
'properties': 0,
'summary': 'Class analysis not yet implemented'
}


def get_function_summary(function_name: str, file_path: Optional[str] = None) -> Dict[str, Any]:
"""Get a summary of a specific function."""
return {
'function_name': function_name,
'file_path': file_path,
'parameters': 0,
'complexity': 0,
'summary': 'Function analysis not yet implemented'
}


def get_symbol_summary(symbol_name: str, file_path: Optional[str] = None) -> Dict[str, Any]:
"""Get a summary of a specific symbol."""
return {
'symbol_name': symbol_name,
'file_path': file_path,
'type': 'unknown',
'references': 0,
'summary': 'Symbol analysis not yet implemented'
}


__all__ = [
"get_codebase_summary",
"get_file_summary",
"get_class_summary",
"get_function_summary",
"get_symbol_summary",
]
3 changes: 3 additions & 0 deletions src/graph_sitter/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Graph-Sitter Core Module"""

__all__ = []

Check failure on line 3 in src/graph_sitter/core/__init__.py

View workflow job for this annotation

GitHub Actions / mypy

error: Need type annotation for "__all__" (hint: "__all__: list[<type>] = ...") [var-annotated]
56 changes: 56 additions & 0 deletions src/graph_sitter/core/codebase.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""
Graph-Sitter Core Codebase Class

This module provides the core Codebase class for graph-sitter.
"""

from typing import Any, Dict, List, Optional
from pathlib import Path


class Codebase:
"""
Core Codebase class for graph-sitter.

This is a placeholder implementation that will be replaced
with the actual graph-sitter codebase functionality.
"""

def __init__(self, path: str):
self.path = Path(path)
self.files: List[Any] = []
self.functions: List[Any] = []
self.classes: List[Any] = []
self.imports: List[Any] = []

def analyze(self) -> Dict[str, Any]:
"""Analyze the codebase."""
return {
'path': str(self.path),
'files': len(self.files),
'functions': len(self.functions),
'classes': len(self.classes),
'imports': len(self.imports),
'status': 'Codebase analysis not yet implemented'
}

def get_file(self, file_path: str) -> Optional[Any]:
"""Get a specific file from the codebase."""
# Placeholder implementation
return None

def get_function(self, function_name: str) -> Optional[Any]:
"""Get a specific function from the codebase."""
# Placeholder implementation
return None

def get_class(self, class_name: str) -> Optional[Any]:
"""Get a specific class from the codebase."""
# Placeholder implementation
return None

def __repr__(self) -> str:
return f"Codebase(path='{self.path}')"


__all__ = ["Codebase"]
47 changes: 47 additions & 0 deletions src/graph_sitter/core/errors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
Core Error Analysis Module

This module imports all Serena analysis features and provides unified access
to comprehensive error analysis capabilities for graph-sitter.
"""

# Import all serena analysis features
from ..extensions.lsp.serena_analysis import *

# Import graph-sitter core functions
from graph_sitter.core.codebase import Codebase
from graph_sitter.codebase.codebase_analysis import (
get_codebase_summary,
get_file_summary,
get_class_summary,
get_function_summary,
get_symbol_summary
)

__all__ = [
# Re-export all serena analysis features
"ErrorType",
"ErrorCategory",
"ErrorLocation",
"RuntimeContext",
"ErrorInfo",
"ComprehensiveErrorList",
"RuntimeErrorCollector",
"SerenaLSPBridge",
"TransactionAwareLSPManager",
"GitHubRepositoryAnalyzer",
"AnalysisResult",
"RepositoryInfo",
"EnhancedSerenaIntegration",
"analyze_github_repository",
"get_repository_error_summary",
"analyze_multiple_repositories",

# Graph-sitter core functions
"Codebase",
"get_codebase_summary",
"get_file_summary",
"get_class_summary",
"get_function_summary",
"get_symbol_summary",
]
3 changes: 3 additions & 0 deletions src/graph_sitter/extensions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Graph-Sitter Extensions"""

__all__ = []

Check failure on line 3 in src/graph_sitter/extensions/__init__.py

View workflow job for this annotation

GitHub Actions / mypy

error: Need type annotation for "__all__" (hint: "__all__: list[<type>] = ...") [var-annotated]
23 changes: 23 additions & 0 deletions src/graph_sitter/extensions/lsp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
LSP Extensions for Graph-Sitter

This package provides Language Server Protocol (LSP) integration and
comprehensive error analysis capabilities for graph-sitter.
"""

# Import from serena_analysis to make functions available at package level
try:
from .serena_analysis import (
analyze_github_repository,
get_repository_error_summary,
analyze_multiple_repositories,
)

__all__ = [
"analyze_github_repository",
"get_repository_error_summary",
"analyze_multiple_repositories",
]
except ImportError:
# Graceful fallback if serena dependencies are not available
__all__ = []
Loading
Loading