tree-sitter-analyzer 0.2.0__py3-none-any.whl → 0.3.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 +133 -121
  2. tree_sitter_analyzer/__main__.py +11 -12
  3. tree_sitter_analyzer/api.py +531 -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 +232 -233
  15. tree_sitter_analyzer/cli/info_commands.py +120 -121
  16. tree_sitter_analyzer/cli_main.py +277 -276
  17. tree_sitter_analyzer/core/__init__.py +15 -20
  18. tree_sitter_analyzer/core/analysis_engine.py +591 -574
  19. tree_sitter_analyzer/core/cache_service.py +320 -330
  20. tree_sitter_analyzer/core/engine.py +557 -560
  21. tree_sitter_analyzer/core/parser.py +293 -288
  22. tree_sitter_analyzer/core/query.py +494 -502
  23. tree_sitter_analyzer/encoding_utils.py +458 -460
  24. tree_sitter_analyzer/exceptions.py +337 -340
  25. tree_sitter_analyzer/file_handler.py +217 -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 +287 -270
  30. tree_sitter_analyzer/formatters/python_formatter.py +255 -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 +322 -319
  34. tree_sitter_analyzer/interfaces/mcp_adapter.py +180 -170
  35. tree_sitter_analyzer/interfaces/mcp_server.py +405 -416
  36. tree_sitter_analyzer/java_analyzer.py +218 -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 +1129 -1113
  41. tree_sitter_analyzer/languages/python_plugin.py +737 -712
  42. tree_sitter_analyzer/mcp/__init__.py +31 -32
  43. tree_sitter_analyzer/mcp/resources/__init__.py +44 -47
  44. tree_sitter_analyzer/mcp/resources/code_file_resource.py +212 -213
  45. tree_sitter_analyzer/mcp/resources/project_stats_resource.py +560 -550
  46. tree_sitter_analyzer/mcp/server.py +333 -345
  47. tree_sitter_analyzer/mcp/tools/__init__.py +30 -31
  48. tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +621 -557
  49. tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +242 -245
  50. tree_sitter_analyzer/mcp/tools/base_tool.py +54 -55
  51. tree_sitter_analyzer/mcp/tools/read_partial_tool.py +300 -302
  52. tree_sitter_analyzer/mcp/tools/table_format_tool.py +362 -359
  53. tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +543 -476
  54. tree_sitter_analyzer/mcp/utils/__init__.py +105 -106
  55. tree_sitter_analyzer/mcp/utils/error_handler.py +549 -549
  56. tree_sitter_analyzer/models.py +470 -481
  57. tree_sitter_analyzer/output_manager.py +261 -264
  58. tree_sitter_analyzer/plugins/__init__.py +333 -334
  59. tree_sitter_analyzer/plugins/base.py +477 -446
  60. tree_sitter_analyzer/plugins/java_plugin.py +608 -625
  61. tree_sitter_analyzer/plugins/javascript_plugin.py +446 -439
  62. tree_sitter_analyzer/plugins/manager.py +362 -355
  63. tree_sitter_analyzer/plugins/plugin_loader.py +85 -83
  64. tree_sitter_analyzer/plugins/python_plugin.py +606 -598
  65. tree_sitter_analyzer/plugins/registry.py +374 -366
  66. tree_sitter_analyzer/queries/__init__.py +26 -27
  67. tree_sitter_analyzer/queries/java.py +391 -394
  68. tree_sitter_analyzer/queries/javascript.py +148 -149
  69. tree_sitter_analyzer/queries/python.py +285 -286
  70. tree_sitter_analyzer/queries/typescript.py +229 -230
  71. tree_sitter_analyzer/query_loader.py +254 -260
  72. tree_sitter_analyzer/table_formatter.py +468 -448
  73. tree_sitter_analyzer/utils.py +277 -277
  74. {tree_sitter_analyzer-0.2.0.dist-info → tree_sitter_analyzer-0.3.0.dist-info}/METADATA +21 -6
  75. tree_sitter_analyzer-0.3.0.dist-info/RECORD +77 -0
  76. tree_sitter_analyzer-0.2.0.dist-info/RECORD +0 -77
  77. {tree_sitter_analyzer-0.2.0.dist-info → tree_sitter_analyzer-0.3.0.dist-info}/WHEEL +0 -0
  78. {tree_sitter_analyzer-0.2.0.dist-info → tree_sitter_analyzer-0.3.0.dist-info}/entry_points.txt +0 -0
