tree-sitter-analyzer 0.2.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tree-sitter-analyzer might be problematic. Click here for more details.

Files changed (78) hide show
  1. tree_sitter_analyzer/__init__.py +134 -121
  2. tree_sitter_analyzer/__main__.py +11 -12
  3. tree_sitter_analyzer/api.py +533 -539
  4. tree_sitter_analyzer/cli/__init__.py +39 -39
  5. tree_sitter_analyzer/cli/__main__.py +12 -13
  6. tree_sitter_analyzer/cli/commands/__init__.py +26 -27
  7. tree_sitter_analyzer/cli/commands/advanced_command.py +88 -88
  8. tree_sitter_analyzer/cli/commands/base_command.py +160 -155
  9. tree_sitter_analyzer/cli/commands/default_command.py +18 -19
  10. tree_sitter_analyzer/cli/commands/partial_read_command.py +141 -133
  11. tree_sitter_analyzer/cli/commands/query_command.py +81 -82
  12. tree_sitter_analyzer/cli/commands/structure_command.py +138 -121
  13. tree_sitter_analyzer/cli/commands/summary_command.py +101 -93
  14. tree_sitter_analyzer/cli/commands/table_command.py +235 -233
  15. tree_sitter_analyzer/cli/info_commands.py +120 -121
  16. tree_sitter_analyzer/cli_main.py +278 -276
  17. tree_sitter_analyzer/core/__init__.py +15 -20
  18. tree_sitter_analyzer/core/analysis_engine.py +555 -574
  19. tree_sitter_analyzer/core/cache_service.py +320 -330
  20. tree_sitter_analyzer/core/engine.py +559 -560
  21. tree_sitter_analyzer/core/parser.py +293 -288
  22. tree_sitter_analyzer/core/query.py +502 -502
  23. tree_sitter_analyzer/encoding_utils.py +456 -460
  24. tree_sitter_analyzer/exceptions.py +337 -340
  25. tree_sitter_analyzer/file_handler.py +210 -222
  26. tree_sitter_analyzer/formatters/__init__.py +1 -1
  27. tree_sitter_analyzer/formatters/base_formatter.py +167 -168
  28. tree_sitter_analyzer/formatters/formatter_factory.py +78 -74
  29. tree_sitter_analyzer/formatters/java_formatter.py +291 -270
  30. tree_sitter_analyzer/formatters/python_formatter.py +259 -235
  31. tree_sitter_analyzer/interfaces/__init__.py +9 -10
  32. tree_sitter_analyzer/interfaces/cli.py +528 -557
  33. tree_sitter_analyzer/interfaces/cli_adapter.py +343 -319
  34. tree_sitter_analyzer/interfaces/mcp_adapter.py +206 -170
  35. tree_sitter_analyzer/interfaces/mcp_server.py +405 -416
  36. tree_sitter_analyzer/java_analyzer.py +187 -219
  37. tree_sitter_analyzer/language_detector.py +398 -400
  38. tree_sitter_analyzer/language_loader.py +224 -228
  39. tree_sitter_analyzer/languages/__init__.py +10 -11
  40. tree_sitter_analyzer/languages/java_plugin.py +1174 -1113
  41. tree_sitter_analyzer/{plugins → languages}/javascript_plugin.py +446 -439
  42. tree_sitter_analyzer/languages/python_plugin.py +747 -712
  43. tree_sitter_analyzer/mcp/__init__.py +31 -32
  44. tree_sitter_analyzer/mcp/resources/__init__.py +44 -47
  45. tree_sitter_analyzer/mcp/resources/code_file_resource.py +209 -213
  46. tree_sitter_analyzer/mcp/resources/project_stats_resource.py +555 -550
  47. tree_sitter_analyzer/mcp/server.py +333 -345
  48. tree_sitter_analyzer/mcp/tools/__init__.py +30 -31
  49. tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +654 -557
  50. tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +247 -245
  51. tree_sitter_analyzer/mcp/tools/base_tool.py +54 -55
  52. tree_sitter_analyzer/mcp/tools/read_partial_tool.py +300 -302
  53. tree_sitter_analyzer/mcp/tools/table_format_tool.py +362 -359
  54. tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +543 -476
  55. tree_sitter_analyzer/mcp/utils/__init__.py +107 -106
  56. tree_sitter_analyzer/mcp/utils/error_handler.py +549 -549
  57. tree_sitter_analyzer/models.py +470 -481
  58. tree_sitter_analyzer/output_manager.py +255 -264
  59. tree_sitter_analyzer/plugins/__init__.py +280 -334
  60. tree_sitter_analyzer/plugins/base.py +496 -446
  61. tree_sitter_analyzer/plugins/manager.py +379 -355
  62. tree_sitter_analyzer/queries/__init__.py +26 -27
  63. tree_sitter_analyzer/queries/java.py +391 -394
  64. tree_sitter_analyzer/queries/javascript.py +148 -149
  65. tree_sitter_analyzer/queries/python.py +285 -286
  66. tree_sitter_analyzer/queries/typescript.py +229 -230
  67. tree_sitter_analyzer/query_loader.py +257 -260
  68. tree_sitter_analyzer/table_formatter.py +471 -448
  69. tree_sitter_analyzer/utils.py +277 -277
  70. {tree_sitter_analyzer-0.2.0.dist-info → tree_sitter_analyzer-0.4.0.dist-info}/METADATA +23 -8
  71. tree_sitter_analyzer-0.4.0.dist-info/RECORD +73 -0
  72. {tree_sitter_analyzer-0.2.0.dist-info → tree_sitter_analyzer-0.4.0.dist-info}/entry_points.txt +2 -1
  73. tree_sitter_analyzer/plugins/java_plugin.py +0 -625
  74. tree_sitter_analyzer/plugins/plugin_loader.py +0 -83
  75. tree_sitter_analyzer/plugins/python_plugin.py +0 -598
  76. tree_sitter_analyzer/plugins/registry.py +0 -366
  77. tree_sitter_analyzer-0.2.0.dist-info/RECORD +0 -77
  78. {tree_sitter_analyzer-0.2.0.dist-info → tree_sitter_analyzer-0.4.0.dist-info}/WHEEL +0 -0