@@ -1,106 +1,105 @@
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
+ # Export main utility classes and functions
13
+ from .error_handler import (
14
+ AnalysisError,
15
+ ErrorCategory,
16
+ ErrorHandler,
17
+ ErrorSeverity,
18
+ FileAccessError,
19
+ MCPError,
20
+ ParsingError,
21
+ ResourceError,
22
+ ValidationError,
23
+ get_error_handler,
24
+ handle_mcp_errors,
25
+ )
26
+
27
+ # Module metadata
28
+ __version__ = "2.0.0"
29
+ __author__ = "Tree-Sitter Analyzer Team"
30
+
31
+ # MCP Utils capabilities
32
+ MCP_UTILS_CAPABILITIES = {
33
+ "version": "2.0.0",
34
+ "features": [
35
+ "Comprehensive Error Handling",
36
+ "Unified Core Services Integration",
37
+ ],
38
+ "deprecated_features": [
39
+ "LRU Cache with TTL (moved to core.cache_service)",
40
+ "Performance Monitoring (moved to core.analysis_engine)",
41
+ ],
42
+ }
43
+
44
+ # Import unified services for backward compatibility
45
+ try:
46
+ from ...core.analysis_engine import UnifiedAnalysisEngine
47
+ from ...core.cache_service import CacheService as UnifiedCacheService
48
+
49
+ # Provide backward compatibility aliases
50
+ class BackwardCompatibleCacheManager:
51
+ """Backward compatible cache manager wrapper"""
52
+
53
+ def __init__(self):
54
+ self._cache_service = UnifiedCacheService()
55
+
56
+ def clear_all_caches(self):
57
+ """Backward compatibility: clear all caches"""
58
+ return self._cache_service.clear()
59
+
60
+ def get_cache_stats(self):
61
+ """Backward compatibility: get cache statistics"""
62
+ return self._cache_service.get_stats()
63
+
64
+ def __getattr__(self, name):
65
+ """Delegate other methods to the cache service"""
66
+ return getattr(self._cache_service, name)
67
+
68
+ def get_cache_manager():
69
+ """Backward compatibility: Get unified cache service"""
70
+ return BackwardCompatibleCacheManager()
71
+
72
+ def get_performance_monitor():
73
+ """Backward compatibility: Get unified analysis engine for performance monitoring"""
74
+ return UnifiedAnalysisEngine()
75
+
76
+ except ImportError:
77
+ # Fallback if core services are not available
78
+ def get_cache_manager():
79
+ """Fallback cache manager"""
80
+ return None
81
+
82
+ def get_performance_monitor():
83
+ """Fallback performance monitor"""
84
+ return None
85
+
86
+
87
+ __all__ = [
88
+ # Error handling
89
+ "ErrorHandler",
90
+ "MCPError",
91
+ "FileAccessError",
92
+ "ParsingError",
93
+ "AnalysisError",
94
+ "ValidationError",
95
+ "ResourceError",
96
+ "ErrorSeverity",
97
+ "ErrorCategory",
98
+ "handle_mcp_errors",
99
+ "get_error_handler",
100
+ # Backward compatibility
101
+ "get_cache_manager",
102
+ "get_performance_monitor",
103
+ # Module metadata
104
+ "MCP_UTILS_CAPABILITIES",
105
+ ]