@@ -1,106 +1,107 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- """
4
- MCP Utils Module
5
-
6
- This module provides utility functions and classes for the MCP server
7
- including error handling and other utilities.
8
-
9
- Note: Cache and performance monitoring functionality has been moved to
10
- the unified core services for better architecture.
11
- """
12
-
13
- from typing import Any, Dict
14
-
15
- # Module metadata
16
- __version__ = "2.0.0"
17
- __author__ = "Tree-Sitter Analyzer Team"
18
-
19
- # MCP Utils capabilities
20
- MCP_UTILS_CAPABILITIES = {
21
- "version": "2.0.0",
22
- "features": [
23
- "Comprehensive Error Handling",
24
- "Unified Core Services Integration",
25
- ],
26
- "deprecated_features": [
27
- "LRU Cache with TTL (moved to core.cache_service)",
28
- "Performance Monitoring (moved to core.analysis_engine)",
29
- ],
30
- }
31
-
32
- # Export main utility classes and functions
33
- from .error_handler import (
34
- AnalysisError,
35
- ErrorCategory,
36
- ErrorHandler,
37
- ErrorSeverity,
38
- FileAccessError,
39
- MCPError,
40
- ParsingError,
41
- ResourceError,
42
- ValidationError,
43
- get_error_handler,
44
- handle_mcp_errors,
45
- )
46
-
47
- # Import unified services for backward compatibility
48
- try:
49
- from ...core.cache_service import CacheService as UnifiedCacheService
50
- from ...core.analysis_engine import UnifiedAnalysisEngine
51
-
52
- # Provide backward compatibility aliases
53
- class BackwardCompatibleCacheManager:
54
- """Backward compatible cache manager wrapper"""
55
- def __init__(self):
56
- self._cache_service = UnifiedCacheService()
57
-
58
- def clear_all_caches(self):
59
- """Backward compatibility: clear all caches"""
60
- return self._cache_service.clear()
61
-
62
- def get_cache_stats(self):
63
- """Backward compatibility: get cache statistics"""
64
- return self._cache_service.get_stats()
65
-
66
- def __getattr__(self, name):
67
- """Delegate other methods to the cache service"""
68
- return getattr(self._cache_service, name)
69
-
70
- def get_cache_manager():
71
- """Backward compatibility: Get unified cache service"""
72
- return BackwardCompatibleCacheManager()
73
-
74
- def get_performance_monitor():
75
- """Backward compatibility: Get unified analysis engine for performance monitoring"""
76
- return UnifiedAnalysisEngine()
77
-
78
- except ImportError:
79
- # Fallback if core services are not available
80
- def get_cache_manager():
81
- """Fallback cache manager"""
82
- return None
83
-
84
- def get_performance_monitor():
85
- """Fallback performance monitor"""
86
- return None
87
-
88
- __all__ = [
89
- # Error handling
90
- "ErrorHandler",
91
- "MCPError",
92
- "FileAccessError",
93
- "ParsingError",
94
- "AnalysisError",
95
- "ValidationError",
96
- "ResourceError",
97
- "ErrorSeverity",
98
- "ErrorCategory",
99
- "handle_mcp_errors",
100
- "get_error_handler",
101
- # Backward compatibility
102
- "get_cache_manager",
103
- "get_performance_monitor",
104
- # Module metadata
105
- "MCP_UTILS_CAPABILITIES",
106
- ]
1
+ #!/usr/bin/env python3
2
+ """
3
+ MCP Utils Module
4
+
5
+ This module provides utility functions and classes for the MCP server
6
+ including error handling and other utilities.
7
+
8
+ Note: Cache and performance monitoring functionality has been moved to
9
+ the unified core services for better architecture.
10
+ """
11
+
12
+ from typing import Any
13
+
14
+ # Export main utility classes and functions
15
+ from .error_handler import (
16
+ AnalysisError,
17
+ ErrorCategory,
18
+ ErrorHandler,
19
+ ErrorSeverity,
20
+ FileAccessError,
21
+ MCPError,
22
+ ParsingError,
23
+ ResourceError,
24
+ ValidationError,
25
+ get_error_handler,
26
+ handle_mcp_errors,
27
+ )
28
+
29
+ # Module metadata
30
+ __version__ = "2.0.0"
31
+ __author__ = "Tree-Sitter Analyzer Team"
32
+
33
+ # MCP Utils capabilities
34
+ MCP_UTILS_CAPABILITIES = {
35
+ "version": "2.0.0",
36
+ "features": [
37
+ "Comprehensive Error Handling",
38
+ "Unified Core Services Integration",
39
+ ],
40
+ "deprecated_features": [
41
+ "LRU Cache with TTL (moved to core.cache_service)",
42
+ "Performance Monitoring (moved to core.analysis_engine)",
43
+ ],
44
+ }
45
+
46
+ # Import unified services for backward compatibility
47
+ try:
48
+ from ...core.analysis_engine import UnifiedAnalysisEngine
49
+ from ...core.cache_service import CacheService as UnifiedCacheService
50
+
51
+ # Provide backward compatibility aliases
52
+ class BackwardCompatibleCacheManager:
53
+ """Backward compatible cache manager wrapper"""
54
+
55
+ def __init__(self) -> None:
56
+ self._cache_service = UnifiedCacheService()
57
+
58
+ def clear_all_caches(self) -> None:
59
+ """Backward compatibility: clear all caches"""
60
+ return self._cache_service.clear()
61
+
62
+ def get_cache_stats(self) -> dict[str, Any]:
63
+ """Backward compatibility: get cache statistics"""
64
+ return self._cache_service.get_stats()
65
+
66
+ def __getattr__(self, name: str) -> Any:
67
+ """Delegate other methods to the cache service"""
68
+ return getattr(self._cache_service, name)
69
+
70
+ def get_cache_manager() -> Any:
71
+ """Backward compatibility: Get unified cache service"""
72
+ return BackwardCompatibleCacheManager()
73
+
74
+ def get_performance_monitor() -> Any:
75
+ """Backward compatibility: Get unified analysis engine for performance monitoring"""
76
+ return UnifiedAnalysisEngine()
77
+
78
+ except ImportError:
79
+ # Fallback if core services are not available
80
+ def get_cache_manager() -> Any:
81
+ """Fallback cache manager"""
82
+ return None
83
+
84
+ def get_performance_monitor() -> Any:
85
+ """Fallback performance monitor"""
86
+ return None
87
+
88
+
89
+ __all__ = [
90
+ # Error handling
91
+ "ErrorHandler",
92
+ "MCPError",
93
+ "FileAccessError",
94
+ "ParsingError",
95
+ "AnalysisError",
96
+ "ValidationError",
97
+ "ResourceError",
98
+ "ErrorSeverity",
99
+ "ErrorCategory",
100
+ "handle_mcp_errors",
101
+ "get_error_handler",
102
+ # Backward compatibility
103
+ "get_cache_manager",
104
+ "get_performance_monitor",
105
+ # Module metadata
106
+ "MCP_UTILS_CAPABILITIES",
107
+ ]